Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pxlrbt/animation

Vanilla js class for simple animations.
https://github.com/pxlrbt/animation

animation javascript js vanilla vanilla-javascript vanilla-js

Last synced: 8 days ago
JSON representation

Vanilla js class for simple animations.

Awesome Lists containing this project

README

        

# Animation

Very simple vanilla js animation library.

## Installation

```js
npm install @pxlrbt/animation
```

## Usage

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