googlearchive / flipjs

A helper library for doing FLIP animations.
https://aerotwist.com/blog/flip-your-animations
Apache License 2.0
1.42k stars 90 forks source link

GSAP Support #13

Open shshaw opened 8 years ago

shshaw commented 8 years ago

The GSAP play option is nice, but a little lacking.

It would be helpful if flip.play() would return the TweenLite/TweenMax instance it creates when using the play: 'GSAP' option. Alternatively, the tween could be created & returned through another method ( flip.tween(), flip.gsap() ? ). Either of these would allow you to queue up multiple FLIP animations on a GSAP timeline, or control them manually with GSAP's methods.

Another helpful feature would be to pass along options to the TweenLite/TweenMax setup. Perhaps as an argument in the play method.

var flip = new FLIP({
  element: target,
  duration: 2000,
  play: 'GSAP'
});
flip.first();
flip.last('end');
flip.invert();
flip.play(null, {
  easing: "Power4.easeInOut",
  onComplete: function(){ console.log('animation complete!'); }
});