Created
December 16, 2014 17:13
-
-
Save subtubes-io/3cfc973cbf1cd39010dd to your computer and use it in GitHub Desktop.
Transitionables in Famo.us
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
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