Skip to content
Permalink
Browse files

Yup got it

  • Loading branch information...
koenbok committed Oct 27, 2014
1 parent 0f8c3bb commit 62e18b84f7c24ed998db151684a8c25fa4c2186d
Showing with 35 additions and 4 deletions.
  1. +33 −2 extras/CactusFramer/static/app.coffee
  2. +2 −2 framer/Layer.coffee
@@ -1,6 +1,37 @@
Framer.Device = new Framer.DeviceView()
Framer.Device.setupContext()

layer = new Layer

layer.draggable.enabled = true
selectionLayer = null

ctx = new Framer.Context name:"highlight"
ctx.run ->
selectionLayer = new Layer

selectionLayer.style =
border: "1px solid red"
zIndex: 1000

# Welcome to Framer

# Learn how to prototype: http://framerjs.com/learn
# Drop an image on the device, or import a design from Sketch or Photoshop

iconLayer = new Layer width:256, height:256
iconLayer.center()

# Define a set of states with names (the original state is 'default')
iconLayer.states.add
second: {y:100, scale:0.6, rotationZ:100}
third: {y:300, scale:1.3, blur:4}
fourth: {y:200, scale:0.9, blur:2, rotationZ:200}

# Set the default animation options
iconLayer.states.animationOptions =
curve: "spring(500,12,0)"

# On a click, go to the next state
iconLayer.on Events.Click, ->
iconLayer.states.next()

selectionLayer.frame = iconLayer.screenScaledFrame()
@@ -352,8 +352,8 @@ class exports.Layer extends BaseClass
layers.reverse()

for superLayer in layers
factorX = if superLayer.superLayer then superLayer.superLayer.screenScaleX() else 1
factorY = if superLayer.superLayer then superLayer.superLayer.screenScaleY() else 1
factorX = if superLayer._superOrParentLayer() then superLayer._superOrParentLayer().screenScaleX() else 1
factorY = if superLayer._superOrParentLayer() then superLayer._superOrParentLayer().screenScaleY() else 1
layerScaledFrame = superLayer.scaledFrame()
frame.x += layerScaledFrame.x * factorX
frame.y += layerScaledFrame.y * factorY

0 comments on commit 62e18b8

Please sign in to comment.
You can’t perform that action at this time.