Created
November 17, 2016 13:14
-
-
Save antonkartashov/2552f4f14e26bb88c7bd9db3754c28ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scroll = new ScrollComponent | |
size: Screen.size | |
scrollHorizontal: false | |
layers = [] | |
for i in [0..10] | |
layer = new Layer | |
parent: scroll.content | |
height: 300, width: 750 | |
scale: .95 | |
borderRadius: 10 | |
y: i * 300 + 15 | |
image: Utils.randomImage() | |
backgroundColor: "grey" | |
layer.onClick (events, clicked) -> | |
clicked.animate | |
height: 0 | |
opacity: 0 | |
options: time: .2 | |
for layer in layers | |
if layer.index > clicked.index then layer.animate | |
y: layer.y - 300 | |
options: | |
curve: "spring(250, 20, 0)" | |
delay: .03 * (layer.index - clicked.index) | |
layers.push layer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment