Created
May 25, 2014 22:06
-
-
Save LearnFamous/ae8d1c8f7af7a702d544 to your computer and use it in GitHub Desktop.
Famo.us TransitionableTransform example
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
// Famo.us TransitionableTransform example | |
ar Engine = require("famous/core/Engine"); | |
var Surface = require("famous/core/Surface"); | |
var Modifier = require("famous/core/Modifier"); | |
var TransitionableTransform = require("famous/transitions/TransitionableTransform"); | |
var mainContext = Engine.createContext(); | |
var surface = new Surface({ | |
size:[100,100], | |
content: 'Click Me', | |
classes: ['red-bg'], | |
properties: { | |
textAlign: 'center', | |
lineHeight: '100px' | |
} | |
}); | |
var transitionableTransform = new TransitionableTransform(); | |
var modifier = new Modifier({ | |
origin: [.5,.5], | |
transform: transitionableTransform | |
}); | |
surface.on("click", function(){ | |
transitionableTransform.setScale([3,3,1], {duration: 3000}); | |
}); | |
mainContext.add(modifier).add(surface); | |
// from https://famo.us/examples/0.2.0/transitions/transitionabletransform/example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment