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
// Sets up the base 10 stuff | |
html { font-size: 62.5%; } | |
// Defaults values | |
$default-line-height: 1.5 !default; | |
$default-font-smoothing: subpixel-antialiased !default; | |
// Function to convert pixels to rems |
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
ACCELERATION = 180 | |
INERTIA_CURVE = "spring(140, 30, 0, 0)" | |
Layer::inertia = -> | |
calculateFinalY = => | |
newY = @y + @draggable.calculateVelocity().y * ACCELERATION | |
switch | |
when newY > 0 then return 0 |
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
layer.on Events.DragEnd, (event) -> | |
event.stopPropagation() |
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
one = -> print 1 | |
two = -> print 2 | |
toggler = Utils.cycle(one, two) | |
layer.on Events.Click, -> do toggler() |
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
layer.animate | |
properties: | |
x: '+=50' | |
opacity: '-=0.1' |
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
layer.orgProps = layer.props for layer in Framer.CurrentContext.getLayers() |
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
"hsla(#{ i / numberOfLayers * 360 }, 70%, 70%, 1)" |
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
Framer.Loop.delta = 0.004 # Where higher number is faster |
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
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 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 |
OlderNewer