Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/yurayarosh/js-anim

Small JS plugin to animate elements in vieport
https://github.com/yurayarosh/js-anim

Last synced: about 1 month ago
JSON representation

Small JS plugin to animate elements in vieport

Awesome Lists containing this project

README

        

# js-anim

### Example

* [Codesandbox](https://codesandbox.io/s/js-anim-example-nxk4e)

### Install

```html
npm i js-anim
```

```html




```

```js
import Anim from 'js-anim'

const els = document.querySelectorAll('.js-anim-el');

const anim = new Anim(els);
anim.observe();
```

### Options

Standart options
```js
{
observer: {}, // intersectoinobserver options
infinite: false, // infinite observing
}
```

### Methods

```js
anim.onEnter = (animator) => {
// some callback
};
anim.onComplete = (animator) => {
// some callback
};
anim.unobserve();
```