Skip to content

Instantly share code, notes, and snippets.

View antonkartashov's full-sized avatar

Anton Kartashov antonkartashov

  • Orenburg, Russia
View GitHub Profile
.container
width 100%
height 100%
display flex
align-items center
justify-content center
.item
max-width 640px
touchDown = false
tapPosition =
x: 0
y: 0
layerA.on Events.TouchStart, (e) ->
touchDown = true
tapPosition.x = Events.touchEvent(e).clientX
tapPosition.y = Events.touchEvent(e).clientY
header = new Layer
width: Screen.width, height: 128
backgroundColor: "rgba(255, 255, 255, .42)"
shadowY: 2, shadowBlur: 0, shadowColor: "rgba(0, 0, 0, .15)"
style: "-webkit-backdrop-filter" : "blur(50px)"
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]
.content > p:first-child
font-size 1.2em
font-weight 100
.content > p:first-child + hr
border 0
margin-bottom 3em
<!DOCTYPE html>
<head>
<style>
.responsive {
width: 100%;
height: 100%;}
.content-wrap {width: 560px; margin: 0 auto;}
@media (min-width: 1170px) {
.h_iframe
position relative
.h_iframe .ratio
display block
width 100%
height auto
.h_iframe iframe
position absolute
.h_iframe
// transparent image
img.ratio(src="http://placehold.it/16x9")
iframe(data-src="https://www.youtube.com/embed/", frameborder="0", allowfullscreen)
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;
});
new BackgroundLayer
layers = []
icons = []
for i in [0..5]
icons[i] = new Layer
y: 223 * i + 60
maxX: Screen.width - 40
scale: 0