welcome to
AnimBase
The declarative animation engine

Features

  • Animate with pure HTML using data-* attributes
  • Supports timeline-based animations, scroll-controlled, input-driven, or triggered
  • Built-in easing functions, including spring, elastic, bounce
  • Small footprint: ~9KB minified
  • No runtime dependencies

Getting Started

Install via CDN or NPM and start animating in seconds.

๐Ÿ’ก CDN

<script src="https://cdn.jsdelivr.net/npm/animbase@1.1.2/dist/animbase.iife.min.js"></script>

๐Ÿ“ฆ NPM

npm install animbase

โš™๏ธ Import (ESM/CommonJS)

// ESM
import AnimBase from "animbase";

// CommonJS
const AnimBase = require("animbase");

๐Ÿš€ Usage Examples

๐ŸŽฏ Slide Me
<div
  data-anim-controller-ref="#slider"
  data-anim-init='{"transform": "translateX(0%) rotateZ(-90deg)"}'
  data-anim-config='{"100": {"transform": "translateX(200%.outQuad) rotateZ(0deg.outBounce)"}}'
>๐ŸŽฏ Slide Me</div>
<input type="range" min="0" max="100" value="50" id="slider">
๐ŸŽฌ Hello
<div
  data-anim-trigger-group="hello"
  data-anim-init='{"transform": "translateX(-100%) scale(0.5)", "opacity": "0"}'
  data-anim-config='{"100": {"transform": "translateX(100%.spring) scale(1.outSine)", "opacity": "1.out"}}'
>๐ŸŽฌ Hello</div>
<button onclick="AnimBase.play('hello', {once: true})">Play</button>

Curious how it works under the hood? Read the deep dive →

Use Cases & Showcase

AnimBase is perfect for a wide range of animation scenarios, including:

  • ๐ŸŽฌ Hero section animations
  • ๐ŸŽ  3D-style coverflow interfaces
  • ๐Ÿ“– Book-style page flip effects
  • ๐Ÿ”ค Letter-by-letter animated text
  • ๐Ÿงญ Scroll-based motion effects
  • ๐ŸŽ›๏ธ Range-slider driven animations
  • ๐Ÿงช Purely programmatic animations

Live Demos

Want to build something creative? Try combining animation timelines with your UI logic imperatively using the createTimedAnimator API.