Last active
March 26, 2016 04:51
-
-
Save antonkartashov/eae21157233155d73f55 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
| new BackgroundLayer | |
| layers = [] | |
| icons = [] | |
| for i in [0..5] | |
| icons[i] = new Layer | |
| y: 223 * i + 60 | |
| maxX: Screen.width - 40 | |
| scale: 0 | |
| borderRadius: 10 | |
| layer = new Layer | |
| backgroundColor: Utils.randomColor() | |
| height: 223 | |
| width: 750 | |
| y: 223 * i | |
| layer.draggable.enabled = true | |
| layer.draggable.vertical = false | |
| layer.draggable.constraints = | |
| x: -200 | |
| y: 222 * (i + 1) | |
| height: 220 | |
| width: 750 + 200 | |
| layers.push layer | |
| for layer, i in layers | |
| #layer.onDragEnd -> | |
| # если x меньше -100, то сдвинуть влево (x: -200) | |
| # если больше -100, то сдвинуть вправо (x: 0) | |
| # layer.onDragStart -> | |
| # Сдвинуть все сдвинутые слои вправо | |
| # Нужен цикл по всем слоям | |
| # layer.onChange "x", -> | |
| # Можно использовать это событие, чтобы вращать иконки | |
| # Используйте цикл по массиву icons |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment