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();
Standart options
{
observer: {}, // intersectoinobserver options
infinite: false, // infinite observing
}
anim.onEnter = (animator) => {
// some callback
};
anim.onComplete = (animator) => {
// some callback
};
anim.unobserve();