This file contains hidden or 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
exessiveSpring = "spring(200, 15, -3)" | |
gentleSpring = "spring(40, 5, 0)" | |
swingSpring = "spring(120, 15, 0)" | |
smoothSpring = "spring(100, 20, 0)" | |
superSlowSpring = "spring(30, 20, 0)" | |
slowSpring = "spring(100, 15, -3)" | |
snapSpring = "spring(200, 20, 0)" | |
tightSpring = "spring(300, 25, 0)" | |
straightSpring = "spring(500, 40, 0)" |
This file contains hidden or 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
myLayer.animate | |
properties: | |
opacity: 0.5 | |
curve: "ease" | |
repeat: 1 | |
delay: 2 | |
time: 1 |
This file contains hidden or 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
rows = 3 | |
cols = 3 | |
gutter = 16 | |
width = 96 | |
height = 96 | |
for rowIndex in [0..rows-1] | |
for colIndex in [0..cols-1] | |
This file contains hidden or 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
rows = 10 | |
gutter = 8 | |
width = 300 | |
height = 30 | |
for rowIndex in [0..rows-1] | |
cellLayer = new Layer | |
width: width |
This file contains hidden or 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
centeredLayer = new Layer | |
width: 200 | |
height: 200 | |
centeredLayer.center() | |
# Center it again on resizing the screen | |
window.onresize = -> centeredLayer.center() |
This file contains hidden or 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
myLayer = new Layer | |
x: 0 | |
y: 100 | |
width: 50 | |
height: 50 | |
myLayer.on Events.Click, -> | |
myLayer.animate | |
properties: {x:200} | |
curve: "spring(400,10,0)" |
This file contains hidden or 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
myLayer = new Layer | |
x: 0 | |
y: 100 | |
width: 100 | |
height: 100 | |
myLayer.draggable.enabled = true |
This file contains hidden or 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
myImageLayer = new Layer | |
x: 100 | |
y: 100 | |
width: 200 | |
height: 200 | |
myImageLayer.image = "http://goo.gl/gpEHNR" |
This file contains hidden or 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
scrollingLayer = new Layer | |
width: 200 | |
height: 400 | |
contentLayer = new Layer | |
width: 200 | |
height: 400 * 3 | |
image: "http://goo.gl/gpEHNR" | |
superLayer: scrollingLayer |
This file contains hidden or 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
myLayer = new Layer | |
x: 0 | |
y: 100 | |
width: 50 | |
height: 50 | |
myLayer.states.add | |
one: {x: 100} | |
two: {x: 200} |
NewerOlder