shanim
v0.1.20
Published
Small wrapper for Web Animation API to animate HTMLElements with comfort
Readme
About
Small wrapper for Web Animations API to animate HTMLElements with more ease. Initally made for my own projects :)
Install
npm install shanim
API
animate function wraps up element and creates start animation Scene. Scene provides a declarative API to manipulate animations
chainmethod ofSceneallows chaining animation step by step.togethermethod is for launching animations simultaneously.initmethod creates initiating animations to apply some initial styles which other animations will start from.
Example
import { animate, fade, backgroundColor } from 'shanim';
const element = document.querySelector('div.my-element')
const scene = animate(element)
scene.chain([backgroundColor("lightpink", { duration: 1000 }),fade(0),fade(1)]).play()
