Skip to content

Instantly share code, notes, and snippets.

@antonkartashov
Created November 17, 2016 12:52
Show Gist options
  • Save antonkartashov/d486445090269d0fca75c8ea6f1510fc to your computer and use it in GitHub Desktop.
Save antonkartashov/d486445090269d0fca75c8ea6f1510fc to your computer and use it in GitHub Desktop.
red = new Layer
x: 543
width: 207
height: 300
backgroundColor: "rgba(255,102,102,1)"
layer = new Layer
height: 300
image: Utils.randomImage()
backgroundColor: "grey"
width: 750
layer.onClick ->
if layer.x == 0
layer.animate
x: -200
options: time: .2
if layer.x == -200
layer.animate
x: 0
options: time: .2
red.onClick ->
layer.animate
height: 0
opacity: 0
options: time: .2
red.animate
height: 0
opacity: 0
options: time: .2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment