arozwalak
7/6/2014 - 1:07 PM

Famous: Easing Curves

Famous: Easing Curves

var Engine = require('famous/core/Engine');
var Surface = require('famous/core/Surface');
var Transform = require('famous/core/Transform');
var StateModifier = require('famous/core/StateModifier');
var Easing = require('famous/transitions/Easing');

var mainContext = Engine.createContext();

var surface = new Surface({
  size: [100, 100],
  properties: {
    color: 'white',
    textAlign: 'center',
    backgroundColor: '#FA5C4F'
  }
});

var stateModifier = new StateModifier({});

mainContext.add(stateModifier).add(surface);

stateModifier.setTransform(
  Transform.translate(100, 300, 0),
  { duration: 1000, curve: Easing.inOutBack }
);