Web Motion Library

Animation patterns you can describe to an AI builder — with a working demo, the prompt, and the failure modes.

Animations that survive a real build

Style guides tell you what a page should look like. They rarely tell you what it should do. Each entry below pairs a live demo with a prompt precise enough that a model produces the effect on the first attempt — including the details that get dropped, like descender clipping or how far a magnetic button is allowed to travel.

01

Scroll Reveal

Elements fade in and rise as they enter the viewport, driven by CSS alone — no scroll listener, no library.

CSS scroll-driven animations scroll
02

Magnetic Button

A button that leans toward the cursor as it approaches, then springs back when you leave. Under 20 lines of JavaScript.

pointer events + lerp cursor
03

Text Mask Reveal

An oversized headline slides up from behind a hard edge, line by line, with a staggered delay.

clip-path + transform load
04

Sticky Scroll Story

A panel stays pinned while the copy advances beside it — the standard structure for brand storytelling.

position: sticky + IntersectionObserver scroll
05

Aurora Background

Soft blurred colour fields drift behind the content, slow enough to read as atmosphere rather than motion.

CSS radial-gradient + keyframes load
06

Card Spotlight

A soft highlight tracks the pointer across a card surface, revealing a border glow at the same position.

CSS variables + radial-gradient mask cursor

Why prompts, not snippets

A copied CSS snippet solves today's problem and nothing else — it does not survive a redesign, a different framework, or a model that decides to rewrite your markup. A prompt that states the mechanism, the constraints and the failure mode transfers. That is why every entry here leads with the prompt and treats the code as evidence that it works.

The four things every prompt on this page specifies, and which most prompts leave out: