npm.io
1.0.0 • Published 6 years ago

@pxlrbt/animation

Licence
MIT
Version
1.0.0
Deps
0
Size
5 kB
Vulns
0
Weekly
0

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');