§ 1 — Quickstart
Twelve lines. That is the entire surface.
A scene-graph is a tree of nodes — each one declares its own easing, duration, and value trajectory. The compiler resolves dependencies, deduplicates timelines, and emits a flat render plan the runtime can execute at 144fps. Below is the smallest declaration that compiles to a real animated scene; copy it, run it, and the rest of the reference will make sense.
// install: npm install [email protected]
import { scene, animate } from "codeanimato";
export const intro = scene("intro", (root) => {
root.add("headline", {
ease: "spring(0.18, 0.86)",
from: { y: 24, opacity: 0 },
to: { y: 0, opacity: 1 },
duration: 640,
});
});
animate(intro);
Compiled bundle: 14.6 KB gzipped · P95 frame time: 6.2 ms on mid-tier Android.
Declarative
You describe what a node should look like at the end of its timeline. The runtime owns how it gets there.
Composable
Scenes nest. Children inherit timing from their parent unless they explicitly override it.
Inspectable
Every timeline is a plain object — serialise it, diff it between builds, replay it in the devtools panel.