Skip to content

Instantly share code, notes, and snippets.

Created August 15, 2016 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/611606240272ac3f40fc54025604de46 to your computer and use it in GitHub Desktop.
Save anonymous/611606240272ac3f40fc54025604de46 to your computer and use it in GitHub Desktop.
var anim1 = function (duration) {
var tl = new TimelineMax();
//
// Define tweens
//
var tw1 = new TweenMax.fromTo(elA, 1, {borderWidth: 0}, {borderWidth: 4});
var tw2 = new TweenMax.staggerFromTo(myEls, 2, {scaleX: 0, force3D: true}, {scaleX: 1}, .2);
// Add more tw...
//
// Add tweens to the timeline
//
tl.add(tw1);
tl.add(tw2);
//
// Rescale time
//
(typeof duration !== 'undefined') && tl.timeScale(tl.totalDuration()/(duration+.000001));
return tl;
};
var anim2 = function (duration) {
...
};
//
// Compose anims
//
var tl = new TimelineMax();
var tw1 = anim1(4);
var tw2 = anim2(8);
tl.add(tw1);
tl.add(tw2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment