Skip to content

Instantly share code, notes, and snippets.

View mrrocks's full-sized avatar
🤓
Learning

Fran Pérez mrrocks

🤓
Learning
View GitHub Profile
@mrrocks
mrrocks / framerClassDefaultProperties.coffee
Last active May 3, 2016 04:59
Framer class default properties
class MyLayer extends Layer
constructor: (options) ->
defaults =
width: 400
backgroundColor: "transparent"
super _.defaults(options, defaults)
layer = new MyLayer
@mrrocks
mrrocks / global-layers.coffee
Created February 14, 2016 20:59
Make all layers in an imported set available on the top level
Utils.globalLayers(sketchLayers)
@mrrocks
mrrocks / custom-properties.coffee
Created February 14, 2016 20:34
Layer class custom properties
class Class extends Layer
@define "newProperty",
get: ->
@property
set: (value) ->
@property = value
@emit "change:newProperty"
object = new Class
@mrrocks
mrrocks / material-curves.coffee
Created July 22, 2015 15:50
Material Animation Curves
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})"
@mrrocks
mrrocks / slowmotion.coffee
Last active August 29, 2015 14:25
Slowmotion in Framer
Framer.Loop.delta = 0.004 # Where higher number is faster
"hsla(#{ i / numberOfLayers * 360 }, 70%, 70%, 1)"
@mrrocks
mrrocks / originalProps.coffee
Last active February 14, 2016 20:34
Store initial properties for later use
layer.orgProps = layer.props for layer in Framer.CurrentContext.getLayers()
@mrrocks
mrrocks / relative-values.coffee
Created March 3, 2015 11:55
Relative values in animation/state properties
layer.animate
properties:
x: '+=50'
opacity: '-=0.1'
@mrrocks
mrrocks / cycle.coffee
Created February 22, 2015 17:25
Cycle through functions in FramerJS
one = -> print 1
two = -> print 2
toggler = Utils.cycle(one, two)
layer.on Events.Click, -> do toggler()
@mrrocks
mrrocks / stoppropagation.coffee
Last active August 29, 2015 14:15
Stop event propagation in FramerJS
layer.on Events.DragEnd, (event) ->
event.stopPropagation()