@ikerya/animate.js

1.0.21 • Public • Published

Animate.JS

This package aims to replace Animate.CSS using JS step-by-step (requestAnimationFrame) animations instead of CSS ones (keyframes).

Usage

Demo

First option

// fadeOut

const start = new AnimateJS(
    document.getElementById('block'),
    {
        keyframes: [{
            opacity: [ 1 ]
        }, {
            duration: 1000,
            opacity: [ 1, 0 ]
        }]
    }
);

start().then(() => console.log("ended"));

Second option

// fadeOut

const options = {
    duration: 500
};
const start = AnimateJS.use(
    'fadeOut',
    document.getElementById('block'),
    options // optional
);

start().then(() => console.log("ended"));

Package Sidebar

Install

npm i @ikerya/animate.js

Weekly Downloads

1

Version

1.0.21

License

ISC

Unpacked Size

34.8 kB

Total Files

38

Last publish

Collaborators

  • i.kerya