Skip to content

Instantly share code, notes, and snippets.

@LearnFamous
Created May 25, 2014 22:06
Show Gist options
  • Save LearnFamous/ae8d1c8f7af7a702d544 to your computer and use it in GitHub Desktop.
Save LearnFamous/ae8d1c8f7af7a702d544 to your computer and use it in GitHub Desktop.
Famo.us TransitionableTransform example
// 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