Vanilla js class for simple animations.
  • JavaScript 100%
Find a file
2020-04-28 16:05:58 +02:00
.github/workflows Initial 2020-04-28 16:05:58 +02:00
src Initial 2020-04-28 16:05:58 +02:00
package.json Initial 2020-04-28 16:05:58 +02:00
README.md Initial 2020-04-28 16:05:58 +02:00

Animation

Very simple vanilla js animation library.

Installation

npm install @pxlrbt/animation

Usage

import { Animation, EasingFunctions } from '@pxlrbt/animation';

let animation = new Animation();
animation.from(0).to(100).delay(5000).duration(600).easing(EasingFunctions.easeInEaseOut).step((step) => {
    console.log('Current', step.current);
    console.log('Progress', step.progress);
    console.log('From', step.from);
    console.log('To', step.to);
});

animation.animate();
// or
await animation.animate()
console.log('Animation done');