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
| class MyLayer extends Layer | |
| constructor: (options) -> | |
| defaults = | |
| width: 400 | |
| backgroundColor: "transparent" | |
| super _.defaults(options, defaults) | |
| layer = new MyLayer |
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
| Utils.globalLayers(sketchLayers) |
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
| class Class extends Layer | |
| @define "newProperty", | |
| get: -> | |
| @property | |
| set: (value) -> | |
| @property = value | |
| @emit "change:newProperty" | |
| object = new Class |
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
| fastInSlowOut = [0.4, 0, 0.2, 1] | |
| fastInRealSlowOut = [0.4, 0, 0, 1] | |
| linearInSlowOut = [0, 0, 0.2, 1] | |
| fastInLinearOut = [0.4, 0, 1, 1] | |
| # Use: curve: "bezier-curve(#{fastInSlowOut})" |
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
| Framer.Loop.delta = 0.004 # Where higher number is faster |
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
| "hsla(#{ i / numberOfLayers * 360 }, 70%, 70%, 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
| layer.orgProps = layer.props for layer in Framer.CurrentContext.getLayers() |
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
| layer.animate | |
| properties: | |
| x: '+=50' | |
| opacity: '-=0.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
| one = -> print 1 | |
| two = -> print 2 | |
| toggler = Utils.cycle(one, two) | |
| layer.on Events.Click, -> do toggler() |
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
| layer.on Events.DragEnd, (event) -> | |
| event.stopPropagation() |
NewerOlder