Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var Engine = require('famous/core/Engine');
var Surface = require('famous/core/Surface');
var StateModifier = require('famous/modifiers/StateModifier');
var Transform = require('famous/core/Transform');
var mainContext = Engine.createContext();
function translateModifier(){
return new StateModifier({
transform: Transform.translate(200, 0, 0)
});
}
function rotateModifier(){
return new StateModifier({
transform: Transform.rotateZ(Math.PI/4)
});
}
function createSurface(className){
return new Surface({
size: [100, 100],
classes: [className]
});
}
mainContext
.add(translateModifier())
.add(rotateModifier())
.add(createSurface('red-bg'));
mainContext
.add(rotateModifier())
.add(translateModifier())
.add(createSurface('grey-bg'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.