A Promise wrapper around gsap / tweenlite.
var animate = require('gsap-promise')
Promise.all([
animate(element, 1.0, { x: 10 }),
animate(element, 1.0, { y: 10, delay: 0.5 })
]).then(function() {
console.log("all animations finished")
})
This promisifies the TweenMax
methods: to
, from
, set
and fromTo
. This uses Bluebird, and has basic support for cancellation.
Matches the TweenMax methods by the same name, but returns a Promise for the onComplete event.
An alias for Promise.all
, which will trigger all tweens in parallel.
The default export is the same as animate.to
.
MIT, see LICENSE.md for details.