How do you explain to an AI that a landing-page button should gently pull toward the cursor instead of bouncing across the screen like a rubber ball? Ask a chat assistant for 'a lively hover effect' and you know what happens: it either drags in a heavy library for three lines of motion or animates top and left, making the layout jitter.
It's like going to a barber without a reference photo. You wave your hands around saying 'make the sides smoother' and hope for the best. Without the name of a technique and a visual example, you and the AI are speaking different languages.
A Visual Dictionary Instead of 'Make It Pretty'
Matin Monshizadeh built the free Animation Handbook under the MIT license (source on GitHub). Inside are 176 web animations in pure HTML, CSS, and JS — no frameworks, no bundlers, no CDNs. Each effect lives in its own folder with a standalone index.html and a README.md explaining the mechanics, parameters, and production caveats.
| Category | What's Inside | Techniques |
|---|---|---|
| Micro-Interactions | Hover, click, focus, toggles, and loaders | 44 |
| 3D & Advanced | Perspective, shaders, particles, and WebGL | 28 |
| Scroll-Based | Parallax, sticky blocks, and scroll effects | 27 |
| Ambient & Background | Ambient motion, glow, and textures | 26 |
| Text & Typography | Kinetic text and letter effects | 19 |
| Page Transitions | Screen swaps, morphing, and View Transitions API | 17 |
| Entrance & Exit | Appearing, hiding, and FLIP animation | 15 |
A quick note on the terms in the table. Micro-interactions are brief responses to user actions like clicks or toggles. The View Transitions API is a built-in browser mechanism for smooth transitions between DOM states without JS wrappers. And FLIP animation (First, Last, Invert, Play) moves an element to a new grid slot using GPU transform without forcing the browser to recalculate the entire layout.
Animation X-Ray and the Magnetic Button
Don't know the name of an effect you saw on another site? The built-in Finder narrows it down with three questions: what moved, when, and how. You can also browse by UI area like buttons or cards, and the Famous effects section breaks down popular tricks from well-known websites.
Every demo page includes three handy tools. See inside turns on an x-ray overlay showing hidden layers, radii, and guides. Compare places a stripped-down version next to the real effect so you can spot the difference right away. Once you've tuned the speed or strength sliders, click Copy prompt to grab an AI-ready prompt with your exact settings.
Fair question: why look at plain HTML and JS if your project already uses Motion, GSAP, or Three.js? Because of the fundamentals. Libraries change the syntax, while the math behind the motion stays the same. Seeing it without wrappers makes it easier to give an agent a clear task and spot when it cuts corners.
Below is a live example of the Magnetic Button technique from the handbook. Move your cursor around the button and check the code tab.
Live Demo: Magnetic Button from Animation Handbook
The script calculates the vector from the button center to the cursor, writes the offset to --tx and --ty, and shifts the label 35% further for a floating effect. When the cursor leaves, JS clears the custom properties and cubic-bezier eases the button back. In production, add a window.matchMedia('(hover: hover)').matches check, wrap writes in requestAnimationFrame on heavy pages, and limit these buttons to 1–2 per screen.
Local Setup and Limitations
Any index.html in the repository runs offline straight over file://, though the README.md descriptions and Copy prompt button need a local HTTP server.
# Clone the repository and start a local Python server
git clone https://github.com/matinmonshizadeh/animation-handbook.git
cd animation-handbook
python3 -m http.server 8000 --bind 127.0.0.1
Once running, open http://127.0.0.1:8000/. The root folder includes a CLAUDE.md spec in case you want to add your own techniques with an AI agent.
All demos work on touch screens, support keyboard controls (arrow keys move a virtual cursor, Escape resets position), and respect prefers-reduced-motion, the OS setting for disabling extra motion. Browser support has a few caveats: eight 3D & Advanced effects require WebGL (and GPGPU Particle System needs WebGL 2 with floating-point color buffers) and show a fallback without it, except Depth-Map Photo which falls back to 2D Canvas. The View Transitions API degrades to a simple fade in older browsers, Stacking Cards falls back to JS, and edge refraction in Liquid Glass works only in Chromium — other browsers render standard frosted glass via backdrop-filter.


