0.0.6 • Published 1 month ago
animate.ts v0.0.6
animate.ts
animate.ts is an animation library for Typescript.
install animate.ts
npm install animate.ts
usage
import animate from 'animate.ts';
function easing(x: number): number {
return x;
}
// an animation will run for 3 seconds
const stop = animate({
start: 0,
end: 1000,
duration: 3000,
easing: easing.easeOutBounce,
onStep: (progress: number, x: number) => {
console.log("current progress",progress); // 'easing' return value
console.log("current x",x); // the range of x is form start to end
}
})
use easing
import easing from 'animate.ts/dist/easing.js';
stop animation
// if you want to stop animation after two seconds
setTimeout(stop, 2000)