Skip to content

Instantly share code, notes, and snippets.

@antonkartashov
Last active January 28, 2016 10:24
Show Gist options
  • Save antonkartashov/6b9fa4a884ae91271f39 to your computer and use it in GitHub Desktop.
Save antonkartashov/6b9fa4a884ae91271f39 to your computer and use it in GitHub Desktop.
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]
id = parseInt @id - 1
if j > id then layers[j].animate
properties:
y: 200 + j * 320 + 20
time: .3
this.animate
properties:
height: this.height + 200
time: .3
layers.push lay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment