Searching Open Sourcery

Type to search Open Sourcery.

Motion & Scroll

Animation Engine

Declarative scene sequencing — chainable scenes with easing, staggers, loops, and randomness.

v0.2.1@magic-spells/animation-engine

$ npm i @magic-spells/animation-engine

GitHubnpm

Usage

import { scene, rand } from '@magic-spells/animation-engine';

const box = document.querySelector('#box');

const intro = scene({ defaults: { easing: 'ease-in-out' } })
  .set(box, { opacity: 0, transform: 'translateY(20px) scale(0.9)' })
  .to(box, { opacity: 1, transform: 'translateY(0px) scale(1)' }, { duration: 500, easing: 'back-out' })
  .wait(200)
  .to(box, { opacity: 0 }, { duration: 400 });

await intro.play();

About

Declarative animation sequencing engine — chainable scenes with easing, physics, staggers, loops and randomness for the magic-spells ecosystem.

About, features, usage and options are taken from the package README.