Skip to content

Instantly share code, notes, and snippets.

@romainl
Created January 18, 2016 20:41
Show Gist options
  • Save romainl/afad172796d22f087757 to your computer and use it in GitHub Desktop.
Save romainl/afad172796d22f087757 to your computer and use it in GitHub Desktop.
Animation libraries in a CommonJS context
// require
var TweenLite = require("../../../node_modules/gsap/src/uncompressed/TweenLite");
require("../../../node_modules/gsap/src/uncompressed/plugins/CSSPlugin");
// use
TweenLite.to(element, 1, {alpha: 0.3});
// require
var TweenMax = require("../../../node_modules/gsap/src/uncompressed/TweenMax");
// use
TweenMax.to(element, 1, {alpha: 0.3});
// require
var velocity = require("velocity-animate");
// use
velocity(element, {opacity: 0.3}, {duration: 1000});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment