Created
March 28, 2017 05:57
-
-
Save sollmo/530780b3a66d21bdaa63ca1a16229f11 to your computer and use it in GitHub Desktop.
example Scroll Component
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
background = new BackgroundLayer | |
backgroundColor: '#333' | |
scroll = new ScrollComponent (width:300, height:300, borderRadius: 6, backgroundColor:'#111') | |
scroll.center() | |
for i in [0..5] | |
layer = new Layer | |
parent: scroll.content | |
width: scroll.width - 40 | |
height: scroll.height / 3 | |
x: 20 | |
y: (scroll.height / 3 + 20 ) * i | |
backgroundColor: '#fff' | |
borderRadius: 4 | |
name: "card"+i | |
scroll.scrollHorizonal = false #왜 안먹히지 | |
scroll.contentInset = top:20 | |
scroll.states = | |
second: | |
height: 600 | |
y: scroll.y-100 | |
scroll.states.animationOptions = curve: 'spring(250, 25, 0)' | |
button = new Layer | |
width:300 | |
height:120 | |
borderRadius: 6 | |
backgroundColor:'#red' | |
y: 100 | |
html: "<Br>Click to resize a scroll compoent" | |
button.centerX() | |
button.style = | |
color: "#fff" | |
fontSize: "24px" | |
fontFamily: "Calibri, Arial, sans-serif" | |
fontWeight: "bold" | |
lineHeight: "28px" | |
textAlign: "center" | |
button.on Events.Click, -> | |
scroll.stateCycle() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment