Numbers in motion
The scalar building blocks: turn time, input, or distance into a usable value. Almost every animation downstream is just these, repeated.
the library behind the lessons
Every animation on this site comes apart into small, nameable pieces of math — a lerp, an easing curve, a vector reflection. This is that toolbox: pure functions in @utilspalooza/core, published on npm. (A companion effects package that composes these primitives into finished canvas effects is in the works.) Read it to understand the idea, then take the code.
npm i @utilspalooza/corev0.1.0 on npm ↗MIT licensesource on GitHub ↗
142 functions, grouped by the idea they teach — not by file. Every one is a pure, typed, tested piece of the math that makes a thing move. Pick a concept, then click any name to read its full signature, params, and a runnable example.
The scalar building blocks: turn time, input, or distance into a usable value. Almost every animation downstream is just these, repeated.
Why motion feels alive instead of robotic. The curves that shape acceleration, plus tiny time-driven helpers that sample them — they move values, never your render layer.
Where sine and cosine stop being homework and become rotation, orbits, and waves. Degrees, radians, and the unit circle, made visible.
How anything that moves knows where it is going. Add, scale, rotate, reflect, normalize — the grammar of position and velocity in 2D.
The geometry under shapes and paths: distances, points along a line, triangle math, Bezier curves, and placing things evenly around a circle.
The question every game asks: are these two things touching? Circles, rectangles, lines, points, and polygons, in every combination.
Color as math you can interpolate. Convert between RGB and HSL, blend two colors, and build palettes that actually go together.
Where simple rules produce complex, lifelike behavior: bouncing, orbits, flocking, gravity, lensing, and cellular automata.
The small conveniences every demo needs and nobody wants to rewrite: random numbers, number formatting, centering on a parent.
The shared shapes — Point, Circle, Line, Polygon, Vector — that the whole library speaks in.
Recently added to the package and not yet slotted into a concept above.
The same math, composed into drop-in canvas pieces. This is the planned follow-on package surface: each effect creates a canvas, runs its own loop, and hands back a lifecycle handle.
import { mountGlitter } from "@utilspalooza/effects";
const effect = mountGlitter("#hero", {
density: 0.8,
interactive: true,
seed: 23,
});
effect.pause();
effect.resume();
effect.resize();
effect.destroy();mountGlitterA field of glow dots and radial beams driven by cosine oscillators.
mountPrettyRingLayered radial placement, wobble, additive glow, and pointer pulse.
mountSparkliesSmall fireworks built from rotated local beam coordinates.
mountKlimtTip-to-tail rectangle ribbons using local-coordinate stepping.