A simple class based tweening engine for javascript
Download the tween.js
file and add it to your project. Now you can easily create tweens like this:
import Tween from "./tween.js";
let emoji = {x: 0, y: 0};
let tween = new Tween(emoji, 1.3, {
x: 800,
ease: "easeOutSine",
});
It works perfectly with class based objects, but also with simple object.
speed
(default:1.0
)delay
(default:0
)repeat
(default:0
)yoyo
(default:false
)autoStart
(default:true
)ease
(default:linear
)
linear
(default)easeInCircular
,easeOutCircular
,easeInOutCircular
easeInCubic
,easeOutCubic
,easeInOutCubic
easeInExpo
,easeOutExpo
,easeInOutExpo
easeInQuadratic
,easeOutQuadratic
,easeInOutQuadratic
easeInQuartic
,easeOutQuartic
,easeInOutQuartic
easeInQuintic
,easeOutQuintic
,easeInOutQuintic
easeInSine
,easeOutSine
,easeInOutSine
easeInBounce
,easeOutBounce
,easeInOutBounce
easeInElastic
,easeOutElastic
,easeInOutElastic
easeInBack
,easeOutBack
,easeInOutBack