Make it easier to manage animations during playback:
-
Expose the functionality of both tweenState and springTo which let you pause, resume or stop animations, during playback. Both add-ons have this functionality hidden away - expose it, and update the docs.
-
Add a direction prop to tweenState and springTo configs, based on CSS direction property
-
Add a stopAt prop, to say where the anim should skip to when stopped (current, start or end).
-
Add repeat and repeatDelay props, to apply staggered anims to a collection of elems/items.
Example usage:
Foo.setState({ x: 0 });
const myAnim = Foo.tweenState(
// the props to tween
{ x: 99 },
// the tween settings
{
paused: true, // don't auto play
duration: 4000,
direction: 'alternate', // which direction to animate.. can be 'forward', 'backward', 'alternate'
stopAt: 'end', // where to go when stop() is called during playback.. can be 'current', 'end' or 'start'
repeat: 3, // loop 3 times
repeatDelay: 1000, // pause for 1 second between each loop
}
);
myAnim.play() // start the tween
myAnim.pause() // pause the tween
myAnim.resume() // continue the tween
myAnim.stop() // stop the tween, (and go back to frame 1 or end, see `stopAt` prop)
Make it easier to manage animations during playback:
Expose the functionality of both
tweenStateandspringTowhich let you pause, resume or stop animations, during playback. Both add-ons have this functionality hidden away - expose it, and update the docs.Add a
directionprop to tweenState and springTo configs, based on CSSdirectionpropertyAdd a
stopAtprop, to say where the anim should skip to when stopped (current,startorend).Add
repeatandrepeatDelayprops, to apply staggered anims to a collection of elems/items.Example usage: