Skip to content

ryngonzalez/TweenMachine

Repository files navigation

TweenMachine

Tween.js provides wonderful support for tweening between states over a duration of time. But what if you wanted to do a tween based on touch position over an area, or the percentage of a download completed? TweenMachine decouples the tweening logic of Tween.js from the depency of time. Use the same easing & interpolation functions available to Tween.js to build reversible, touch and movement dependent animation.

Usage

To start, create a new TweenMachine:

var tween = new TweenMachine(0, 100);

tween.easing('Bounce.InOut')
     .interpolation('Bezier')

var valueAtZeroPercent = tween.get(0.0),
    valueAtFiftyPercent = tween.get(0.5),
    valueAtHundredPercent = tween.get(1);

Easing Functions

Based off of Robert Penner's Easing Functions.

About

📉 A simpler, time-independent fork of Tween.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published