Skip to content

yurayarosh/js-anim

Repository files navigation

js-anim

Example

Install

npm i js-anim
<div class="box js-anim-el" data-anim-name="slideRight" data-anim-iterations="4" data-anim-delay="200" data-anim-duration="750" data-anim-ease="cubic-bezier(0.19, 1, 0.22, 1)">
    
</div>
import Anim from 'js-anim'

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

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

Options

Standart options

{
  observer: {}, // intersectoinobserver options
  infinite: false, // infinite observing
}

Methods

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

About

Small JS plugin to animate elements in vieport

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published