Skip to content

Instantly share code, notes, and snippets.

View antonkartashov's full-sized avatar

Anton Kartashov antonkartashov

  • Orenburg, Russia
View GitHub Profile
bg = new Layer backgroundColor: "#2d383e"
phoneScreen = new Layer
width: 750
height: 1334
clip: true
backgroundColor: "black"
(window.onresize = ->
phoneScreen.center()
if Utils.isDesktop() is true
HTMLPreviewBackground = new Layer
backgroundColor: "#2d383e"
HTMLPreview = Screen
Screen = new Layer
width: 750
height: 1334
clip: true
icon = new Layer
y: 60
maxX: Screen.width - 40
scale: 0.2
borderRadius: 10
backgroundColor: "white"
layer = new Layer
backgroundColor: Utils.randomColor()
height: 223
new BackgroundLayer
layers = []
icons = []
for i in [0..5]
icons[i] = new Layer
y: 223 * i + 60
maxX: Screen.width - 40
scale: 0
var layer = document.getElementsByClassName("header-wrap")[0];
window.addEventListener('scroll', function() {
var scrolltop = window.pageYOffset;
layer.style.top = -scrolltop * .09 + 20 + 'px';
layer.style.opacity = 1 - scrolltop * .002;
});
.h_iframe
// transparent image
img.ratio(src="http://placehold.it/16x9")
iframe(data-src="https://www.youtube.com/embed/", frameborder="0", allowfullscreen)
.h_iframe
position relative
.h_iframe .ratio
display block
width 100%
height auto
.h_iframe iframe
position absolute
<!DOCTYPE html>
<head>
<style>
.responsive {
width: 100%;
height: 100%;}
.content-wrap {width: 560px; margin: 0 auto;}
@media (min-width: 1170px) {
.content > p:first-child
font-size 1.2em
font-weight 100
.content > p:first-child + hr
border 0
margin-bottom 3em
layers = []
for i in [0..5]
lay = new Layer
width: 750, height: 300
y: 20 + i * 320
backgroundColor: Utils.randomColor()
lay.on "click", ->
for j in [0..5]