Created
April 7, 2016 10:53
-
-
Save antonkartashov/9a559825605e3a23587466af77590723 to your computer and use it in GitHub Desktop.
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
# http://share.framerjs.com/jb2h1vh54qvn/ | |
pagesA = new PageComponent | |
size: Screen.size | |
scrollVertical: false | |
page = [] | |
dots = [] | |
for i in [0..10] | |
dots[i] = new Layer | |
width: 20 | |
height: 20 | |
x: 40 * i | |
y: 1250 | |
backgroundColor: "white" | |
borderRadius: "50%" | |
opacity: .5 | |
page[i] = new Layer | |
size: Screen.size | |
backgroundColor: Utils.randomColor() | |
parent: pagesA.content | |
x: i * Screen.width | |
margin = (Screen.width - (dots.length * 40 + 20)) / 2 | |
for d, j in dots | |
d.x = 40 * j + margin | |
currentDot = new Layer | |
width: 20 | |
height: 20 | |
x: margin | |
y: 1250 | |
backgroundColor: "white" | |
borderRadius: "50%" | |
scale: 1 | |
pagesA.onChange "currentPage", -> | |
for pg, i in page | |
if pagesA.currentPage is pg | |
currentDot.x = margin + i * 40 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment