Skip to content

Instantly share code, notes, and snippets.

@subtubes-io
Created December 16, 2014 17:13
Show Gist options
  • Save subtubes-io/3cfc973cbf1cd39010dd to your computer and use it in GitHub Desktop.
Save subtubes-io/3cfc973cbf1cd39010dd to your computer and use it in GitHub Desktop.
Transitionables in Famo.us
define(function (require, exports, module) {
"use strict";
var Engine = require("famous/core/Engine"),
Surface = require("famous/core/Surface"),
Transitionable = require("famous/transitions/Transitionable"),
Modifier = require("famous/core/Modifier"),
Transform = require("famous/core/transform");
var context = Engine.createContext(),
mod, opacityTransform, surf;
opacityTransform = new Transitionable(0);
mod = new Modifier({
origin: [0.5, 0.5],
align: [0.5, 0.5],
size: [100, 100]
});
surf = new Surface({
content: "Hello World"
});
mod.opacityFrom(opacityTransform);
opacityTransform.set(1, {duration: 3000}, function () {
console.log("we are done");
});
context.add(mod).add(surf);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment