Permalink
Browse files

_Layer

  • Loading branch information...
koenbok committed Dec 1, 2016
1 parent 239131b commit e9d7ba1e62aedf178ef5b2d03753021f7b86ef73
@@ -1,20 +1,18 @@
# Card
class Card extends Layer
constructor: (options={}) ->
options.size ?= Screen
options.backgroundColor ?= Utils.randomColor()
options.visible = false
super options
Utils.labelLayer(@, "Card #{@id}")
c1 = new Card()
c2 = new Card()
c3 = new Card()
nav = new NavComponent(c1)
c1.onTap -> nav.showNext(c2)
c2.onTap -> nav.showPrevious()
nav.onTransitionEnd (args...) ->
print "end", @, args
# Create layers
layerA = new Layer
size: Screen.size
backgroundColor: "#00AAFF"
layerB = new Layer
size: Screen.size
backgroundColor: "#FFCC33"
# Create FlowComponent and show layer
flow = new FlowComponent
flow.showNext(layerA)
# Instantly show layerB on click
layerA.onClick ->
flow.showNext(layerB)
layerB.onClick ->
flow.showPrevious(layerA)
@@ -13,7 +13,7 @@
"deviceOrientation" : 0,
"selectedHand" : "",
"foldedCodeRanges" : [
"{0, 215}"
],
"deviceScale" : "fit"
}
@@ -2,7 +2,7 @@ Framer.Extras.Hints.enable()
sketch = Framer.Importer.load("imported/Mail2@2x")
nav = new NavComponent
nav = new FlowComponent
nav.push(sketch.inbox)
sketch.hamburger.onTap -> nav.modal(sketch.menu)
@@ -179,7 +179,7 @@ class exports.FlowComponent extends Layer
return if @isTransitioning
# Maybe people (Jorn) pass in a layer accidentally
options = {} if options instanceof(Framer.Layer)
options = {} if options instanceof(Framer._Layer)
options = _.defaults({}, options, {count: 1, animate: true})

0 comments on commit e9d7ba1

Please sign in to comment.