176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.
HTML ai-promptsanimationcss-animationsfrontendgithub-pagesjavascriptmicrointeractionsmotion-designno-dependenciesreferencescroll-animationui-animationweb-animationweb-developmentwebgl
feat: an AI skill with every page's prompt and settings, and llms.txt, both written from the pages by tools/make-skill.mjs, with a test that keeps them up to date
matina4a464ae17f7
diff --git a/llms.txt b/llms.txtnew file mode 100644index 00000000..2fdc482c--- /dev/null+++ b/llms.txt@@ -0,0 +1,196 @@+# Animation Handbook++> A visual reference of 166 web animation techniques, each with a live demo and a plain-words prompt for building it with an AI assistant.++Each page plays one technique live and gives a ready-made prompt that describes it in plain words, with no code. Most pages also have a few plain settings, such as speed or direction, and the prompt you copy lists your choices. Each technique's folder on GitHub has a README on how it works, the values that matter and production notes. To give an AI coding assistant all 166 prompts and settings at once, install the Agent Skill: `npx skills add matinmonshizadeh/animation-handbook`.++## Scroll-Based++- [Parallax Depth-of-Field](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/parallax-depth-of-field/): Layers move at their own speed as the focus shifts. Best for cinematic intros.+- [Parallax Scrolling](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/parallax-scrolling/): Far layers move slower than near ones as you scroll. Best for hero scenes.+- [Reverse-Scrolling Columns](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/reverse-scrolling-columns/): Side columns run the opposite way to the middle one. Best for portfolios.+- [Cover Card to Fixed Header](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/cover-card-to-fixed-header/): A tall cover shrinks into a slim header as you scroll. Best for articles.+- [Fly-in Fly-out Contact List](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/fly-in-fly-out-contact-list/): Rows fade and slide as they near the top or bottom edge. Best for long lists.+- [Stacking Cards](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/stacking-cards/): Cards stick at the top and pile into a deck. Best for step-by-step stories.+- [Scroll-Triggered Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-trigger/): Animations start, follow and pin at set scroll points. Best for landing pages.+- [Scrub Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scrub-animation/): Scroll plays it forward and back, like dragging a video. Best for product tours.+- [Pin Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/pin-animation/): One part stays put while its text changes on scroll. Best for feature lists.+- [Snap Scrolling](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/snap-scrolling/): The box settles on one whole section at a time. Best for slides and galleries.+- [Scrollytelling](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scrollytelling/): A picture beside the story changes as you read down. Best for data stories.+- [Reveal on Scroll](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/reveal-on-scroll/): Cards appear as they cross a line in the box. Best for long landing pages.+- [Stagger Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/stagger-reveal/): Items in a group appear one after another as it scrolls in. Best for card grids.+- [Horizontal Scroll](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/horizontal-scroll/): Scroll down and a row of panels slides sideways. Best for portfolios.+- [Sticky Section](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/sticky-section/): A section holds still while its content changes. Best for feature tours.+- [Counter Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/counter-animation/): Numbers count up when they scroll into view. Best for stats.+- [Progress Bar](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/progress-bar/): A bar fills as you read down the page. Best for long articles.+- [Section Wipe](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/section-wipe/): Each section slides up over the one before. Best for full-screen stories.+- [Zoom Into Image](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/zoom-into-image/): A small window opens up to fill the box as you scroll. Best for hero images.+- [Scroll Image Sequence](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-image-sequence/): Scrolling plays a series of pictures like a flip-book. Best for products.+- [Smooth (Inertia) Scroll](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/smooth-scroll/): Scrolling glides to a stop instead of jumping. Best for portfolio sites.+- [Text Fill on Scroll](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/text-fill-on-scroll/): Words light up one by one as you scroll. Best for key statements.+- [Scroll Velocity Skew](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-velocity-skew/): Rows lean when you scroll fast and straighten when you stop. Best for galleries.+- [SVG Line Draw on Scroll](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/svg-line-draw/): A line draws itself along a route as you scroll. Best for timelines.+- [Scrollspy Navigation](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scrollspy-nav/): A menu highlights the section you are reading. Best for long docs.+- [Scroll-Driven Background Color](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-background-color/): The background color changes as you scroll through sections. Best for stories.+- [Hide-on-Scroll Header](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/hide-on-scroll-header/): Scrolling down hides the top bar; scrolling up shows it. Best for mobile pages.++## Entrance & Exit++- [Fade In / Fade Out](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/fade-in-out/): Fades in to appear and fades out to leave. Best for pop-ups and tooltips.+- [Slide In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/slide-in/): Travels into place from one edge. Best for side panels and notifications.+- [Slide Up Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/slide-up-reveal/): Text rises into view from behind an invisible edge. Best for headlines.+- [Scale In / Zoom In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/scale-in/): Grows from smaller to full size. Best for pop-ups and menus.+- [Clip-Path Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/clip-path-reveal/): A growing shape uncovers it while it stays still. Best for images and banners.+- [Curtain Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/curtain-reveal/): A colored panel covers it, then slides away. Best for intros and logos.+- [Split Text Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/split-text-reveal/): Text breaks into pieces that appear one after another. Best for headlines.+- [Letter-by-Letter Stagger](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/letter-by-letter-stagger/): A phrase appears letter by letter or typewriter-style. Best for short headlines.+- [Word-by-Word Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/word-by-word-reveal/): Words appear one after another at a reading pace. Best for quotes and intros.+- [Blur In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/blur-in/): Comes into focus from a blur, like a camera. Best for featured cards and photos.+- [Flip In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/flip-in/): Swings into view in 3D, like a card turning over. Best for cards and tiles.+- [Bounce In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/bounce-in/): Lands with a springy bounce. Best for badges and success messages.+- [Rotate In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/rotate-in/): Spins into place while it grows. Best for icons, stars and badges.+- [Shatter Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/shatter-effect/): Breaks into pieces that fly apart and fade. Best for galleries and bold exits.++## Page Transitions++- [View Transitions API](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/view-transitions-api/): The browser animates the change between two pages for you. Best for web apps.+- [Shared Element Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/shared-element-transition/): A picture grows from the list into the next page's header. Best for galleries.+- [Morph Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/morph-transition/): The logo changes shape to match each page you visit. Best for brand marks.+- [Crossfade Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/crossfade/): The old page fades out as the new one fades in. Best for calm page changes.+- [Slide Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/slide-transition/): Pages slide across, and going back slides the other way. Best for step flows.+- [Zoom Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/zoom-transition/): The pages zoom as they swap, as if moving in depth. Best for opening details.+- [Flash / Light Leak Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/flash-transition/): A burst of light hides the moment the page changes. Best for bold, lively sites.+- [Blur Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/blur-transition/): The old page blurs away and the new one comes into focus. Best for photo sites.+- [Elastic Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/elastic-transition/): The new page slides in, goes too far and springs back. Best for playful apps.+- [Portal / Tunnel Zoom](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/portal-zoom/): The next page opens out of a circle you click. Best for big reveals.+- [Dissolve Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/dissolve/): The page breaks into tiles that give way to the next. Best for photo galleries.+- [FLIP Technique](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/flip-technique/): Cards glide to their new places when the layout changes. Best for sorting lists.+- [Circle Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/circle-reveal/): Pages grow from any spot you click and shrink back into it. Best for app navigation.+- [Overlay Wipe](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/overlay-wipe/): A colored panel sweeps over the page as it changes. Best for portfolio sites.+- [Page Curl](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/page-curl/): The page peels back from its corner like paper. Best for digital magazines.+- [Cube Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/cube-transition/): The pages sit on a cube that turns to show the next. Best for photo stories.++## Micro-Interactions++- [Hover State Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/hover-state/): Six ways a card can react when you point at it. Best for buttons and cards.+- [Click / Tap Ripple](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/click-ripple/): A ripple spreads out from the spot you press. Best for buttons and list items.+- [Focus Ring Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/focus-ring/): A ring closes in around the item the Tab key reaches. Best for forms and menus.+- [Button Press Scale](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/button-press-scale/): Shrinks as you press it and springs back as you let go. Best for main buttons.+- [Magnetic Button](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/magnetic-button/): Leans toward the pointer, then springs home. Best for one main button.+- [Toggle / Switch Slide](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/toggle-switch/): The knob slides across as the switch turns on or off. Best for settings.+- [Heart / Like Burst](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/heart-burst/): The heart pops and fills as small hearts burst out. Best for like buttons.+- [Success Confetti](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/success-confetti/): Confetti bursts from the button when a task is done. Best for big moments.+- [Skeleton Loader](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/skeleton-loader/): Gray shapes hold the place of content while it loads. Best for feeds and cards.+- [Shimmer Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/shimmer-effect/): A band of light sweeps over gray placeholders. Best for loading screens.+- [Loading Spinner](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/loading-spinner/): Six small shapes loop to show that something is loading. Best for short waits.+- [Progress Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/progress-animation/): A bar, a ring and steps fill up to show progress. Best for uploads.+- [Checkmark Draw](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/checkmark-draw/): A tick draws itself in a circle once a task succeeds. Best for forms.+- [Form Field Morph](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/form-field-morph/): The label moves up out of the way as you type. Best for sign-up forms.+- [Notification Badge Pulse](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/badge-pulse/): A badge on an icon pulses to catch the eye. Best for unread messages.+- [Tooltip Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/tooltip-reveal/): A small label fades in after a short pause. Best for icon buttons.+- [Drawer / Panel Slide](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/drawer-slide/): A side panel slides in over a dimmed page. Best for mobile menus.+- [Modal Expand](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/modal-expand/): A window grows out of the button you pressed. Best for detail views.+- [Accordion Open/Close](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/accordion/): Each question opens smoothly to show its answer. Best for FAQ pages.+- [Cursor Follower](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/cursor-follower/): A dot trails your pointer and flips the colors under it. Best for portfolios.+- [Error Shake](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/error-shake/): A field shakes side to side when the input is wrong. Best for sign-in forms.+- [Swipe to Dismiss](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/swipe-to-dismiss/): A card dragged sideways flies off and the list closes up. Best for inboxes.+- [Hamburger Menu Toggle](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/hamburger-menu-toggle/): Three lines turn into an X as the menu opens. Best for mobile menus.+- [Theme Toggle Morph](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/theme-toggle-morph/): A sun turns into a moon as the colors switch to dark. Best for theme buttons.+- [Copy to Clipboard](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/copy-to-clipboard/): Copy turns into a tick and Copied, then changes back. Best for codes and links.+- [Star Rating](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/star-rating/): Stars fill up to your pointer and pop when you choose. Best for reviews.+- [Toast Notification](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/toast-notification/): Short messages slide into a corner, then leave on their own. Best for updates.+- [Segmented Control](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/segmented-control/): A highlight slides to the option you pick. Best for switching views.+- [Pull to Refresh](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/pull-to-refresh/): Pulling a list down shows a spinner, then new items. Best for feeds.+- [Animated Gradient Border](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/gradient-border/): A band of colors runs around the edge of a card or button. Best for featured offers.+- [Spotlight Hover Glow](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/spotlight-hover/): A soft glow follows the pointer and lights card edges. Best for feature grids.+- [Add-to-Cart Fly](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/add-to-cart-fly/): The product flies into the cart, which bumps and counts up. Best for shops.+- [Drag to Reorder](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/drag-to-reorder/): Drag an item and the others slide aside to make room. Best for to-do lists.+- [Rolling Numbers](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/rolling-numbers/): Each digit rolls to its new value, like a mileage counter. Best for prices.+- [Typing Indicator](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/typing-indicator/): Three dots in a chat bubble move in turn while someone types. Best for chat apps.+- [Hold to Confirm](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/hold-to-confirm/): A button fills up while you hold it and acts only once it is full. Best for delete buttons.+- [Expanding Search](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/expanding-search/): A search icon opens into a field, then closes when done. Best for toolbars.+- [Button Loading States](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/button-loading-states/): The button becomes a spinner, then a tick or a cross. Best for Save buttons.+- [Image Trail](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/image-trail/): Pictures pop up in a trail behind your pointer, then fade. Best for portfolios.+- [Gooey Menu](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/gooey-menu/): Small buttons ooze out of a round button like liquid. Best for quick actions.+- [Dynamic Island](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/dynamic-island/): A black pill grows into a notification, then shrinks back. Best for live updates.++## Text & Typography++- [Kinetic Typography](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/kinetic-typography/): Words arrive and leave one by one, each moving its own way. Best for intros.+- [Typewriter Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/typewriter-effect/): Text types itself out behind a blinking cursor. Best for short taglines.+- [Scramble / Glitch Text](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/scramble-text/): Random symbols lock into the real text, left to right. Best for tech headlines.+- [Variable Font Morph](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/variable-font-morph/): A word smoothly turns bold, then light, and leans over. Best for headlines.+- [Text Clip-Path Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-clip-path-reveal/): Each line of a headline is uncovered in turn. Best for big headlines.+- [Marquee / Ticker](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/marquee-ticker/): Text scrolls sideways in an endless loop, with no seam. Best for news tickers.+- [Text Morphing](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-morphing/): One word changes into the next, letter by letter. Best for short labels.+- [Text Gradient Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-gradient-animation/): Colors flow through the letters while the text stays still. Best for headlines.+- [Outline to Fill](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/outline-to-fill/): Hollow letters fill with color, as a wipe or a fade. Best for big headlines.+- [Enter/Exit Typography](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/enter-exit-typography/): Each phrase comes in, stays long enough to read, then leaves. Best for slogans.+- [Rotate Word Carousel](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/rotate-word-carousel/): One word in a sentence keeps swapping for the next. Best for hero headlines.+- [Glitch Text](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/glitch-text/): Text tears into red and cyan strips like a broken signal. Best for bold titles.+- [Text on a Path](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-on-path/): Text travels along a wave, an arc or a circle. Best for badges and seals.+- [Wavy Text](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/wavy-text/): A wave rolls through the word, letter by letter. Best for playful titles.+- [Highlighter Sweep](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/highlighter-sweep/): A marker sweeps in behind the key words, one after another. Best for key points.+- [Split-Flap Board](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/split-flap-board/): Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.+- [Neon Flicker](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/neon-flicker/): Glowing letters sputter now and then, like a worn neon sign. Best for night themes.+- [Handwriting Draw](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/handwriting-draw/): A word writes itself stroke by stroke, as if by a pen. Best for greetings and signatures.+- [Text Particles](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-particles/): A word of dots scatters from your pointer and springs back. Best for intros.++## 3D & Advanced++- [3D Model Orbit](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/3d-model-orbit/): A lit 3D shape spins, or turns to face your pointer. Best for product views.+- [Scroll-Driven 3D Rotation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/scroll-driven-3d-rotation/): Scrolling turns a 3D cube from pose to pose. Best for product tours.+- [Parallax 3D Tilt](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/parallax-3d-tilt/): A card tilts toward your pointer, and a light slides over it. Best for cards.+- [Canvas Particle Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/canvas-particle-effect/): Dots drift, link up when close, and dodge your pointer. Best for tech sites.+- [Fluid Simulation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/fluid-simulation/): Blobs drift and melt into each other like liquid. Best for hero backgrounds.+- [Glassmorphism Animated](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/glassmorphism-animated/): Frosted glass cards blur the colors behind them. Best for cards and panels.+- [WebGL Shader Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/webgl-shader-animation/): Moving color patterns computed for every pixel. Best for bold backgrounds.+- [Noise-Based Motion](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/noise-based-motion/): Smooth noise makes dots sway and a blob ripple. Best for calm backgrounds.+- [SVG Path Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/svg-path-animation/): A line drawing draws itself, stroke by stroke. Best for icons and logos.+- [Chromatic Aberration](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/chromatic-aberration/): A word splits into red, green and blue fringes. Best for bold titles.+- [2.5D / Pseudo-3D](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/2-5d-pseudo-3d/): Flat layers slide by different amounts, faking depth. Best for hero scenes.+- [Ray Marching / SDF](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/ray-marching-sdf/): A 3D scene drawn only from formulas, circled by a camera. Best for art pages.+- [GPGPU Particle System](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/gpgpu-particle-system/): Tens of thousands of particles flow on the graphics chip. Best for hero effects.+- [Image Distortion on Hover](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/image-distortion-hover/): The picture ripples and bends around your pointer. Best for portfolio images.+- [Cloth Simulation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/cloth-simulation/): A cloth sways in the wind, and you can drag it around. Best for playful pages.+- [Volumetric Smoke](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/volumetric-smoke/): Soft smoke curls upward, drawn as a real 3D cloud. Best for moody backgrounds.+- [Morphing Blob](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/morphing-blob/): Blobs melt together, and one drop chases your pointer. Best for hero sections.+- [3D Flip Card](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/flip-card-3d/): A card turns over in 3D to show its back. Best for profile and product cards.+- [3D Carousel](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/carousel-3d/): Cards stand in a ring that spins in 3D as you drag it. Best for image galleries.+- [Depth-Map Photo](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/depth-map-photo/): A flat photo turns 3D as you point: near parts shift more. Best for hero images.+- [Flocking](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/flocking/): Birds swirl and turn together as one flock. Best for calm backgrounds.+- [ASCII / Halftone](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/ascii-halftone/): A moving picture is redrawn with letters or dots. Best for retro and tech looks.+- [2D Physics](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/physics-2d/): Balls drop where you click, bounce and pile up. Best for playful intros.+- [Liquid Glass](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/liquid-glass/): Drag a glass panel and the picture behind it bends at the edges. Best for cards.+- [Holographic Card](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/holographic-card/): A card tilts as you point, and its rainbow foil shimmers. Best for collectibles.+- [Infinite Zoom](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/infinite-zoom/): The view keeps zooming into pictures inside pictures. Best for page intros.++## Ambient & Background++- [Animated Gradient Background](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/animated-gradient-background/): Colors slowly drift across a soft gradient background. Best for hero sections.+- [Mesh Gradient Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/mesh-gradient/): Blurred blobs of color drift and melt together. Best for landing pages.+- [Aurora / Northern Lights](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/aurora/): Blurred bands of light sway like the northern lights. Best for dark backgrounds.+- [Grain / Film Noise Overlay](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/grain-overlay/): Fine grain flickers over the page, like old film. Best for editorial sites.+- [Scanline Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/scanline/): Dark lines and a sweeping beam imitate an old TV screen. Best for retro sites.+- [Light Leak](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/light-leak/): Warm light washes in from a corner at random times. Best for photo sites.+- [Starfield / Space Particles](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/starfield/): Stars stream toward you out of the dark. Best for space themes.+- [Breathing / Pulsing Glow](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/breathing-glow/): A soft glow slowly grows and shrinks, like calm breathing. Best for idle states.+- [Ambient Ripple Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ambient-ripple/): Rings spread from a few spots, like drops on a still pond. Best for hero areas.+- [Floating Elements](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/floating-elements/): Small shapes drift slowly, each on its own path. Best for hero backgrounds.+- [Grid / Dot Pattern Parallax](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/grid-dot-pattern-parallax/): A dot grid shifts gently against your pointer for depth. Best for tech sites.+- [Abstract Geometric Motion](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/abstract-geometric-motion/): Shapes turn, spread and flow in a calm, endless pattern. Best for music players.+- [Particle Constellation](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/particle-constellation/): Drifting dots link up with lines whenever they come close. Best for tech sites.+- [Flow Field](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/flow-field/): Particles ride invisible currents, leaving fading trails. Best for art pages.+- [Synthwave Grid](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/synthwave-grid/): A glowing grid rolls toward you under a striped sun. Best for music and games.+- [Matrix Rain](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/matrix-rain/): Columns of glowing characters rain down a dark screen. Best for tech themes.+- [Plasma Field](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/plasma/): Smooth waves of color flow endlessly, made from math. Best for creative sites.+- [Wave Layers](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/wave-layers/): Layers of waves drift sideways, each at its own speed. Best for hero sections.+- [Snow / Rain](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/snow-rain/): Snow drifts down, or rain falls in streaks, over a dark town. Best for seasonal pages.+- [Fireworks](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fireworks/): Rockets rise and burst into glowing sparks that fall and fade. Best for celebrations.+- [Topographic Lines](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/topographic-lines/): Lines like those on a hiking map slowly bend and drift. Best for outdoor brands.+- [Light Rays](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/light-rays/): Soft beams of light fall from above and slowly sweep across. Best for hero intros.+- [Game of Life](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/game-of-life/): Cells live and die by their neighbors, and patterns grow. Best for tech sites.++## Optional++- [Source on GitHub](https://github.com/matinmonshizadeh/animation-handbook): every demo's code, each technique's README and the Agent Skilldiff --git a/skills/animation-handbook/SKILL.md b/skills/animation-handbook/SKILL.mdnew file mode 100644index 00000000..e038cf93--- /dev/null+++ b/skills/animation-handbook/SKILL.md@@ -0,0 +1,44 @@+---+name: animation-handbook+description: Builds web animations from Animation Handbook, a set of 166 tested techniques with plain-words build prompts and settings (scroll effects, entrances and exits, page transitions, micro-interactions for buttons and forms, text effects, 3D and WebGL, ambient backgrounds). Use when the user asks to add, pick or improve an animation, transition, hover or click effect, loading state, scroll effect or background motion in a web page or app, in any framework or plain HTML, CSS and JavaScript.+license: MIT+---++# Animation Handbook++[Animation Handbook](https://matinmonshizadeh.github.io/animation-handbook/) is a free reference of 166 web animation techniques. On the site, each one has a page where it plays live, a few plain settings for most of them (speed, direction, color and the like) and a prompt that says in plain words how to build it, with no code. This skill holds all of those prompts and settings, so you can build any of the techniques in the user's own project.++## How to use it++1. **Find the technique** in [references/catalog.md](references/catalog.md): one line per animation, with what it does, what it is best for and its places, the parts of a page it suits (Buttons, Text, Images & cards, Backgrounds, Menus & forms, Loading & messages, Page intros, Scrolling, Page changes). Match both what the user describes and where it goes. When two fit equally well, build one and mention the other.+2. **Read its entry** in the category file the catalog line names: the prompt, the settings with their defaults, how it runs, what it is good for and what to avoid it on. If the user's place is on its Avoid on list, say so and suggest a better fit from the catalog.+3. **Choose the settings** from the user's words: "a panel that slides in slowly from the left" picks the slow speed and the left side. Keep the default (in bold) for anything they did not mention, and ask only when a choice changes the result a lot and nothing they said points either way. The choices are named, not numbered, so turn each into values that fit its name and the project.+4. **Build it** in the user's own stack, from plain HTML, CSS and JavaScript to React, Vue, Svelte or whatever the project already uses. Follow the prompt as the specification, with the user's own element in place of each [part in square brackets]. "Match the settings listed below" means the settings from step 3; the line at the end of each entry shows how the site lists them.+5. **Check it** against the rules below, then tell the user which technique you built, with its live demo address, and which settings you chose.++## The rules every animation follows++The handbook's demos follow these rules and the prompts take them for granted, so keep them even where a prompt does not repeat them.++- **Animate transform and opacity only.** Move, scale, rotate and fade; never animate width, height, top, left or box-shadow, which make the browser lay out or repaint the page on every frame.+- **Move a JavaScript frame loop by elapsed time.** Each frame moves by the time since the last one, capped at about 50 ms, never by a fixed step per frame, so it runs at the same speed on a 30 Hz, 60 Hz or 120 Hz screen.+- **Follow reduced motion.** When the device asks for reduced motion, show the end state or a short fade instead of the movement, and start loops paused.+- **Give a hover or a drag a touch equivalent.** A hover effect also works with a tap, and a drag uses pointer events so that touch works too.+- **Make it work from the keyboard.** An effect that follows the pointer or shows on hover also shows on keyboard focus, and the arrow keys move what follows the pointer. An effect that starts on a press also starts on Enter or Space, from the middle of the control.+- **Keep controls at least 44×44 px on phones**, buttons and handles drawn inside the animation included.+- **Keep text at least 4.5:1 against its background.**+- **Give heavy effects a lighter phone version.** A big blur, many particles or a shader gets a lighter version on phones, which are up to 600 px wide, or up to 500 px tall when held sideways.+- **Add no library the project does not already use.** Every prompt works with plain code; use GSAP, Framer Motion, Three.js or the like only where the project has it.++## Where to look++- [references/catalog.md](references/catalog.md): all 166 in one list, grouped by category, with an index by place.+- [references/01-scroll-based.md](references/01-scroll-based.md): Scroll-Based, 27 animations. Animations driven by scroll position — parallax, sticky, scrub, snap, and storytelling.+- [references/02-entrance-and-exit.md](references/02-entrance-and-exit.md): Entrance & Exit, 14 animations. Element-level animations for arriving and departing — fades, slides, reveals, flips, and text staggers.+- [references/03-page-transitions.md](references/03-page-transitions.md): Page Transitions, 16 animations. Full-page transitions between routes or views — crossfades, slides, portals, morphs, and the View Transitions API.+- [references/04-micro-interactions.md](references/04-micro-interactions.md): Micro-Interactions, 41 animations. Short, user-triggered animations — hover, click, focus, loading states, and UI feedback patterns.+- [references/05-text-typography.md](references/05-text-typography.md): Text & Typography, 19 animations. Animations specifically for type — kinetic motion, character-level effects, gradient flows, and word transformations.+- [references/06-3d-advanced.md](references/06-3d-advanced.md): 3D & Advanced, 26 animations. WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects.+- [references/07-ambient-background.md](references/07-ambient-background.md): Ambient & Background, 23 animations. Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows.++The end of each live demo address (animations/02-entrance-and-exit/rotate-in/, for example) is also the technique's folder in the repository, https://github.com/matinmonshizadeh/animation-handbook: it holds the demo's own code and a README on how it works, the values that matter and production notes.diff --git a/skills/animation-handbook/references/01-scroll-based.md b/skills/animation-handbook/references/01-scroll-based.mdnew file mode 100644index 00000000..fca7dd2c--- /dev/null+++ b/skills/animation-handbook/references/01-scroll-based.md@@ -0,0 +1,594 @@+# 01 · Scroll-Based++Animations driven by scroll position — parallax, sticky, scrub, snap, and storytelling. 27 animations from Animation Handbook, in the home page's order. Each entry gives the live demo, how it runs, what it is good for and what to avoid it on, the prompt from its page word for word, and its settings.++## Contents++- [Parallax Depth-of-Field](#parallax-depth-of-field)+- [Parallax Scrolling](#parallax-scrolling)+- [Reverse-Scrolling Columns](#reverse-scrolling-columns)+- [Cover Card to Fixed Header](#cover-card-to-fixed-header)+- [Fly-in Fly-out Contact List](#fly-in-fly-out-contact-list)+- [Stacking Cards](#stacking-cards)+- [Scroll-Triggered Animation](#scroll-triggered-animation)+- [Scrub Animation](#scrub-animation)+- [Pin Animation](#pin-animation)+- [Snap Scrolling](#snap-scrolling)+- [Scrollytelling](#scrollytelling)+- [Reveal on Scroll](#reveal-on-scroll)+- [Stagger Reveal](#stagger-reveal)+- [Horizontal Scroll](#horizontal-scroll)+- [Sticky Section](#sticky-section)+- [Counter Animation](#counter-animation)+- [Progress Bar](#progress-bar)+- [Section Wipe](#section-wipe)+- [Zoom Into Image](#zoom-into-image)+- [Scroll Image Sequence](#scroll-image-sequence)+- [Smooth (Inertia) Scroll](#smooth-inertia-scroll)+- [Text Fill on Scroll](#text-fill-on-scroll)+- [Scroll Velocity Skew](#scroll-velocity-skew)+- [SVG Line Draw on Scroll](#svg-line-draw-on-scroll)+- [Scrollspy Navigation](#scrollspy-navigation)+- [Scroll-Driven Background Color](#scroll-driven-background-color)+- [Hide-on-Scroll Header](#hide-on-scroll-header)++## Parallax Depth-of-Field++Layers move at their own speed as the focus shifts. Best for cinematic intros.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/parallax-depth-of-field/+- How it runs: follows the scroll+- Good for: Hero scenes · Story intros · Illustrated landscapes+- Avoid on: Large photos · Text-heavy pages++**Prompt**++Add a parallax depth-of-field effect to [your layered scene or illustration]. Split the scene into layers from far to near and hold it in place while the visitor scrolls through a taller section. As they scroll, move each layer by an amount that grows with its nearness, and move a point of sharp focus from the farthest layer to the nearest: blur each layer by how far it sits from that focus. Ease the layers toward the scroll position on every frame by a share of the distance left, exponential in the time since the last frame, so a wheel's jumps turn into smooth movement at the same pace on every screen. If the visitor has reduced motion turned on, keep the layers still and only shift the focus.++**Settings**: none. The page has no settings, so the prompt is complete as it is.++## Parallax Scrolling++Far layers move slower than near ones as you scroll. Best for hero scenes.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/parallax-scrolling/+- How it runs: follows the scroll+- Good for: Hero scenes · Landing pages · Story sections+- Avoid on: Text-heavy pages · Forms++**Prompt**++Add a parallax scene to [your hero section or illustration]. Split the scene into layers from far to near, such as sky, hills, trees and ground, and hold it in place while the visitor scrolls through a taller section. As they scroll, move each layer by its own amount, as the settings choose; usually the farthest layer barely moves and the nearest moves most, which makes the flat picture feel deep. Base the movement on how far through the section the visitor has scrolled, so it starts and stops at the same place every time. If the visitor has reduced motion turned on, keep every layer still. Match the settings listed below.++**Settings** (the defaults in bold):++- Depth: Flat · Shallow · **Normal** · Deep++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Depth: Normal.++## Reverse-Scrolling Columns++Side columns run the opposite way to the middle one. Best for portfolios.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/reverse-scrolling-columns/+- How it runs: follows the scroll+- Good for: Portfolios · Agency sites · Image galleries+- Avoid on: Reading pages · Forms++**Prompt**++Add reverse-scrolling columns to [your grid of project cards or images]. Lay the cards out in three columns and hold them in view while the visitor scrolls through a taller section. Move the middle column up with the scroll, and move the two side columns in the direction and at the speed given in the settings; running them the opposite way makes them seem to flow against the scroll. Put two copies of the cards in each column and wrap the movement by exactly one copy's height, so the columns never run out. If the visitor has reduced motion turned on, keep the columns still. Match the settings listed below.++**Settings** (the defaults in bold):++- Side columns go: **Opposite way** · Same way+- Side column speed: Slower · **Same** · Faster++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Side columns go: Opposite way, Side column speed: Same.++## Cover Card to Fixed Header++A tall cover shrinks into a slim header as you scroll. Best for articles.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/cover-card-to-fixed-header/+- How it runs: follows the scroll+- Good for: Articles · Blog posts · Product pages+- Avoid on: Short pages · App screens++**Prompt**++Add a collapsing cover to [your article or page header]. Start with a tall cover pinned to the top that holds the title, a subtitle, the date and the author. As the visitor scrolls, shrink it into a slim header: the title scales down into the corner, the subtitle and date fade out first, and a small author badge fades in near the end. Unless the settings make it snap, tie every change to one number that runs from 0 to 1 with the scroll, so every moment in between looks planned and scrolling back reverses it. Turn off scroll anchoring on the scrolling area. If the visitor has reduced motion turned on, switch between the tall and slim cover halfway, without animating. Match the settings listed below.++**Settings** (the defaults in bold):++- Shrink distance: Short · **Medium** · Long+- Snaps at halfway: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Shrink distance: Medium, Snaps at halfway: off.++## Fly-in Fly-out Contact List++Rows fade and slide as they near the top or bottom edge. Best for long lists.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/fly-in-fly-out-contact-list/+- How it runs: follows the scroll+- Good for: Contact lists · Chat lists · Activity feeds · Search results+- Avoid on: Short lists · Tables++**Prompt**++Add a fly-in, fly-out effect to [your scrolling list, such as contacts or messages]. Treat a band at the top and a band at the bottom of the scrolling area as edge zones. As a row passes through the bottom band it arrives, and as it passes through the top band it leaves: the deeper it is in the band, the more it is faded, moved and shrunk, as the settings choose, and in the middle it shows in full. Work it out from the scroll position on every frame, so scrolling back brings rows back. If the visitor has reduced motion turned on, do not move or shrink rows; only fade them a little near the edges. Match the settings listed below.++**Settings** (the defaults in bold):++- Effect: **All three** · Move only · Fade only+- Edge zone size: Small · **Medium** · Large+- How far rows move: Short · **Medium** · Far+- How much rows shrink: A little · **Medium** · A lot+- Shows the zones: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Effect: All three, Edge zone size: Medium, How far rows move: Medium, How much rows shrink: Medium, Shows the zones: off.++## Stacking Cards++Cards stick at the top and pile into a deck. Best for step-by-step stories.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/stacking-cards/+- How it runs: follows the scroll+- Good for: Portfolios · Case studies · Onboarding steps · Feature tours+- Avoid on: Long text · Many cards++**Prompt**++Add stacking cards to [your set of project or step cards]. Make each card stick to the top of the scrolling area so the next card slides up over it, and push each later card down by the offset in the settings so a strip of the cards underneath stays visible, like a deck. As a card is covered, shrink it slightly from its top edge, so buried cards look farther away. Leave some room after the last card so the finished deck stays on screen. Use scroll-driven animations where the browser supports them, with a small script as the fallback. If the visitor has reduced motion turned on, let the cards stack without shrinking. Match the settings listed below.++**Settings** (the defaults in bold):++- Edge that shows: None · Small · **Medium** · Large+- How much cards shrink: A little · **Medium** · A lot+- Number of cards: 3 · **5** · 7++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Edge that shows: Medium, How much cards shrink: Medium, Number of cards: 5.++## Scroll-Triggered Animation++Animations start, follow and pin at set scroll points. Best for landing pages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-trigger/+- How it runs: follows the scroll+- Good for: Landing pages · Product pages · Feature sections+- Avoid on: Short pages · Forms++**Prompt**++Add scroll-triggered animations to [the sections of your page]. Split the page into zones and work out from the scroll position whether each zone is still ahead, on screen or already passed. Fade a zone's content in when the zone arrives and hide it again when it has gone. Tie another animation's progress to how far the visitor has scrolled through its zone, so it plays forward and back with the scroll. Pin one card in place while its text steps through a few stages, and light up a row of dots in steps. Leave some space after the last zone so it can finish. If the visitor has reduced motion turned on, show content without fading it.++**Settings**: none. The page has no settings, so the prompt is complete as it is.++## Scrub Animation++Scroll plays it forward and back, like dragging a video. Best for product tours.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scrub-animation/+- How it runs: follows the scroll+- Good for: Product tours · Explainers · Step-by-step diagrams+- Avoid on: Short sections · Key information++**Prompt**++Add a scroll-scrubbed animation to [your illustration or product explainer]. Hold the scene in view while the visitor scrolls through a taller section, and turn how far they have scrolled into a progress value from 0 to 1. Draw the whole route up front, place the moving object at the point on it that matches the progress, facing along the path, and fill in the part already traveled. Nothing plays on a timer: scrolling back simply moves it back. Shape the progress with the easing given in the settings. If the visitor has reduced motion turned on, drop decorative effects but keep the object following the scroll. Match the settings listed below.++**Settings** (the defaults in bold):++- Feel: **Even** · Gentle · Smooth · Slow start++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Feel: Even.++## Pin Animation++One part stays put while its text changes on scroll. Best for feature lists.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/pin-animation/+- How it runs: follows the scroll+- Good for: Feature lists · Product tours · Onboarding+- Avoid on: Short screens · Long text++**Prompt**++Add a pinned section to [your product page, and the element that should stay in view]. Make the section several screens tall and pin the element and its text in the middle of the view while the visitor scrolls through it; the extra height is how long it stays. Split that distance into equal parts and show the next feature's text and picture in each part. When the section ends, let the element scroll away with the page. Use the browser's sticky positioning for the pin instead of moving it with a script. If the visitor has reduced motion turned on, change the features without animation.++**Settings**: none. The page has no settings, so the prompt is complete as it is.++## Snap Scrolling++The box settles on one whole section at a time. Best for slides and galleries.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/snap-scrolling/+- How it runs: follows the scroll+- Good for: Slides · Galleries · Onboarding · Full-screen sections+- Avoid on: Long articles · Uneven sections++**Prompt**++Add snap scrolling to [your page of full-height sections, slides or gallery]. Make each section exactly as tall as the scrolling area and mark its top as a snap point, so that, as the settings choose, the view settles on the nearest section instead of stopping between two. Use the browser's built-in scroll snapping rather than a script. Add small dots that show which section is in view and take the visitor to a section when pressed. Check scrolling with the arrow keys too, because strict snapping can feel stiff there. If the visitor has reduced motion turned on, let the view settle without a smooth glide. Match the settings listed below.++**Settings** (the defaults in bold):++- Snapping: **Always** · When close · Off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Snapping: Always.++## Scrollytelling++A picture beside the story changes as you read down. Best for data stories.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scrollytelling/+- How it runs: follows the scroll+- Good for: Data stories · Explainers · Long reads+- Avoid on: Short pages · Quick reference++**Prompt**++Add a scrollytelling layout to [your story and the picture that goes with it]. Put the story in a column of chapters that scrolls, and keep the picture in view beside it. Work out which chapter has passed a reading line about 40% down the view and how far it is toward the next, as a fraction, and blend every value in the picture between the two chapters with it, such as colors and a counting number, so the picture changes smoothly as the visitor reads. On phones, pin a short strip of the picture above the text. If the visitor has reduced motion turned on, change the picture without fading.++**Settings**: none. The page has no settings, so the prompt is complete as it is.++## Reveal on Scroll++Cards appear as they cross a line in the box. Best for long landing pages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/reveal-on-scroll/+- How it runs: follows the scroll+- Good for: Landing pages · Feature lists · Blog sections+- Avoid on: Key information · Forms++**Prompt**++Add reveal-on-scroll animations to [the sections or cards on your page]. Keep each element in a hidden starting state, such as faded, shifted, shrunk, blurred or clipped, until it rises past a trigger line inside the view, then let it settle into its normal state. Watch the elements with the browser's intersection observer rather than on every scroll, and count an element that is already above the line as crossed, so a fast scroll never skips one. Reveal each element once, or every time it crosses, as the settings say. If the visitor has reduced motion turned on, show each element without movement. Match the settings listed below.++**Settings** (the defaults in bold):++- Trigger line: Higher · **Normal** · Lower+- Plays every time: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Trigger line: Normal, Plays every time: off.++## Stagger Reveal++Items in a group appear one after another as it scrolls in. Best for card grids.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/stagger-reveal/+- How it runs: follows the scroll+- Good for: Card grids · Search results · Menus · Galleries+- Avoid on: Long lists · Key information++**Prompt**++Add a stagger reveal to [your grid, list or group of items]. When the group scrolls into view, reveal its items one after another instead of all at once: each item fades in and rises a little, starting a short delay after the one before, in the order the settings choose. Make each item's own animation longer than the delay between items, so they overlap into one sweep, and keep the whole cascade under about 600ms on long lists. If the visitor has reduced motion turned on, show the items without movement. Match the settings listed below.++**Settings** (the defaults in bold):++- Delay between items: Short · **Medium** · Long+- Order: **First to last** · Last to first · From the middle · Random++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Delay between items: Medium, Order: First to last.++## Horizontal Scroll++Scroll down and a row of panels slides sideways. Best for portfolios.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/horizontal-scroll/+- How it runs: follows the scroll+- Good for: Portfolios · Timelines · Product features · Step-by-step tours+- Avoid on: Long text · Forms++**Prompt**++Add a horizontal scroll section to [the panels or projects you want to show]. Place the panels side by side in one long strip inside a section that is several screens tall. As the visitor scrolls down through that section, pin its inner frame in place and slide the strip to the left in step with the scroll, so scrolling down moves the panels sideways; once the last panel is in view, release the frame and let the page scroll on. Give the strip an explicit width so it can move. Keep the visitor's own scrolling, touch included, so scrolling back up slides the panels back. If the visitor has reduced motion turned on, keep the strip tied exactly to their scrolling, with no easing or snapping added.++**Settings**: none. The page has no settings, so the prompt is complete as it is.++## Sticky Section++A section holds still while its content changes. Best for feature tours.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/sticky-section/+- How it runs: follows the scroll+- Good for: Feature tours · How-it-works steps · Product pages+- Avoid on: Long text · Short pages++**Prompt**++Add a sticky section to [the steps or features you want to walk through]. Make the section several screens tall and pin its inner frame to the top of the screen while the visitor scrolls through it. Split that scroll distance into equal parts, one per step, and as each part is reached, fade the text and the picture over to the next step while the frame itself stays still. After the last step, let the section scroll away so the page carries on. Work out the step from the scroll position, so scrolling back up steps backwards. If the visitor has reduced motion turned on, switch the steps without fading.++**Settings**: none. The page has no settings, so the prompt is complete as it is.++## Counter Animation++Numbers count up when they scroll into view. Best for stats.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/counter-animation/+- How it runs: follows the scroll+- Good for: Stats · Annual reports · Landing pages · Dashboards+- Avoid on: Prices · Data tables++**Prompt**++Add a count-up animation to [the numbers in your stats section]. When the numbers scroll far enough into view, count each one up from zero to its total, and format it on every step so commas, currency signs and units show the whole way through, not just at the end. Count again if the numbers leave the view and come back. When the settings include it, start each number a moment after the one before for a cascade. Screen readers should hear each final number once, never the steps in between. If the visitor has reduced motion turned on, show the final numbers straight away. Match the settings listed below.++**Settings** (the defaults in bold):++- Starts counting: Early · **Middle** · Late+- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Slow finish · Springy · Even+- One after another: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Starts counting: Middle, Speed: Normal, Feel: Smooth, One after another: on.++## Progress Bar++A bar fills as you read down the page. Best for long articles.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/progress-bar/+- How it runs: follows the scroll+- Good for: Long articles · Documentation · Tutorials · Reports+- Avoid on: Short pages++**Prompt**++Add a reading progress indicator to [your article or long page]. Work out how far the reader has scrolled as a share of the total distance they can scroll, and show it as a bar that fills along the top, a ring that fills in a corner, or a thin rail down the side, so it is full exactly when the last line is in view. Keep the indicator outside the scrolling content so it stays in place, and grow it with a transform rather than by changing its width, so scrolling stays smooth. Hide the indicator from screen readers; it only repeats what scrolling shows. It follows the reader's own scrolling, so reduced motion needs no change. Match the settings listed below.++**Settings** (the defaults in bold):++- Indicator: **Top bar** · Ring · Side rail+- Thickness: Thin · **Medium** · Thick+- Color: **Blue** · Green · Orange · Purple++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Indicator: Top bar, Thickness: Medium, Color: Blue.++## Section Wipe++Each section slides up over the one before. Best for full-screen stories.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/section-wipe/+- How it runs: follows the scroll+- Good for: Full-screen stories · Landing pages · Case studies+- Avoid on: Long text · Documentation++**Prompt**++Add a section wipe to [the full-screen sections of your page]. Make each section exactly one screen tall, stick each one to the top as the visitor scrolls, and stack them so every section sits above the one before; the next section then slides up and covers the current one instead of pushing it away. While a section is being covered, shrink its content in step with the scroll so it seems to sink behind the one arriving, unless the settings turn the shrink off. Nothing ever covers the last section. If the visitor has reduced motion turned on, keep the wipe but skip the shrink. Match the settings listed below.++**Settings** (the defaults in bold):++- Shrink: None · **A little** · A lot+- Shrink speed: Quick · Medium · **Gradual**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Shrink: A little, Shrink speed: Gradual.++## Zoom Into Image++A small window opens up to fill the box as you scroll. Best for hero images.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/zoom-into-image/+- How it runs: follows the scroll+- Good for: Hero images · Gallery intros · Section breaks+- Avoid on: Small images · Text-heavy pages++**Prompt**++Add a zoom-into-image effect to [your featured picture]. Pin the picture in place while the visitor scrolls through a section a couple of screens tall, and show only a small window of it at first. As they scroll, open that window outward in step with the scroll until the picture fills the whole frame, then fade in a caption. Uncover the picture by clipping it rather than scaling it up, so it stays sharp, and let scrolling back up close the window again. If the visitor has reduced motion turned on, show the full picture and the caption from the start. Match the settings listed below.++**Settings** (the defaults in bold):++- Starting window: Small · **Medium** · Large+- Corners: Square · **Rounded** · Very rounded+- Shows the starting frame: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Starting window: Medium, Corners: Rounded, Shows the starting frame: on.++## Scroll Image Sequence++Scrolling plays a series of pictures like a flip-book. Best for products.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-image-sequence/+- How it runs: follows the scroll+- Good for: Product reveals · 3D objects · Launch pages+- Avoid on: Slow connections · Text content++**Prompt**++Add a scroll-driven image sequence to [your product or object animation]. Export the animation as a numbered series of pictures and load them all before the section comes into view. Pin a canvas in place while the visitor scrolls through a section a few screens tall, turn their scroll position into a frame number, and draw that frame whenever it changes, so scrolling plays the sequence like a flip-book and scrolling back plays it in reverse. When the settings include it, let the picture ease toward the frame the scroll points at instead of jumping. Give the canvas a text description for screen readers. If the visitor has reduced motion turned on, jump straight to each frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Number of frames: Few · **Normal** · Many+- Glides between frames: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Number of frames: Normal, Glides between frames: on.++## Smooth (Inertia) Scroll++Scrolling glides to a stop instead of jumping. Best for portfolio sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/smooth-scroll/+- How it runs: reacts to the visitor+- Good for: Portfolio sites · Brand pages · Scroll stories+- Avoid on: Documentation · Forms · Dashboards++**Prompt**++Add smooth scrolling to [the scrolling area or page you want to glide]. Catch the visitor's wheel, swipe and drag and turn each one into a target position, then on every frame move the content part of the remaining distance toward that target, so it glides and slows to a stop instead of jumping. Make that part exponential in the time since the last frame (one minus a fixed fraction to the power of that time), so the pace is the same on every screen. Move the content with a transform and keep a custom scrollbar in step with it. Keep keyboard scrolling, links to headings and find-in-page working. If the visitor has reduced motion turned on, use the browser's normal scrolling with no glide. Match the settings listed below.++**Settings** (the defaults in bold):++- Glide: Long · **Medium** · Short++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Glide: Medium.++## Text Fill on Scroll++Words light up one by one as you scroll. Best for key statements.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/text-fill-on-scroll/+- How it runs: follows the scroll+- Good for: Key statements · Manifestos · Landing page intros+- Avoid on: Body text · Long articles++**Prompt**++Add a scroll-driven text fill to [the statement or paragraph you want read]. Pin the paragraph in place while the visitor scrolls through a section a few screens tall. Split it into words, show every word in a dim but readable gray, and light the words up one by one in step with the scroll, so how far the reader has scrolled decides how much is lit and scrolling back up un-lights them. When the settings include it, show the next word to fill in a highlight color, like a reading cursor. Keep it real text for screen readers. If the visitor has reduced motion turned on, change each word's color without fading. Match the settings listed below.++**Settings** (the defaults in bold):++- Highlights the current word: **on** · off+- Fill finishes: Early · **Normal** · At the end+- Highlight color: **Blue** · Green · Orange++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Highlights the current word: on, Fill finishes: Normal, Highlight color: Blue.++## Scroll Velocity Skew++Rows lean when you scroll fast and straighten when you stop. Best for galleries.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-velocity-skew/+- How it runs: follows the scroll+- Good for: Galleries · Portfolios · Project lists+- Avoid on: Reading content · Forms++**Prompt**++Add a velocity skew to [the rows or cards in your list or gallery]. Measure how far the list scrolls on each frame, smooth that speed so it rises and falls gradually, and lean every row by an angle in proportion to it, up to a limit. Fast scrolling leans the rows; when the scrolling stops, the speed falls to zero and they spring back straight. Lean each row on its own rather than the whole list, and stop the frame loop once everything is still. This effect can make some people feel unwell, so if the visitor has reduced motion turned on, keep the rows straight and scroll normally. Match the settings listed below.++**Settings** (the defaults in bold):++- Strength: Subtle · **Normal** · Strong+- Lean: **Tilt** · Slant+- Spring back: Slow · **Normal** · Quick+- Most it leans: Small · **Medium** · Large++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Strength: Normal, Lean: Tilt, Spring back: Normal, Most it leans: Medium.++## SVG Line Draw on Scroll++A line draws itself along a route as you scroll. Best for timelines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/svg-line-draw/+- How it runs: follows the scroll+- Good for: Timelines · Journey maps · Process steps · Delivery tracking+- Avoid on: Short pages++**Prompt**++Add a scroll-drawn route to [your timeline, journey or process steps]. Draw a long winding path down the page with a faint dashed copy underneath, and reveal the solid line in step with the scroll so its tip travels down with the visitor. Measure the path's length once and reveal it by sliding a single dash that is exactly as long as the path. When the settings include them, place labeled stops along the path and pop each one in as the line reaches it; scrolling back up erases the line and hides them again. If the visitor has reduced motion turned on, show each stop without the pop. Match the settings listed below.++**Settings** (the defaults in bold):++- Feel: **Even** · Smooth+- Shows the stops: **on** · off+- Line finishes: Early · Near the end · **At the end**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Feel: Even, Shows the stops: on, Line finishes: At the end.++## Scrollspy Navigation++A menu highlights the section you are reading. Best for long docs.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scrollspy-nav/+- How it runs: follows the scroll+- Good for: Documentation · Long articles · Settings pages+- Avoid on: Short pages++**Prompt**++Add a scrollspy menu to [your documentation or long page and its section headings]. Keep a menu of section links in place beside the content and highlight the link for the section being read, with a marker that slides to it: a section becomes current once its heading scrolls up past a chosen line, and the last link lights up at the very bottom. Clicking or tapping a link scrolls to its section and lights that link at once, without flickering through the links in between. On phones, turn the menu into a strip across the top. If the visitor has reduced motion turned on, jump to sections instead of gliding. Match the settings listed below.++**Settings** (the defaults in bold):++- Link changes at: Near the top · **A third down** · Halfway+- Glides to the section: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Link changes at: A third down, Glides to the section: on.++## Scroll-Driven Background Color++The background color changes as you scroll through sections. Best for stories.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-background-color/+- How it runs: follows the scroll+- Good for: Stories · Portfolios · Case studies+- Avoid on: Text-heavy pages · Forms++**Prompt**++Add a scroll-driven background color to [the sections of your page]. Give each section a color, and as the visitor scrolls, change the page background from one section's color to the next in step with their position, blending between them unless the settings ask for a hard cut, so the color follows the scroll both ways. Blend in a perceptual color space so the colors in between stay clean. Check the text against the background at every point, and switch the text to dark when the background turns light. A change of color is not movement, so keep it when the visitor has reduced motion turned on. Match the settings listed below.++**Settings** (the defaults in bold):++- Colors: **Dusk** · Daylight · Forest+- Blend: **Gradual** · Quick · Hard cut++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Colors: Dusk, Blend: Gradual.++## Hide-on-Scroll Header++Scrolling down hides the top bar; scrolling up shows it. Best for mobile pages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/hide-on-scroll-header/+- How it runs: reacts to the visitor+- Good for: Mobile pages · News and blogs · Long articles · Online shops+- Avoid on: Short pages · Bars with key buttons++**Prompt**++Add a hide-on-scroll header to [the top bar of your site]. When the visitor scrolls down, slide the bar up out of view, or shrink it to a slim strip if the settings ask for that; when they scroll back up, bring it back as the settings say. Tell the direction by comparing each scroll position with the last one, ignore moves of a few pixels so the bar never flickers, and always show it near the top of the page. Let the bar float over the content, move it only with a transform and read the scroll once per frame. Touch scrolling counts too. If the visitor has reduced motion turned on, fade the bar out and in instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Comes back: **On any scroll up** · Only near the top+- Shrinks instead of hiding: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Comes back: On any scroll up, Shrinks instead of hiding: off.diff --git a/skills/animation-handbook/references/02-entrance-and-exit.md b/skills/animation-handbook/references/02-entrance-and-exit.mdnew file mode 100644index 00000000..ba52d198--- /dev/null+++ b/skills/animation-handbook/references/02-entrance-and-exit.md@@ -0,0 +1,370 @@+# 02 · Entrance & Exit++Element-level animations for arriving and departing — fades, slides, reveals, flips, and text staggers. 14 animations from Animation Handbook, in the home page's order. Each entry gives the live demo, how it runs, what it is good for and what to avoid it on, the prompt from its page word for word, and its settings.++## Contents++- [Fade In / Fade Out](#fade-in--fade-out)+- [Slide In](#slide-in)+- [Slide Up Reveal](#slide-up-reveal)+- [Scale In / Zoom In](#scale-in--zoom-in)+- [Clip-Path Reveal](#clip-path-reveal)+- [Curtain Reveal](#curtain-reveal)+- [Split Text Reveal](#split-text-reveal)+- [Letter-by-Letter Stagger](#letter-by-letter-stagger)+- [Word-by-Word Reveal](#word-by-word-reveal)+- [Blur In](#blur-in)+- [Flip In](#flip-in)+- [Bounce In](#bounce-in)+- [Rotate In](#rotate-in)+- [Shatter Effect](#shatter-effect)++## Fade In / Fade Out++Fades in to appear and fades out to leave. Best for pop-ups and tooltips.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/fade-in-out/+- How it runs: plays once+- Good for: Pop-ups · Tooltips · Loaded content · Image swaps+- Avoid on: Side panels · Urgent alerts++**Prompt**++Add a fade-in and fade-out to [the element you want to show and hide]. When it appears, it should go smoothly from fully transparent to fully visible, and when it leaves it should do the reverse. Nothing moves or changes size; only the opacity changes, which keeps the animation smooth because the browser doesn't need to repaint. Reserve the element's space while it is invisible so the layout doesn't jump, and make sure a hidden element can't be clicked or focused. If the visitor has reduced motion turned on, show and hide it instantly or with a very short fade. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Gentle · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Feel: Smooth.++## Slide In++Travels into place from one edge. Best for side panels and notifications.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/slide-in/+- How it runs: plays once+- Good for: Side panels · Notifications · Menus · List items+- Avoid on: Crowded layouts · Long text++**Prompt**++Add a slide-in entrance to [the element you want to animate]. It should start away from its final position, on the side and at the distance given in the settings, and travel into place so it feels like it came from somewhere; slowing down as it arrives makes the landing feel natural. Unless the settings turn it off, fade it in during the slide too, because a slide on its own tends to look mechanical. Give longer distances a little more time so the speed still feels natural. Move it without changing the layout, so nothing around it shifts. If the visitor has reduced motion turned on, skip the travel and simply show it. Match the settings listed below.++**Settings** (the defaults in bold):++- Comes in from: **Top** · Bottom · Left · Right+- How far it travels: Short · **Medium** · Far+- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Springy · Gentle · Even+- Fades in: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Comes in from: Top, How far it travels: Medium, Speed: Normal, Feel: Smooth, Fades in: on.++## Slide Up Reveal++Text rises into view from behind an invisible edge. Best for headlines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/slide-up-reveal/+- How it runs: plays once+- Good for: Headlines · Section titles · Taglines+- Avoid on: Long paragraphs · Buttons++**Prompt**++Add a slide-up reveal to [your headline or lines of text]. Each line should rise into view from just below an invisible edge, as if it is coming up from behind a solid surface, so viewers only see it arrive and never see it below the line. The text can slide up behind the edge or be uncovered in place from the bottom up; both look almost the same. When there are several lines, start each one a moment after the line above it so they cascade. The text must stay readable by screen readers and search engines the whole time. If the visitor has reduced motion turned on, show the text immediately without the rise. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Delay between lines: Short · **Medium** · Long+- Reveal style: **Slide** · Wipe+- Feel: **Smooth** · Springy · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Delay between lines: Medium, Reveal style: Slide, Feel: Smooth.++## Scale In / Zoom In++Grows from smaller to full size. Best for pop-ups and menus.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/scale-in/+- How it runs: plays once+- Good for: Pop-ups and dialogs · Menus · Cards in a grid · Checkmarks+- Avoid on: Long text · Full-page sections++**Prompt**++Add a scale-in entrance to [the element you want to animate]. It should start smaller than its final size and grow to full size, anchored at the point given in the settings: its center, or an edge or corner so it seems to grow out of the button that opened it. A springy curve lets it overshoot slightly and settle, which makes the arrival feel physical. Unless the settings turn it off, fade it in while it grows so it never flashes at full strength while it is still tiny. Animate only its size and opacity. If the visitor has reduced motion turned on, show it at full size without the zoom. Match the settings listed below.++**Settings** (the defaults in bold):++- Starting size: **A bit smaller** · Half size · From nothing+- Grows from: **Center** · Top left · Top · Bottom+- Speed: Slow · **Normal** · Fast+- Feel: Smooth · **Springy** · Gentle · Even+- Fades in: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Starting size: A bit smaller, Grows from: Center, Speed: Normal, Feel: Springy, Fades in: on.++## Clip-Path Reveal++A growing shape uncovers it while it stays still. Best for images and banners.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/clip-path-reveal/+- How it runs: plays once+- Good for: Images · Banners · Full-width panels+- Avoid on: Small buttons · Form fields++**Prompt**++Add a mask reveal to [the image or block you want to reveal]. The element should stay completely still and fully drawn while a shape uncovers it, like a window opening: an edge wipe that starts from one side or from the center, or a circle or oval that opens from the middle. Nothing moves, fades or changes size; only the visible area grows until the whole element shows. A wipe that slows down as it finishes looks calmer than one that stops abruptly. The content must stay accessible even while part of it is hidden. If the visitor has reduced motion turned on, show it fully without the wipe. Match the settings listed below.++**Settings** (the defaults in bold):++- Shape: **Edge wipe** · Circle · Oval+- Starts from: **Left** · Right · Top · Bottom · Center+- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Shape: Edge wipe, Starts from: Left, Speed: Normal, Feel: Smooth.++## Curtain Reveal++A colored panel covers it, then slides away. Best for intros and logos.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/curtain-reveal/+- How it runs: plays once+- Good for: Page intros · Logos · Section changes · Portfolio pieces+- Avoid on: Buttons and menus · Things shown often++**Prompt**++Add a curtain reveal to [the content you want to reveal]. A solid colored panel should slide across and cover the content completely, hold for the pause given in the settings, then keep going and slide off the far side, leaving the content visible. The pause is what makes the change register. When the panels come in from both sides, two panels meet in the middle, then part. Pick a panel color that contrasts strongly with the content. Move the panels rather than resizing them so the motion stays smooth. If the visitor has reduced motion turned on, show the content without the curtain. Match the settings listed below.++**Settings** (the defaults in bold):++- Comes in from: **Left** · Right · Top · Bottom · Both sides+- Speed: Slow · **Normal** · Fast+- Pause while covered: None · **Short** · Long+- Curtain color: **Dark** · Ink blue · Warm red · Off-white · Gold++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Comes in from: Left, Speed: Normal, Pause while covered: Short, Curtain color: Dark.++## Split Text Reveal++Text breaks into pieces that appear one after another. Best for headlines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/split-text-reveal/+- How it runs: plays once+- Good for: Headlines · Taglines · Short quotes+- Avoid on: Body text · Buttons and labels++**Prompt**++Add a split-text reveal to [your headline]. Break the text into pieces (characters, words or lines) and animate each piece into view one after another with a short delay between them, so the text flows in as a cascade instead of appearing all at once. Every piece plays the same small entrance, such as fading up from slightly below. Screen readers should still read the text as one normal sentence, not as separate pieces, and the text must not reflow or jump while it animates. If the visitor has reduced motion turned on, show the text immediately. Match the settings listed below.++**Settings** (the defaults in bold):++- Split into: Letters · **Words** · Lines+- How each piece appears: **Fade up** · Fade · Grow · Flip+- Delay between pieces: Short · **Medium** · Long+- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Springy · Even+- Your text: text field, starts as "Design beyond the obvious"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Split into: Words, How each piece appears: Fade up, Delay between pieces: Medium, Speed: Normal, Feel: Smooth, Your text: "Design beyond the obvious".++## Letter-by-Letter Stagger++A phrase appears letter by letter or typewriter-style. Best for short headlines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/letter-by-letter-stagger/+- How it runs: plays once+- Good for: Short headlines · Names and logos · Chat messages · Loading screens+- Avoid on: Long text · Buttons and labels++**Prompt**++Add a letter-by-letter entrance to [a short phrase or headline]. In the cascade style, every letter plays a small entrance a moment after the previous one, so the phrase assembles from left to right. In the typewriter style, the letters appear one at a time as if someone is typing, with a blinking cursor when the settings include one. Use it only on short phrases, because long text becomes tedious to wait for. Screen readers should hear the whole phrase once, not letter by letter. If the visitor has reduced motion turned on, show the full phrase immediately. Match the settings listed below.++**Settings** (the defaults in bold):++- Style: **Cascade** · Typewriter+- Delay between letters: Short · **Medium** · Long+- How each letter appears: **Fade up** · Fade · Grow · Flip+- Speed: Slow · **Normal** · Fast+- Blinking cursor: **on** · off (only with some choices of another setting)+- Your text: text field, starts as "Hello, world."++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Style: Cascade, Delay between letters: Medium, How each letter appears: Fade up, Speed: Normal, Your text: "Hello, world.".++## Word-by-Word Reveal++Words appear one after another at a reading pace. Best for quotes and intros.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/word-by-word-reveal/+- How it runs: plays once+- Good for: Quotes · Short paragraphs · Captions · Story sections+- Avoid on: Long articles · Buttons and labels++**Prompt**++Add a word-by-word reveal to [the paragraph or quote you want to reveal]. Each word should appear a moment after the one before it, so the text builds up as if it is being spoken; a delay close to the pace people read feels most natural. If pauses between sentences are on, wait a little longer at the end of each sentence before continuing. Keep the delay short enough that nobody waits for text they could already read. The full text must stay readable by screen readers and must not reflow while it appears. If the visitor has reduced motion turned on, show all the text at once. Match the settings listed below.++**Settings** (the defaults in bold):++- Delay between words: Short · **Medium** · Long+- How each word appears: **Fade up** · Fade · Grow · Blur · Flip+- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Springy · Even+- Pauses between sentences: on · **off**+- Your text: text box, starts with the lines "We build interfaces that disappear.", "Tools that feel inevitable." and "Software made with care."++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Delay between words: Medium, How each word appears: Fade up, Speed: Normal, Feel: Smooth, Pauses between sentences: off, Your text: "We build interfaces that disappear. Too…".++## Blur In++Comes into focus from a blur, like a camera. Best for featured cards and photos.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/blur-in/+- How it runs: plays once+- Good for: Featured cards · Photos · Pop-ups · Portfolio pieces+- Avoid on: Lists and grids · Small text++**Prompt**++Add a blur-in entrance to [the element you want to animate]. It should come into view like a camera pulling focus onto the subject: sharpening from a blur makes it feel like a lens finding its subject, and fading in at the same time makes it feel like it is arriving. It can also drift up slightly as it settles. Use it on one focal element at a time, not on a list or grid, because blur is expensive for the browser to draw. Remove the blur completely once the animation ends. If the visitor has reduced motion turned on, show the element sharp and visible without the effect. Match the settings listed below.++**Settings** (the defaults in bold):++- How blurry it starts: Slight · **Medium** · Heavy+- Speed: Slow · **Normal** · Fast+- What changes: **Blur and fade** · Blur only · Fade only+- Feel: **Smooth** · Gentle · Even+- Drifts up: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: How blurry it starts: Medium, Speed: Normal, What changes: Blur and fade, Feel: Smooth, Drifts up: on.++## Flip In++Swings into view in 3D, like a card turning over. Best for cards and tiles.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/flip-in/+- How it runs: plays once+- Good for: Cards · Flashcards and tiles · Dashboard panels · Onboarding steps+- Avoid on: Text blocks · Full-page sections++**Prompt**++Add a 3D flip-in entrance to [the card you want to animate]. The card should start turned away from the viewer and swing toward them until it faces them flat. Give the card's container a 3D perspective so the swing has real depth; without it, the flip looks like a flat squash. The hinge can sit in the middle or along one edge, and the card can fade in while it turns. If the visitor has reduced motion turned on, show the card facing forward without the flip. Match the settings listed below.++**Settings** (the defaults in bold):++- Swing direction: **Sideways** · Up and down · Diagonal+- Hinge: **Center** · Top · Bottom · Left+- Speed: Slow · **Normal** · Fast+- How far it turns: A little · **¼ turn** · ½ turn+- 3D depth: Subtle · **Medium** · Strong+- Feel: **Smooth** · Springy · Gentle · Even+- Fades in: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Swing direction: Sideways, Hinge: Center, Speed: Normal, How far it turns: ¼ turn, 3D depth: Medium, Feel: Smooth, Fades in: on.++## Bounce In++Lands with a springy bounce. Best for badges and success messages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/bounce-in/+- How it runs: plays once+- Good for: Success messages · Badges · Small pop-ups · Playful brands+- Avoid on: Formal content · Large panels++**Prompt**++Add a bounce-in entrance to [the element you want to animate]. When it appears, it should start small and a little below its final spot, grow slightly past full size, dip just under it, then settle, as if it landed with a small spring. Each bounce is smaller than the one before, like energy running out, and one bounce usually looks best. Unless the settings turn it off, fade it in at the same time. Animate only its position, size and opacity so it stays smooth. If the visitor has reduced motion turned on, show the element without the bounce. Match the settings listed below.++**Settings** (the defaults in bold):++- Bounce strength: Soft · **Medium** · Strong+- Number of bounces: **One** · Two · Three+- Speed: Slow · **Normal** · Fast+- Fades in: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Bounce strength: Medium, Number of bounces: One, Speed: Normal, Fades in: on.++## Rotate In++Spins into place while it grows. Best for icons, stars and badges.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/rotate-in/+- How it runs: plays once+- Good for: Icons · Badges and stars · Logos · Small decorations+- Avoid on: Text · Wide boxes and cards++**Prompt**++Add a rotate-in entrance to [the icon or badge you want to animate]. It should spin around its center as it appears. Growing from small at the same time makes it look like it is arriving rather than just turning, and a slight overshoot at the end makes the spin land instead of gliding to a stop. Use this on round or symmetric shapes like icons, stars, gears and badges; it looks wrong on text or wide rectangles. If the visitor has reduced motion turned on, show it in place without spinning. Match the settings listed below.++**Settings** (the defaults in bold):++- How much it spins: ¼ turn · **½ turn** · Full turn+- Speed: Slow · **Normal** · Fast+- Spin direction: **Clockwise** · Counter-clockwise+- Bounce at the end: **on** · off+- Grows from small: **on** · off+- Fades in: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: How much it spins: ½ turn, Speed: Normal, Spin direction: Clockwise, Bounce at the end: on, Grows from small: on, Fades in: on.++## Shatter Effect++Breaks into pieces that fly apart and fade. Best for galleries and bold exits.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/shatter-effect/+- How it runs: plays once+- Good for: Photo galleries · Dismissed cards · Game moments · Bold intros+- Avoid on: Things shown often · Calm, serious pages++**Prompt**++Add a shatter effect to [the card or picture you want to break]. When it plays, the card breaks into uneven pieces that burst away from the point of impact, each turning as it flies and fading out, while the next card fades in behind them. Make each piece a copy of the whole card trimmed to its own shape, so together they look exactly like the card until they move, and launch the pieces nearest the impact first. Move and turn the pieces rather than resizing them so it stays smooth, and remove them once they have faded. If the visitor has reduced motion turned on, fade the card out and the next one in, with no pieces. Match the settings listed below.++**Settings** (the defaults in bold):++- Number of pieces: Few · **Medium** · Many+- Breaks from: **Center** · Corner+- Gravity: None · **Normal** · Heavy+- Speed: Slow · **Normal** · Fast+- Shows the cracks: **on** · off+- Tumbles in 3D: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Number of pieces: Medium, Breaks from: Center, Gravity: Normal, Speed: Normal, Shows the cracks: on, Tumbles in 3D: on.diff --git a/skills/animation-handbook/references/03-page-transitions.md b/skills/animation-handbook/references/03-page-transitions.mdnew file mode 100644index 00000000..23cbcc26--- /dev/null+++ b/skills/animation-handbook/references/03-page-transitions.md@@ -0,0 +1,393 @@+# 03 · Page Transitions++Full-page transitions between routes or views — crossfades, slides, portals, morphs, and the View Transitions API. 16 animations from Animation Handbook, in the home page's order. Each entry gives the live demo, how it runs, what it is good for and what to avoid it on, the prompt from its page word for word, and its settings.++## Contents++- [View Transitions API](#view-transitions-api)+- [Shared Element Transition](#shared-element-transition)+- [Morph Transition](#morph-transition)+- [Crossfade Transition](#crossfade-transition)+- [Slide Transition](#slide-transition)+- [Zoom Transition](#zoom-transition)+- [Flash / Light Leak Transition](#flash--light-leak-transition)+- [Blur Transition](#blur-transition)+- [Elastic Transition](#elastic-transition)+- [Portal / Tunnel Zoom](#portal--tunnel-zoom)+- [Dissolve Transition](#dissolve-transition)+- [FLIP Technique](#flip-technique)+- [Circle Reveal](#circle-reveal)+- [Overlay Wipe](#overlay-wipe)+- [Page Curl](#page-curl)+- [Cube Transition](#cube-transition)++## View Transitions API++The browser animates the change between two pages for you. Best for web apps.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/view-transitions-api/+- How it runs: reacts to the visitor+- Good for: Web apps · Page changes · Tabs and filters · Galleries+- Avoid on: Frequent updates++**Prompt**++Add page transitions to [your site's pages or views] with the browser's View Transitions API. Wrap each page change in a view transition: the browser takes a picture of the page before and after the change and animates between the two pictures. Name the content area so that only it animates, and turn off the default animation of the whole page. Style how the old and new pictures move with CSS, for example a fade, a slide or a zoom. Check that the browser supports the API, and simply swap the content when it does not. If the visitor has reduced motion turned on, swap the content with no animation. Match the settings listed below.++**Settings** (the defaults in bold):++- Transition style: **Fade** · Slide · Zoom · Tilt+- Speed: Slow · **Normal** · Fast+- Feel: Smooth · **Gentle** · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Transition style: Fade, Speed: Normal, Feel: Gentle.++## Shared Element Transition++A picture grows from the list into the next page's header. Best for galleries.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/shared-element-transition/+- How it runs: reacts to the visitor+- Good for: Galleries · Product grids · Card lists · Media libraries+- Avoid on: Unrelated pages++**Prompt**++Add a shared element transition to [your list of items and their detail pages]. When a visitor opens an item, its picture should grow from its place in the list into the large header of the detail page, while the list fades away and the detail text fades in just after the picture lands. Measure where the picture starts and where it ends, then move a copy from one to the other with a transform only, never by changing its position or size, so it reads as one continuous element. Going back fades the detail page out and the list back in. If the visitor has reduced motion turned on, open and close the detail page without the movement. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Springy++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Feel: Smooth.++## Morph Transition++The logo changes shape to match each page you visit. Best for brand marks.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/morph-transition/+- How it runs: reacts to the visitor+- Good for: Logos · Brand marks · Icons that change state+- Avoid on: Detailed pictures · Text++**Prompt**++Add a morphing logo to [your logo or icon, and the pages it belongs to]. Give each page its own shape for the logo, and when the visitor changes page, let the outline flow from the old shape into the new one while the page content fades across. Draw every shape with the same number of points in the same order, so each point has a partner to move to and the outline never tears or twists. Move the points yourself on every frame, because CSS cannot blend two different shapes. If the visitor has reduced motion turned on, switch to the new shape at once. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Feel: Smooth · Springy · **Gentle** · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Feel: Gentle.++## Crossfade Transition++The old page fades out as the new one fades in. Best for calm page changes.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/crossfade/+- How it runs: reacts to the visitor+- Good for: Tabs · Image galleries · Content swaps · Calm sites+- Avoid on: Step-by-step flows++**Prompt**++Add a crossfade between [the pages or views you want to switch between]. Stack the old and the new page in exactly the same place, then fade the old one out and the new one in. When the two fades run together, both pages are half visible for a moment and blend; one after the other, a short blank moment falls between them. Nothing moves; only how see-through each page is changes. It is the calmest page change and suits content that has no order. If the visitor has reduced motion turned on, switch pages instantly. Match the settings listed below.++**Settings** (the defaults in bold):++- Fade order: **Together** · One after the other+- Speed: Slow · **Normal** · Fast+- Feel: Smooth · **Gentle** · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Fade order: Together, Speed: Normal, Feel: Gentle.++## Slide Transition++Pages slide across, and going back slides the other way. Best for step flows.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/slide-transition/+- How it runs: reacts to the visitor+- Good for: Step-by-step flows · Checkout · Onboarding · Carousels+- Avoid on: Unrelated pages++**Prompt**++Add slide transitions to [the pages or steps you want to move between]. When the visitor changes page, move the old page out of one side while the new page comes in from the other, like panels on a track. When the direction follows the navigation, going forward slides to the left and going back slides to the right, as phone apps do. Move the pages with transforms only, never by changing their position or size, and keep pages that are off screen from catching taps. If the visitor has reduced motion turned on, switch pages without sliding. Match the settings listed below.++**Settings** (the defaults in bold):++- Direction: **Forward and back** · Left to right · Right to left · Top to bottom+- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Springy · Even+- Gap between pages: **None** · Small · Large++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Direction: Forward and back, Speed: Normal, Feel: Smooth, Gap between pages: None.++## Zoom Transition++The pages zoom as they swap, as if moving in depth. Best for opening details.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/zoom-transition/+- How it runs: reacts to the visitor+- Good for: Opening details · Galleries · Lightboxes+- Avoid on: Step-by-step flows++**Prompt**++Add a zoom transition to [the pages or views you want to move between]. When the page changes, scale the old and the new page while one fades out and the other fades in, so the change seems to move through depth rather than across the screen. Zooming in, where the new page grows into place, feels like going deeper; zooming out feels like stepping back; a pull-through, where the new page rushes in from larger, feels like traveling forward. Scale with transforms only, and keep the fade so no hard edge shows. If the visitor has reduced motion turned on, swap pages without scaling. Match the settings listed below.++**Settings** (the defaults in bold):++- Zoom style: **Zoom in** · Zoom out · Pull through+- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Springy · Gentle++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Zoom style: Zoom in, Speed: Normal, Feel: Smooth.++## Flash / Light Leak Transition++A burst of light hides the moment the page changes. Best for bold, lively sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/flash-transition/+- How it runs: reacts to the visitor+- Good for: Product launches · Music and fashion · Photo stories+- Avoid on: Frequent page changes · Calm sites++**Prompt**++Add a flash transition to [the pages or scenes you want to switch between]. Cover the content with a full-size colored layer that rises to its peak, swap the page while it is covered, then fade the layer away to reveal the new page, like a burst of light hiding a cut in a film. At full strength the change is completely hidden. Let the fade-out take a little longer than the rise. Keep flashes rare, never several in one second, to protect people who are sensitive to flashing light. If the visitor has reduced motion turned on, switch pages with no flash. Match the settings listed below.++**Settings** (the defaults in bold):++- Flash color: **White** · Gold · Cyan · Red+- Speed: Slow · **Normal** · Fast+- Flash strength: **Full** · Strong · Soft+- Blurs the flash: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Flash color: White, Speed: Normal, Flash strength: Full, Blurs the flash: off.++## Blur Transition++The old page blurs away and the new one comes into focus. Best for photo sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/blur-transition/+- How it runs: reacts to the visitor+- Good for: Photo sites · Film and editorial · Portfolios+- Avoid on: Self-playing slideshows · Low-end phones++**Prompt**++Add a blur transition to [the pages or views you want to switch between]. When the page changes, blur the old page until it is out of focus, bring in the new page just as blurred, then sharpen it into focus, like a camera pulling focus from one subject to another. Fading while blurring hides the moment of the swap. Blur is costly for the browser to draw, so use it only on changes the visitor starts, never on anything that repeats by itself, and remove the blur completely when it ends. If the visitor has reduced motion turned on, switch pages without blurring. Match the settings listed below.++**Settings** (the defaults in bold):++- How blurry it gets: Slight · **Medium** · Heavy+- Speed: Slow · **Normal** · Fast+- Fades as it blurs: **on** · off+- Overlaps the two halves: on · **off**+- Feel: Smooth · **Gentle** · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: How blurry it gets: Medium, Speed: Normal, Fades as it blurs: on, Overlaps the two halves: off, Feel: Gentle.++## Elastic Transition++The new page slides in, goes too far and springs back. Best for playful apps.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/elastic-transition/+- How it runs: reacts to the visitor+- Good for: Playful apps · Panels and drawers · Games+- Avoid on: Formal sites++**Prompt**++Add an elastic transition to [the pages or panels you want to move between]. The new page should slide in from the side, go a little past its place and spring back before settling, as if pulled by a rubber band, while the old page slides away. The bounce can be planned ahead as a fixed path, which is cheap, or worked out live with a simple spring, which can react if the visitor interrupts it; with a live spring, advance it in small fixed time steps so it moves the same on every screen, and limit the time one frame adds so a slow frame cannot throw it off. If the visitor has reduced motion turned on, switch pages without movement. Match the settings listed below.++**Settings** (the defaults in bold):++- How it bounces: **Planned path** · Live spring+- Bounce size: Small · **Medium** · Large+- Speed: Slow · **Normal** · Fast++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: How it bounces: Planned path, Bounce size: Medium, Speed: Normal.++## Portal / Tunnel Zoom++The next page opens out of a circle you click. Best for big reveals.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/portal-zoom/+- How it runs: reacts to the visitor+- Good for: Big reveals · Galleries · Story chapters · Calls to action+- Avoid on: Everyday navigation++**Prompt**++Add a portal transition to [the element that should open into the next page]. When the visitor clicks it, show the next page through an opening that starts as a point at the element's center and grows until the new page fills the view, as if diving through a window. Put the new page underneath first and only grow the visible opening, measuring the element's position at the moment of the click so the opening starts exactly there. Make the opening big enough at the end to reach the corners. If the visitor has reduced motion turned on, show the new page at once. Match the settings listed below.++**Settings** (the defaults in bold):++- Portal shape: **Circle** · Square+- Speed: Slow · **Normal** · Fast+- Feel: **Speeds up** · Smooth · Gentle · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Portal shape: Circle, Speed: Normal, Feel: Speeds up.++## Dissolve Transition++The page breaks into tiles that give way to the next. Best for photo galleries.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/dissolve/+- How it runs: reacts to the visitor+- Good for: Photo galleries · Slideshows · Retro and game sites+- Avoid on: Everyday navigation++**Prompt**++Add a dissolve transition to [the pages or images you want to switch between]. Lay a grid of tiles over the old page and fade each tile in at a slightly different moment, following a pattern such as random, a diagonal sweep or rings from the middle, so the old page breaks up instead of fading evenly. Swap the page while the tiles cover it, then remove the tiles, or fade them away in the same pattern to reveal the new page. Give each tile its own delay and let the browser run the fades. If the visitor has reduced motion turned on, use a short, plain fade instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Pattern: **Random** · Diagonal · From the middle+- Tile size: Small · **Medium** · Large+- Speed: Slow · **Normal** · Fast+- Dissolves both ways: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Pattern: Random, Tile size: Medium, Speed: Normal, Dissolves both ways: off.++## FLIP Technique++Cards glide to their new places when the layout changes. Best for sorting lists.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/flip-technique/+- How it runs: reacts to the visitor+- Good for: Sorting and filtering · Card grids · Dashboards · Lists+- Avoid on: Very long lists++**Prompt**++Animate layout changes in [the grid or list you want to rearrange] with the FLIP technique. Before the change, record where every item is. Apply the new order or layout so the items jump to their new places. Then shift each item back to where it was with a transform, and animate that shift away so the items glide to their real places. Only transforms animate, so it stays smooth even with many items. Match items across the change by a stable id. If the visitor has reduced motion turned on, let the items jump to their new places without gliding. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Springy · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Feel: Smooth.++## Circle Reveal++Pages grow from any spot you click and shrink back into it. Best for app navigation.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/circle-reveal/+- How it runs: reacts to the visitor+- Good for: App navigation · Theme switches · Menu buttons · Calls to action+- Avoid on: Quick tab changes++**Prompt**++Add a circle reveal to [the links or buttons that change the page]. When the visitor clicks or taps, put the new page on top of the old one and show it only inside a circle that starts as a dot and grows until it covers everything. Make its final size reach the farthest corner from where it starts, so no corner is left uncovered. When it starts from the click, measure the spot at that moment; a press of the keyboard has no spot, so use the middle of the pressed button. Grow only the visible circle; neither page moves. If the visitor has reduced motion turned on, crossfade the pages instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Where it starts: **Where you click** · Center · Corner+- Speed: Slow · **Normal** · Fast+- Closes when you go back: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Where it starts: Where you click, Speed: Normal, Closes when you go back: on.++## Overlay Wipe++A colored panel sweeps over the page as it changes. Best for portfolio sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/overlay-wipe/+- How it runs: reacts to the visitor+- Good for: Portfolio sites · Agency sites · Brand-colored sites · Chapter breaks+- Avoid on: Apps used all day++**Prompt**++Add an overlay wipe to [the pages you want to switch between]. When the visitor changes page, sweep a solid colored panel across until it covers the whole page, swap the page while it is covered, then sweep the panel on out of the opposite side to reveal the new page. Move the panel only by sliding it, never by resizing it, and keep the covered moment short so the change still feels quick. Ease each sweep so the panel starts and stops softly. A second, lighter panel can lead the way in and trail the first on the way out. If the visitor has reduced motion turned on, use a quick fade instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Direction: **Left to right** · Right to left · Bottom to top · Top to bottom+- Panel color: **Violet** · Coral · Teal · Gold+- Two stacked panels: on · **off**+- Speed: Slow · **Normal** · Fast++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Direction: Left to right, Panel color: Violet, Two stacked panels: off, Speed: Normal.++## Page Curl++The page peels back from its corner like paper. Best for digital magazines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/page-curl/+- How it runs: reacts to the visitor+- Good for: Digital magazines · Picture books · Menus and brochures · Photo albums+- Avoid on: Everyday navigation++**Prompt**++Add a page curl to [the pages you want to turn, such as a magazine]. A forward turn lifts the bottom corner of the current page and turns it over to the left like paper, so the page underneath shows. A turn back runs the same movement in reverse and lays a page down over the current one. Draw the folded part as the back of the sheet, lying over the page along a straight fold that moves with the corner. Paper shading darkens the fold and casts a shadow on the page below. Work out the fold from the corner on every frame, timing the turn by elapsed time. If the visitor has reduced motion turned on, fade between the pages instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Turn speed: Slow · **Normal** · Fast+- Which way it turns: **Forward and back** · Always forward · Always back+- Paper shading: Off · **Soft** · Strong++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Turn speed: Normal, Which way it turns: Forward and back, Paper shading: Soft.++## Cube Transition++The pages sit on a cube that turns to show the next. Best for photo stories.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/cube-transition/+- How it runs: reacts to the visitor+- Good for: Photo stories · Product tours · Slides · Onboarding+- Avoid on: Text-heavy pages · Everyday navigation++**Prompt**++Add a cube transition to [the pages or slides you want to switch between]. Treat the current page and the next one as two sides of a cube: when the visitor changes page, turn the cube a quarter turn around its middle, which sits half a page behind the screen, so the old page swings away and the new one swings into place. Going back turns the cube the other way. Give the scene perspective, hide any side that faces away from the viewer and darken each side a little as it turns away. Animate only the turn itself so it stays smooth. If the visitor has reduced motion turned on, crossfade the pages instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Turn direction: **Sideways** · Up and down+- Speed: Slow · **Normal** · Fast+- Depth: Shallow · **Normal** · Deep++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Turn direction: Sideways, Speed: Normal, Depth: Normal.diff --git a/skills/animation-handbook/references/04-micro-interactions.md b/skills/animation-handbook/references/04-micro-interactions.mdnew file mode 100644index 00000000..ef0f85c1--- /dev/null+++ b/skills/animation-handbook/references/04-micro-interactions.md@@ -0,0 +1,1018 @@+# 04 · Micro-Interactions++Short, user-triggered animations — hover, click, focus, loading states, and UI feedback patterns. 41 animations from Animation Handbook, in the home page's order. Each entry gives the live demo, how it runs, what it is good for and what to avoid it on, the prompt from its page word for word, and its settings.++## Contents++- [Hover State Animation](#hover-state-animation)+- [Click / Tap Ripple](#click--tap-ripple)+- [Focus Ring Animation](#focus-ring-animation)+- [Button Press Scale](#button-press-scale)+- [Magnetic Button](#magnetic-button)+- [Toggle / Switch Slide](#toggle--switch-slide)+- [Heart / Like Burst](#heart--like-burst)+- [Success Confetti](#success-confetti)+- [Skeleton Loader](#skeleton-loader)+- [Shimmer Effect](#shimmer-effect)+- [Loading Spinner](#loading-spinner)+- [Progress Animation](#progress-animation)+- [Checkmark Draw](#checkmark-draw)+- [Form Field Morph](#form-field-morph)+- [Notification Badge Pulse](#notification-badge-pulse)+- [Tooltip Reveal](#tooltip-reveal)+- [Drawer / Panel Slide](#drawer--panel-slide)+- [Modal Expand](#modal-expand)+- [Accordion Open/Close](#accordion-openclose)+- [Cursor Follower](#cursor-follower)+- [Error Shake](#error-shake)+- [Swipe to Dismiss](#swipe-to-dismiss)+- [Hamburger Menu Toggle](#hamburger-menu-toggle)+- [Theme Toggle Morph](#theme-toggle-morph)+- [Copy to Clipboard](#copy-to-clipboard)+- [Star Rating](#star-rating)+- [Toast Notification](#toast-notification)+- [Segmented Control](#segmented-control)+- [Pull to Refresh](#pull-to-refresh)+- [Animated Gradient Border](#animated-gradient-border)+- [Spotlight Hover Glow](#spotlight-hover-glow)+- [Add-to-Cart Fly](#add-to-cart-fly)+- [Drag to Reorder](#drag-to-reorder)+- [Rolling Numbers](#rolling-numbers)+- [Typing Indicator](#typing-indicator)+- [Hold to Confirm](#hold-to-confirm)+- [Expanding Search](#expanding-search)+- [Button Loading States](#button-loading-states)+- [Image Trail](#image-trail)+- [Gooey Menu](#gooey-menu)+- [Dynamic Island](#dynamic-island)++## Hover State Animation++Six ways a card can react when you point at it. Best for buttons and cards.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/hover-state/+- How it runs: reacts to the visitor+- Good for: Buttons · Links · Cards · Menus+- Avoid on: Plain text · Non-clickable items++**Prompt**++Add hover feedback to [the buttons, links or cards you want to react]. When the pointer moves over an item, change it in one clear way: shift its background color, grow it slightly, lift it with a deeper shadow, draw an underline out from the left, nudge its arrow forward, or sweep a tint across it. Use one style per kind of item and keep it the same across the page. Apply hover styles only on devices that can hover, and show the same change while an item is pressed on touch screens. If the visitor has reduced motion turned on, switch the look without animating it. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Springy · Gentle · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Feel: Smooth.++## Click / Tap Ripple++A ripple spreads out from the spot you press. Best for buttons and list items.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/click-ripple/+- How it runs: reacts to the visitor+- Good for: Buttons · List items · Menu items · Icon buttons+- Avoid on: Links in text · Large panels++**Prompt**++Add a ripple to [the buttons or list items you want to respond to presses]. When the visitor presses one, a soft circle appears where they pressed, or in the middle when the settings say so, then grows outward and fades away. Clip it to the button's shape so it never spills outside, start it as soon as the press begins so the feedback feels instant, and remove each ripple once it has faded so quick taps do not pile up. It should work the same for mouse, touch and pen. If the visitor has reduced motion turned on, fade a flat highlight over the button instead of a growing circle. Match the settings listed below.++**Settings** (the defaults in bold):++- Starts from: **Where you press** · The middle+- Speed: Slow · **Normal** · Fast+- Ripple size: Small · **Medium** · Large+- Ripple strength: Faint · **Medium** · Strong+- Ripple color: **White** · Orange · Black++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Starts from: Where you press, Speed: Normal, Ripple size: Medium, Ripple strength: Medium, Ripple color: White.++## Focus Ring Animation++A ring closes in around the item the Tab key reaches. Best for forms and menus.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/focus-ring/+- How it runs: reacts to the visitor+- Good for: Forms · Buttons · Links · Menus+- Avoid on: Non-interactive items++**Prompt**++Add an animated focus ring to [the links, buttons and form fields on your page]. When keyboard focus moves to an item, draw an outline around it that starts a little further out and faint, then closes in to its place, so each Tab press is easy to follow. Show the ring only for keyboard focus, not after mouse clicks, and never remove the browser's focus outline without drawing this one instead. Make sure the ring stands out against every background it sits on. If the visitor has reduced motion turned on, show the ring at once without closing in. Match the settings listed below.++**Settings** (the defaults in bold):++- Ring style: **Solid** · Dashed · Glow · Wide+- Speed: Slow · **Normal** · Fast+- Ring thickness: Thin · **Medium** · Thick+- Ring gap: None · **Small** · Large++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Ring style: Solid, Speed: Normal, Ring thickness: Medium, Ring gap: Small.++## Button Press Scale++Shrinks as you press it and springs back as you let go. Best for main buttons.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/button-press-scale/+- How it runs: reacts to the visitor+- Good for: Main buttons · Icon buttons · Mobile apps+- Avoid on: Links in text · Large cards++**Prompt**++Add press feedback to [the buttons you want to feel tactile]. While a button is held down it shrinks, as if pushed in, and when it is let go it returns to full size. A press that is quicker than the release feels most like a real button. Respond to mouse, touch and pen presses and to Space and Enter on the keyboard, and let go cleanly if a press turns into a scroll, so no button stays stuck down. Change only the button's size so nothing around it moves. If the visitor has reduced motion turned on, change the size at once, without animating it. Match the settings listed below.++**Settings** (the defaults in bold):++- Press depth: Light · **Medium** · Deep+- Release speed: Slow · **Normal** · Fast+- Release feel: **Springy** · Smooth · Even+- Press speed: Slow · **Normal** · Fast++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Press depth: Medium, Release speed: Normal, Release feel: Springy, Press speed: Normal.++## Magnetic Button++Leans toward the pointer, then springs home. Best for one main button.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/magnetic-button/+- How it runs: reacts to the visitor+- Good for: Hero buttons · Portfolio sites · One key action+- Avoid on: Forms · Rows of buttons++**Prompt**++Add a magnetic effect to [the one button you want to stand out]. When the pointer comes within reach, pull the button part of the way toward it, more strongly the closer it gets, and move its label a little further so the label seems to float above the button. When the pointer leaves, let the button spring back to its place. Move it only with transforms so the layout never shifts, and use it on one or two buttons at most. On touch screens, pull the button toward the finger while it touches and send it home when it lifts. If the visitor has reduced motion turned on, move it quickly and evenly instead of letting it glide. Match the settings listed below.++**Settings** (the defaults in bold):++- Pull strength: Gentle · **Medium** · Strong+- Reach: Short · **Medium** · Long++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Pull strength: Medium, Reach: Medium.++## Toggle / Switch Slide++The knob slides across as the switch turns on or off. Best for settings.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/toggle-switch/+- How it runs: reacts to the visitor+- Good for: Settings · Preferences · Dark mode switches+- Avoid on: Forms sent later · More than two options++**Prompt**++Add an animated toggle switch to [the on/off setting you want to control]. Build it on a real checkbox so it works with the keyboard and screen readers. When it is turned on, the round knob slides across the track and the track fills with color; when it is turned off, both go back. When the settings ask for it, let the knob go slightly past the end and settle, so it feels springy. Make the whole switch and its label easy to tap. If the visitor has reduced motion turned on, move the knob without sliding. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Feel: Smooth · **Gentle** · Even+- Springy knob: **on** · off+- On color: Pink · **Blue** · Purple · Green · Orange++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Feel: Gentle, Springy knob: on, On color: Blue.++## Heart / Like Burst++The heart pops and fills as small hearts burst out. Best for like buttons.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/heart-burst/+- How it runs: reacts to the visitor+- Good for: Like buttons · Favorites · Bookmarks · Reactions+- Avoid on: Delete buttons · Neutral toggles++**Prompt**++Add a like button with a burst to [the heart or favorite button you want to reward]. When the visitor likes something, the heart quickly squashes, overshoots a little and settles as it fills with color, while a spray of tiny hearts and dots flies out from its center, arcs down and fades. Unliking simply removes the color, with no burst. Draw the burst on one layer over the button and stop drawing once the last piece has faded. Tell screen readers whether it is liked. If the visitor has reduced motion turned on, only fill the heart, with no pop or burst. Match the settings listed below.++**Settings** (the defaults in bold):++- Number of hearts: Few · **Some** · Many+- How far they fly: Short · **Medium** · Far++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Number of hearts: Some, How far they fly: Medium.++## Success Confetti++Confetti bursts from the button when a task is done. Best for big moments.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/success-confetti/+- How it runs: reacts to the visitor+- Good for: Orders placed · Sign-ups finished · Milestones+- Avoid on: Everyday clicks · Serious tasks++**Prompt**++Add a confetti burst to [the action that completes something important, such as placing an order]. When it succeeds, turn the button into a clear success state with a check mark and a short confirmation, and fire small colored rectangles from the button: they shoot upward in a fan, spin, slow down, fall and fade. Save it for real milestones, not everyday clicks. Draw the pieces on one layer and stop drawing once the last one has faded or fallen out of view. If the visitor has reduced motion turned on, show the success state without the confetti. Match the settings listed below.++**Settings** (the defaults in bold):++- Amount of confetti: Some · **Medium** · Lots+- Spread: Narrow · **Medium** · Wide+- Fall speed: Floaty · **Normal** · Heavy++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Amount of confetti: Medium, Spread: Medium, Fall speed: Normal.++## Skeleton Loader++Gray shapes hold the place of content while it loads. Best for feeds and cards.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/skeleton-loader/+- How it runs: plays once+- Good for: Feeds · Cards · Lists · Dashboards+- Avoid on: Very short waits · Unknown layouts++**Prompt**++Add a skeleton loading state to [the card, list or panel whose content loads]. While it loads, show gray blocks in the shapes and sizes of the content that is coming, such as a round avatar, lines of text and an image, and let them pulse between dimmer and brighter. When the content is ready, swap the blocks for it and fade it in. Match the shapes closely, because a skeleton that does not fit the content makes the page jump when it arrives. If the visitor has reduced motion turned on, keep the blocks still. Match the settings listed below.++**Settings** (the defaults in bold):++- Pulse speed: Slow · **Normal** · Fast+- Pulse strength: Soft · **Medium** · Strong+- Loading time: Short · **Medium** · Long++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Pulse speed: Normal, Pulse strength: Medium, Loading time: Medium.++## Shimmer Effect++A band of light sweeps over gray placeholders. Best for loading screens.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/shimmer-effect/+- How it runs: moves by itself+- Good for: Feeds · Cards · Lists · Image galleries+- Avoid on: Very short waits · Busy pages++**Prompt**++Add a shimmer to [the skeleton placeholders on your loading screen]. Lay a band of light over each placeholder and sweep it across in one direction, again and again, so the gray shapes look like content streaming in. Every placeholder on the page should shimmer in the same direction, and each one must clip the band to its own edges so it never spills out. Keep the band see-through so it works on any placeholder color. If the visitor has reduced motion turned on, keep the placeholders still. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Brightness: Soft · **Medium** · Bright+- Highlight angle: **Upright** · Slanted · Diagonal+- Highlight color: **White** · Blue · Gold++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Brightness: Medium, Highlight angle: Upright, Highlight color: White.++## Loading Spinner++Six small shapes loop to show that something is loading. Best for short waits.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/loading-spinner/+- How it runs: moves by itself+- Good for: Network waits · Buttons while sending · Short waits+- Avoid on: Known-length tasks · Very quick loads++**Prompt**++Add a loading spinner to [the place where people wait for something to load]. Use a small shape that keeps moving in a steady loop, such as a ring with one colored part turning around, dots circling or dots bouncing in turn, to show that work is going on when you cannot say how long it will take. Show it only for waits longer than about half a second, and tell screen readers that something is loading. If you know how far along the task is, use a progress bar instead. If the visitor has reduced motion turned on, fade it gently instead of spinning. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Size: Small · **Medium** · Large+- Color: Pink · White · **Blue** · Purple · Green · Orange++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Size: Medium, Color: Blue.++## Progress Animation++A bar, a ring and steps fill up to show progress. Best for uploads.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/progress-animation/+- How it runs: plays once+- Good for: Uploads · Downloads · Multi-step forms · Installs+- Avoid on: Unknown waits · Fake progress++**Prompt**++Add a progress indicator to [the upload, download or task whose progress you know]. Show how much is done with a bar that fills from left to right, a ring whose outline fills around the circle, or a row of steps that light up in turn, all driven by the same percentage and shown with the number. Fill it smoothly as progress arrives, and only show real progress: never race to near the end and stall. When the settings ask for it, slide a short piece along the bar for waits of unknown length. If the visitor has reduced motion turned on, jump straight to the current value. Match the settings listed below.++**Settings** (the defaults in bold):++- Fills to: 50% · 75% · **100%**+- Speed: Slow · **Normal** · Fast+- Feel: **Smooth** · Gentle · Even+- Sliding bar: on · **off**+- Fill color: Pink · White · **Blue** · Purple · Green · Orange++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Fills to: 100%, Speed: Normal, Feel: Smooth, Sliding bar: off, Fill color: Blue.++## Checkmark Draw++A tick draws itself in a circle once a task succeeds. Best for forms.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/checkmark-draw/+- How it runs: reacts to the visitor+- Good for: Form success · Payments · Finished steps+- Avoid on: Frequent small saves++**Prompt**++Add a success check mark that draws itself to [the form or action that just finished]. After the visitor submits, show a short loading state in the button, then draw a circle and a tick inside it as if by hand: the circle first, then the tick, starting just before the circle closes. For a failure, draw a red X the same way and give it a short shake. Let the button turn green or red to match. If the visitor has reduced motion turned on, show the finished check or X at once. Match the settings listed below.++**Settings** (the defaults in bold):++- Result: **Success** · Error+- Speed: Slow · **Normal** · Fast+- Line thickness: Thin · **Medium** · Thick+- Feel: **Smooth** · Gentle · Even+- Tick color: Pink · White · Blue · Purple · **Green** · Orange++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Result: Success, Speed: Normal, Line thickness: Medium, Feel: Smooth, Tick color: Green.++## Form Field Morph++The label moves up out of the way as you type. Best for sign-up forms.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/form-field-morph/+- How it runs: reacts to the visitor+- Good for: Sign-up forms · Sign-in forms · Checkout · Settings+- Avoid on: Long labels++**Prompt**++Add floating labels to [the form fields you want to label]. Each label sits inside its field like a placeholder; when the field is focused or has text in it, the label moves up and shrinks so it stays visible above the text, and the field's line or border takes on the focus color. When an empty field loses focus, the label moves back down. Keep a real label element for each field so screen readers announce it, and shrink the label from its left edge so it does not drift sideways. If the visitor has reduced motion turned on, move the label without animating it. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- How far it rises: Low · **Medium** · High+- Size when raised: Small · **Medium** · Large+- Focus color: Pink · White · **Blue** · Purple · Green · Orange++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, How far it rises: Medium, Size when raised: Medium, Focus color: Blue.++## Notification Badge Pulse++A badge on an icon pulses to catch the eye. Best for unread messages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/badge-pulse/+- How it runs: moves by itself+- Good for: Notification bells · Inboxes · Chat icons · Online status+- Avoid on: Items already seen · Many icons at once++**Prompt**++Add a pulsing notification badge to [the icon that has something new, such as a bell or an inbox]. Place a small colored dot or number on the icon's corner and let it pulse, growing and settling back or sending a soft ring outward, so it catches the eye without demanding attention. Give the badge a thin border in the background color so it seems to float above the icon. Remove the badge once the visitor has opened what it points to, and when the settings ask for it, stop the pulse after three beats. If the visitor has reduced motion turned on, keep the badge still. Match the settings listed below.++**Settings** (the defaults in bold):++- Pulse style: **Grow** · Ring · Both+- Speed: Slow · **Normal** · Fast+- How much it grows: Slightly · **Medium** · A lot+- Stops after three pulses: on · **off**+- Badge color: **Red** · Pink · Blue · Purple · Orange++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Pulse style: Grow, Speed: Normal, How much it grows: Medium, Stops after three pulses: off, Badge color: Red.++## Tooltip Reveal++A small label fades in after a short pause. Best for icon buttons.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/tooltip-reveal/+- How it runs: reacts to the visitor+- Good for: Icon buttons · Cut-off text · Form hints · Chart values+- Avoid on: Key information · Long text++**Prompt**++Add tooltips to [the icon buttons, shortened text or fields that need a short explanation]. When the pointer rests on an item, or keyboard focus reaches it, wait a moment, then fade the tooltip in beside it while it grows very slightly from the side facing the item, so it feels light rather than like a pop-up. The wait keeps tooltips from flashing while the pointer only passes by. When the pointer leaves, hide it again, after a pause if the settings include one, and let the Escape key close it at once. On touch screens, show and hide it with a tap. If the visitor has reduced motion turned on, fade it without growing. Match the settings listed below.++**Settings** (the defaults in bold):++- Delay before showing: None · Short · **Medium** · Long+- Speed: Slow · **Normal** · Fast+- Delay before hiding: None · **Short** · Long+- Shows an arrow: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Delay before showing: Medium, Speed: Normal, Delay before hiding: Short, Shows an arrow: off.++## Drawer / Panel Slide++A side panel slides in over a dimmed page. Best for mobile menus.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/drawer-slide/+- How it runs: reacts to the visitor+- Good for: Mobile menus · Filters · Settings panels+- Avoid on: Short messages · Main content++**Prompt**++Add a slide-in drawer to [the menu or panel you want to open]. It waits just beyond one edge of the screen and slides in over the page when its button is pressed; when the settings include it, the page behind it dims. Let it slow down as it arrives, like a panel sliding to a stop, and speed up as it leaves, so closing feels quicker than opening. Close it with a close button, a tap on the page beside it, the Escape key or a swipe back toward its edge. Move only its position, and keep keyboard focus inside it while it is open. If the visitor has reduced motion turned on, show and hide it without sliding. Match the settings listed below.++**Settings** (the defaults in bold):++- Slides in from: **Left** · Right · Top · Bottom+- Opening speed: Slow · **Normal** · Fast+- Closing speed: Slow · **Normal** · Fast+- Page dimming: None · Light · **Medium** · Dark++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Slides in from: Left, Opening speed: Normal, Closing speed: Normal, Page dimming: Medium.++## Modal Expand++A window grows out of the button you pressed. Best for detail views.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/modal-expand/+- How it runs: reacts to the visitor+- Good for: Detail views · Confirmations · Quick forms · Action buttons+- Avoid on: Long content · Full pages++**Prompt**++Add a modal that grows out of its button to [the button or card that opens a dialog or detail view]. When it is pressed, measure where that button sits and grow the modal from that spot to full size in the middle of the screen while the page behind it dims, so it clearly comes from what was pressed. Close it with its buttons, a tap on the dimmed page or the Escape key, and let it shrink back toward the same spot. Animate only its scale and opacity. Move keyboard focus into it, and back to the button when it closes. If the visitor has reduced motion turned on, show it at full size without growing. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Starting size: Tiny · **Small** · Medium+- Feel: **Springy** · Smooth · Even+- Marks where it grows from: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Starting size: Small, Feel: Springy, Marks where it grows from: on.++## Accordion Open/Close++Each question opens smoothly to show its answer. Best for FAQ pages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/accordion/+- How it runs: reacts to the visitor+- Good for: FAQ pages · Settings · Menus · Long documents+- Avoid on: Key information · Short content++**Prompt**++Add an accordion to [the questions or sections you want to fold away]. Show only the headings at first; when one is pressed, its content box grows from nothing to its full height and the headings below slide down, and pressing it again shrinks it back. Animate the box to the content's real height, never to a large fixed maximum, or the timing looks wrong. When the settings include it, turn a small arrow to show which items are open. Make each heading a real button that tells screen readers whether it is open. If the visitor has reduced motion turned on, open and close the sections without animating. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Feel: **Gentle** · Smooth · Even+- Several open at once: on · **off**+- Built with: **Measured height** · Grid rows+- Arrow flips: **on** · off+- Text fades in: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Feel: Gentle, Several open at once: off, Built with: Measured height, Arrow flips: on, Text fades in: off.++## Cursor Follower++A dot trails your pointer and flips the colors under it. Best for portfolios.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/cursor-follower/+- How it runs: reacts to the visitor+- Good for: Portfolios · Agency sites · Interactive stories+- Avoid on: Forms and tools · Reading pages++**Prompt**++Add a cursor follower to [the page or section where it should appear]. Draw a small shape that follows the pointer with a slight delay: each frame, close a share of the gap that is exponential in the time since the last frame, so it follows at the same pace on every screen. Hide it when the pointer leaves. When the settings include them, let it flip the colors beneath it so it stays visible on light and dark areas alike, and let it grow over buttons and links. Move it with transforms only. Touch screens have no pointer, so hide it there or let it glide to where the visitor taps. If the visitor has reduced motion turned on, keep the normal cursor instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Lag: Short · **Medium** · Long+- Size: Small · **Medium** · Large+- Flips the colors under it: **on** · off+- Shape: **Circle** · Ring · Square+- Grows over buttons: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Lag: Medium, Size: Medium, Flips the colors under it: on, Shape: Circle, Grows over buttons: on.++## Error Shake++A field shakes side to side when the input is wrong. Best for sign-in forms.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/error-shake/+- How it runs: reacts to the visitor+- Good for: Sign-in forms · Codes and PINs · Form fields+- Avoid on: Whole pages · Warnings++**Prompt**++Add an error shake to [the form field that can be rejected, such as a password]. When the value is wrong or missing, move the field quickly left and right a few times, each swing smaller than the last, and end exactly where it started, like a head shaking no. Turn its border red and show a short message saying what went wrong, because movement and color alone do not explain the problem. Move only its horizontal position so the shake stays smooth, and restart the shake on every failed try. If the visitor has reduced motion turned on, skip the shake and keep the red border and the message. Match the settings listed below.++**Settings** (the defaults in bold):++- Shake distance: Small · **Medium** · Large+- Number of swings: Few · **Medium** · Many+- Speed: Slow · **Normal** · Fast++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Shake distance: Medium, Number of swings: Medium, Speed: Normal.++## Swipe to Dismiss++A card dragged sideways flies off and the list closes up. Best for inboxes.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/swipe-to-dismiss/+- How it runs: reacts to the visitor+- Good for: Inboxes · Notifications · Chat lists · To-do lists+- Avoid on: Permanent deletes · Mouse-only tools++**Prompt**++Add swipe to dismiss to [the list items people should be able to remove]. While an item is dragged sideways, it follows the finger exactly and fades a little; when the settings include it, a red Delete label shows behind it. On release, remove it if it went far enough or was flicked quickly: it slides off the edge and its row closes up so the list moves up smoothly. Otherwise it springs back into place. Use pointer events so mouse, touch and pen all work, and let up-and-down scrolling still pass through. Offer an undo, and a button for people who cannot drag. If the visitor has reduced motion turned on, remove the row at once without sliding. Match the settings listed below.++**Settings** (the defaults in bold):++- Distance to delete: Short · **Medium** · Long+- Shows a Delete label: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Distance to delete: Medium, Shows a Delete label: on.++## Hamburger Menu Toggle++Three lines turn into an X as the menu opens. Best for mobile menus.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/hamburger-menu-toggle/+- How it runs: reacts to the visitor+- Good for: Mobile menus · Compact headers · Side panels+- Avoid on: Wide desktop menus++**Prompt**++Add a menu button whose three lines turn into an X to [the menu button in your header]. When it is pressed, the top and bottom lines move to the middle and turn to cross each other while the middle line fades away, and pressing it again reverses the change. Use the same three lines for both states, moving and turning them rather than swapping icons, and move each outer line exactly to the middle so the X meets at its center. Make it a real button that tells screen readers whether the menu is open. If the visitor has reduced motion turned on, switch between the two icons without movement. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Feel: **Gentle** · Springy · Smooth · Even+- Line thickness: Thin · **Medium** · Thick++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Feel: Gentle, Line thickness: Medium.++## Theme Toggle Morph++A sun turns into a moon as the colors switch to dark. Best for theme buttons.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/theme-toggle-morph/+- How it runs: reacts to the visitor+- Good for: Theme buttons · Settings · Headers+- Avoid on: Dense forms · Icons without labels++**Prompt**++Add a theme toggle whose icon turns from a sun into a moon to [the button that switches your site between light and dark]. When it is pressed, the sun's rays shrink into its center while a circle slides across the sun and cuts it into a crescent, so the sun becomes the moon instead of being swapped for another icon. Switch the page's colors at the same moment and at the same pace. Make it a real button whose label says what pressing it will do, and remember the visitor's choice for their next visit. If the visitor has reduced motion turned on, switch the icon and the colors without movement. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Feel: **Gentle** · Springy · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Feel: Gentle.++## Copy to Clipboard++Copy turns into a tick and Copied, then changes back. Best for codes and links.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/copy-to-clipboard/+- How it runs: reacts to the visitor+- Good for: Share links · Invite codes · Code blocks · API keys+- Avoid on: Slow actions · Important saves++**Prompt**++Add copy feedback to [the Copy button next to your code, link or key]. When the copy succeeds, turn the button's icon into a tick and its label into Copied!, with a brief flash of color, then change it back on its own after a moment so it is ready to use again. Stack both icons and both labels in the same place so the change never shifts the layout. Show the confirmation only once the copy has really worked, tell screen readers with a short status message, and say so if copying fails. If the visitor has reduced motion turned on, swap the icon and label without movement. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Time before it changes back: Short · **Medium** · Long+- Feel: **Springy** · Smooth · Even++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Time before it changes back: Medium, Feel: Springy.++## Star Rating++Stars fill up to your pointer and pop when you choose. Best for reviews.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/star-rating/+- How it runs: reacts to the visitor+- Good for: Reviews · Surveys · Feedback forms · Media ratings+- Avoid on: Precise scores++**Prompt**++Add a star rating to [the review or feedback form]. As the pointer moves along the row, fill the stars up to the one under it so the choice shows before it is made, and bring back the chosen rating when the pointer leaves. Clicking or tapping a star chooses that rating and makes the star pop: it grows briefly, dips a little below its size and settles. On touch screens, a finger dragged along the row previews too. Make the row one control that the arrow keys can change, and show the rating as a number as well, so it never depends on color alone. If the visitor has reduced motion turned on, fill the stars without the pop. Match the settings listed below.++**Settings** (the defaults in bold):++- Pop size: Small · **Medium** · Large+- Speed: Slow · **Normal** · Fast+- Allows half stars: on · **off**+- Number of stars: Three · **Five** · Ten++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Pop size: Medium, Speed: Normal, Allows half stars: off, Number of stars: Five.++## Toast Notification++Short messages slide into a corner, then leave on their own. Best for updates.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/toast-notification/+- How it runs: reacts to the visitor+- Good for: Save confirmations · Upload updates · Sync notices+- Avoid on: Errors that need action · Long messages++**Prompt**++Add toast notifications to [the actions in your app that should be confirmed quietly, such as saving]. Each toast comes into a corner of the screen with a short message and a thin bar that empties as it counts down, then leaves on its own. New toasts stack; when one leaves, the others glide over to close the gap, moved with transforms rather than by changing the layout. Pause the countdown while the pointer is over a toast, and let a tap, a sideways swipe or a close button dismiss it early. Announce each message to screen readers without moving focus. If the visitor has reduced motion turned on, show and hide toasts without movement. Match the settings listed below.++**Settings** (the defaults in bold):++- Corner: Top left · **Top right** · Bottom left · Bottom right+- How it comes in: **Slides** · Fades · Grows+- Time on screen: Short · **Medium** · Long+- Most at once: Two · Three · **Four**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Corner: Top right, How it comes in: Slides, Time on screen: Medium, Most at once: Four.++## Segmented Control++A highlight slides to the option you pick. Best for switching views.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/segmented-control/+- How it runs: reacts to the visitor+- Good for: View switchers · Filters · Date ranges+- Avoid on: Many options · Long labels++**Prompt**++Add a segmented control to [the row of options people switch between, such as Day, Week and Month]. Show the options side by side with one highlight behind the chosen one. When another option is chosen, slide the highlight over to it and stretch or shrink it to that option's width, while the labels' colors cross over as it lands. Measure the chosen option and move the highlight with transforms only, measuring again when fonts load or the window resizes. Make it one group of radio buttons that the arrow keys move through. If the visitor has reduced motion turned on, move the highlight without sliding. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Feel: **Springy** · Smooth · Even+- Highlight: **Pill** · Underline+- Number of options: Two · Three · **Four** · Five++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Feel: Springy, Highlight: Pill, Number of options: Four.++## Pull to Refresh++Pulling a list down shows a spinner, then new items. Best for feeds.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/pull-to-refresh/+- How it runs: reacts to the visitor+- Good for: Feeds · Inboxes · Notifications · Order lists+- Avoid on: Desktop-only pages · Lists that rarely change++**Prompt**++Add pull to refresh to [the scrolling list or feed that should reload]. When the list is already at its top and the visitor drags it down, move it with the finger but make it resist more the further it goes, and show a spinner above it that fades in and turns as it is pulled. Let go past the line and the list stays down while the spinner keeps turning and new items load, then everything slides back up with the new items on top; a shorter pull just springs back. Also offer a refresh button for people who cannot drag. If the visitor has reduced motion turned on, snap back without sliding. Match the settings listed below.++**Settings** (the defaults in bold):++- Pull distance: Short · **Medium** · Long+- Resistance: Low · **Medium** · High+- Spinner: **Ring** · Dots · Bars+- Refresh time: Short · **Medium** · Long++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Pull distance: Medium, Resistance: Medium, Spinner: Ring, Refresh time: Medium.++## Animated Gradient Border++A band of colors runs around the edge of a card or button. Best for featured offers.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/gradient-border/+- How it runs: moves by itself+- Good for: Featured plans · Main buttons · New features · Promo cards+- Avoid on: Every card on a page · Calm reading pages++**Prompt**++Add an animated gradient border to [the card or button you want to stand out]. Give it an edge where a band of colors keeps running around it; wherever the band does not reach, the edge stays a faint line. Build it from a square layer, twice as wide as the element, filled with a gradient that sweeps around its center, clipped to the element's rounded shape and covered by an inner box everywhere but the edge. Turn that layer and never animate the gradient itself, so the browser only rotates a finished picture. For a glow, put a blurred copy of the same layer behind it. If the visitor has reduced motion turned on, keep the border still. Match the settings listed below.++**Settings** (the defaults in bold):++- Colors: **Rainbow** · Sunset · Ocean+- Speed: Slow · **Normal** · Fast+- Soft glow: **on** · off+- Band length: Short · **Long** · All around+- Border width: Thin · **Medium** · Thick++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Colors: Rainbow, Speed: Normal, Soft glow: on, Band length: Long, Border width: Medium.++## Spotlight Hover Glow++A soft glow follows the pointer and lights card edges. Best for feature grids.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/spotlight-hover/+- How it runs: reacts to the visitor+- Good for: Feature grids · Pricing cards · Dashboards · Portfolios+- Avoid on: Light themes · Text-heavy pages++**Prompt**++Add a spotlight glow to [the grid of dark cards you want to light up]. As the pointer moves over the grid, a soft round light follows it across the cards and, when the settings include it, lights up the card edges closest to the pointer while the far edges stay dim. Give each card its own light, clipped to the card, and move it to the pointer with transforms only, so nothing is repainted while it moves. Fade the light in when the pointer arrives and out when it leaves. On touch screens, let a finger dragged across the cards move the light. If the visitor has reduced motion turned on, keep the light on the pointer with no glide. Match the settings listed below.++**Settings** (the defaults in bold):++- Glow size: Small · **Medium** · Large+- Color: White · Orange · Pink · **Purple** · Blue · Green+- Lights the edges: **on** · off+- Lag: None · **Short** · Long++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Glow size: Medium, Color: Purple, Lights the edges: on, Lag: Short.++## Add-to-Cart Fly++The product flies into the cart, which bumps and counts up. Best for shops.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/add-to-cart-fly/+- How it runs: reacts to the visitor+- Good for: Online shops · Product lists · Food ordering · Wish lists+- Avoid on: Bulk order forms · Quick reorder lists++**Prompt**++Add an add-to-cart animation to [the Add to cart buttons of your product list]. When one is pressed, copy that product's picture and fly the copy into the cart icon, shrinking it on the way, then remove it. Move it with transforms only: for a curved path, slide it sideways at an even pace while an inner layer rises and then drops into the cart; for a straight path, move both together. As it lands, raise the number on the cart and, when the settings include it, give the cart a small bump. Tell screen readers that the item was added. If the visitor has reduced motion turned on, fly nothing and fade the new number in. Match the settings listed below.++**Settings** (the defaults in bold):++- Flight speed: Slow · **Normal** · Fast+- Path: **Arc** · Straight+- Cart bumps: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Flight speed: Normal, Path: Arc, Cart bumps: on.++## Drag to Reorder++Drag an item and the others slide aside to make room. Best for to-do lists.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/drag-to-reorder/+- How it runs: reacts to the visitor+- Good for: To-do lists · Playlists · Priority rankings · Menu editors+- Avoid on: Lists sorted by date · Very long lists++**Prompt**++Add drag to reorder to [the list whose order people can change]. Lift the picked-up item and let it follow the pointer exactly; as it passes a neighbor's middle, slide that neighbor into the gap, and on release settle it into place and save the order. Shift the items rather than changing the layout, so it stays smooth. Support the keyboard: Space picks up, the arrow keys move, Space drops and Escape cancels, each step read out to screen readers. On touch screens, start a drag at once from the grip; if the rest of an item can start one too, only after a short press, so swipes still scroll. If the visitor has reduced motion turned on, move items straight to their places. Match the settings listed below.++**Settings** (the defaults in bold):++- Slide speed: Slow · **Normal** · Fast+- How much it lifts: **Subtle** · Strong+- Drags by the handle only: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Slide speed: Normal, How much it lifts: Subtle, Drags by the handle only: off.++## Rolling Numbers++Each digit rolls to its new value, like a mileage counter. Best for prices.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/rolling-numbers/+- How it runs: reacts to the visitor+- Good for: Counters · Prices · Scores · Dashboards+- Avoid on: Numbers that change every second · Long decimals++**Prompt**++Add rolling numbers to [the number that changes, such as a counter, score or price]. Show each digit in a small window over a column of the digits 0 to 9, and when the value changes, slide each column so its new digit rolls into view, like the wheels of a mileage counter; digits that stay the same do not move, and separators stay still. Give every digit the same width so the number never shifts sideways, and only slide the columns, never resize anything, so it stays smooth. Let screen readers hear the plain number once. If the visitor has reduced motion turned on, swap the digits with a short fade instead of rolling. Match the settings listed below.++**Settings** (the defaults in bold):++- Roll speed: Slow · **Normal** · Fast+- Direction: Up · Down · **Shortest**+- Digits one after another: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Roll speed: Normal, Direction: Shortest, Digits one after another: on.++## Typing Indicator++Three dots in a chat bubble move in turn while someone types. Best for chat apps.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/typing-indicator/+- How it runs: moves by itself+- Good for: Chat apps · Support chat · AI assistants · Comment threads+- Avoid on: Long waits · Replies that are not live++**Prompt**++Add a typing indicator to [the chat or comment thread where replies arrive]. While the other person is typing, show a small bubble on their side of the conversation with three dots that move one after another in a steady loop, so it reads as someone writing right now. Show it only while they are really typing, hide it after a few quiet seconds, and when their message arrives, put the message where the bubble was. Animate only the dots, never the bubble's size, so it stays smooth, and give screen readers a short text that says who is typing. If the visitor has reduced motion turned on, keep the dots in place and only let them brighten in turn. Match the settings listed below.++**Settings** (the defaults in bold):++- How the dots move: **Bounce** · Fade · Wave+- Speed: Slow · **Normal** · Fast+- Bubble color: **Gray** · Blue · Green · Purple++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: How the dots move: Bounce, Speed: Normal, Bubble color: Gray.++## Hold to Confirm++A button fills up while you hold it and acts only once it is full. Best for delete buttons.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/hold-to-confirm/+- How it runs: reacts to the visitor+- Good for: Delete buttons · Closing an account · Sending money · Emergency alerts+- Avoid on: Everyday actions · Actions with Undo++**Prompt**++Add hold to confirm to [the button for a risky action, such as Delete]. While the visitor holds it down, a fill grows steadily, and the action runs only once it is full, when a tick shows. If they let go early, the fill drains back, nothing happens and a short hint says to keep holding; when the settings ask for it, the button also shakes. Holding Space or Enter works the same way, and on touch a long press must not open the browser's menu. Grow the fill smoothly by the time held, not per frame, and announce the result to screen readers. If the visitor has reduced motion turned on, fill in a few steps without the shake. Match the settings listed below.++**Settings** (the defaults in bold):++- How long to hold: Short · **Medium** · Long+- Fill style: **Bar** · Ring+- Shakes if let go early: **on** · off+- How fast it drains: **Quickly** · Slowly++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: How long to hold: Medium, Fill style: Bar, Shakes if let go early: on, How fast it drains: Quickly.++## Expanding Search++A search icon opens into a field, then closes when done. Best for toolbars.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/expanding-search/+- How it runs: reacts to the visitor+- Good for: Toolbars · Mobile headers · Docs sites · Dashboards+- Avoid on: Sites where search comes first++**Prompt**++Add an expanding search to [the toolbar or header where search should sit]. Show only a search icon until it is pressed; then open a search field out of the icon, over the items beside it, and put the text cursor in it. Reveal the field with a clip or a scale from the icon's side, never by animating its width, so nothing around it moves. Escape or a close button closes it and gives the focus back to the icon, and a closed field stays out of the Tab order. Make the icon a real button with a label. If the visitor has reduced motion turned on, open and close it at once. Match the settings listed below.++**Settings** (the defaults in bold):++- Opens toward: **Left** · Right+- Speed: Slow · **Normal** · Fast+- Closes when you leave it: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Opens toward: Left, Speed: Normal, Closes when you leave it: on.++## Button Loading States++The button becomes a spinner, then a tick or a cross. Best for Save buttons.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/button-loading-states/+- How it runs: reacts to the visitor+- Good for: Save buttons · Contact forms · Checkout · Sign-up forms+- Avoid on: Instant actions · Long uploads++**Prompt**++Add loading states to [the button that sends a form or saves something]. When it is pressed, fade its label out, show a spinner in its place and ignore further presses until it is done. When the answer comes, swap the spinner for a tick, or for a cross with a short shake if it failed, then bring the label back after a moment. When the settings ask for it, shrink the button's colored shape into a circle around the spinner with a clip, never by animating its width, so nothing around it moves. Announce each change to screen readers. If the visitor has reduced motion turned on, keep the shape and change the label's words instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Result: **Success** · Error+- Speed: Slow · **Normal** · Fast+- Shrinks to a circle: **on** · off+- How long it loads: Short · **Medium** · Long++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Result: Success, Speed: Normal, Shrinks to a circle: on, How long it loads: Medium.++## Image Trail++Pictures pop up in a trail behind your pointer, then fade. Best for portfolios.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/image-trail/+- How it runs: reacts to the visitor+- Good for: Portfolio heroes · Photo galleries · Agency sites · Lookbooks+- Avoid on: Reading pages · Busy layouts++**Prompt**++Add an image trail to [the hero section the pointer moves over]. Each time the pointer has traveled a set distance, drop a picture at its tip, so a still pointer leaves none. Each new picture pops up on top of the others, gliding in from where the last one appeared, stays a while, then leaves and fades away. Reuse a small set of picture elements in turn, and move, scale and fade them with transforms and opacity only, so it stays smooth. On touch screens, let a finger dragged across the section leave the trail. If the visitor has reduced motion turned on, show one picture at a time where they point, fading in and out without moving. Match the settings listed below.++**Settings** (the defaults in bold):++- How often a picture appears: Often · **Normal** · Rarely+- How long they stay: Short · **Normal** · Long+- Picture size: Small · **Medium** · Large+- How they leave: **Shrink** · Fade · Fall+- Tilts the pictures: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: How often a picture appears: Normal, How long they stay: Normal, Picture size: Medium, How they leave: Shrink, Tilts the pictures: on.++## Gooey Menu++Small buttons ooze out of a round button like liquid. Best for quick actions.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/gooey-menu/+- How it runs: reacts to the visitor+- Good for: Quick actions · Share menus · Mobile apps · Playful brands+- Avoid on: Long menus · Formal sites++**Prompt**++Add a gooey menu to [the round action button on your page]. Pressing it lets smaller buttons ooze out like drops of liquid and pop into place; pressing again pulls them back in. Draw plain circles of one color on a layer under the icons and run that layer through a filter that blurs it, then sharpens the blurred edge again, so circles that touch melt together. Move them only with transforms, keep the filtered layer small and blur less on phones. Make every button a real button the keyboard can reach, tell screen readers whether the menu is open, and let Escape close it. If the visitor has reduced motion turned on, fade the buttons in place without the stretch. Match the settings listed below.++**Settings** (the defaults in bold):++- Layout: Row · **Arc** · Column+- How gooey: Low · **Medium** · High+- Speed: Slow · **Normal** · Fast+- Button color: **Orange** · Pink · Purple · Blue · Green++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Layout: Arc, How gooey: Medium, Speed: Normal, Button color: Orange.++## Dynamic Island++A black pill grows into a notification, then shrinks back. Best for live updates.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/dynamic-island/+- How it runs: reacts to the visitor+- Good for: Calls and timers · Music players · Order tracking · Live scores+- Avoid on: Long messages · Errors that need action++**Prompt**++Add a Dynamic Island style notification to [the top of your app or page]. At rest it is a small black pill; when [an event such as an incoming message] happens or the pill is pressed, it grows into a rounded card with the details, then shrinks back. Change the black shape with a clip or a scale, never by animating its width or height, so the text inside never stretches and nothing around it moves. Keep the details inside the shape, fading them in once it has room. Make the pill a real button for taps, clicks and the keyboard, and announce its message politely to screen readers. If the visitor has reduced motion turned on, crossfade the pill and the card instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Notification: **Call** · Timer · Music+- Speed: Slow · **Normal** · Fast+- Bounce: None · **Soft** · Springy++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Notification: Call, Speed: Normal, Bounce: Soft.diff --git a/skills/animation-handbook/references/05-text-typography.md b/skills/animation-handbook/references/05-text-typography.mdnew file mode 100644index 00000000..6b8915e1--- /dev/null+++ b/skills/animation-handbook/references/05-text-typography.md@@ -0,0 +1,490 @@+# 05 · Text & Typography++Animations specifically for type — kinetic motion, character-level effects, gradient flows, and word transformations. 19 animations from Animation Handbook, in the home page's order. Each entry gives the live demo, how it runs, what it is good for and what to avoid it on, the prompt from its page word for word, and its settings.++## Contents++- [Kinetic Typography](#kinetic-typography)+- [Typewriter Effect](#typewriter-effect)+- [Scramble / Glitch Text](#scramble--glitch-text)+- [Variable Font Morph](#variable-font-morph)+- [Text Clip-Path Reveal](#text-clip-path-reveal)+- [Marquee / Ticker](#marquee--ticker)+- [Text Morphing](#text-morphing)+- [Text Gradient Animation](#text-gradient-animation)+- [Outline to Fill](#outline-to-fill)+- [Enter/Exit Typography](#enterexit-typography)+- [Rotate Word Carousel](#rotate-word-carousel)+- [Glitch Text](#glitch-text)+- [Text on a Path](#text-on-a-path)+- [Wavy Text](#wavy-text)+- [Highlighter Sweep](#highlighter-sweep)+- [Split-Flap Board](#split-flap-board)+- [Neon Flicker](#neon-flicker)+- [Handwriting Draw](#handwriting-draw)+- [Text Particles](#text-particles)++## Kinetic Typography++Words arrive and leave one by one, each moving its own way. Best for intros.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/kinetic-typography/+- How it runs: plays once+- Good for: Intros · Splash screens · Story sections · Presentations+- Avoid on: Forms and menus · Long text++**Prompt**++Add a kinetic typography sequence to [the short phrases you want to show]. Show one phrase at a time and give each an entrance and an exit that fit its meaning: a heavy word can drop in large, a soft word can simply fade, a quick word can slide. Hold each phrase long enough to be read, and use size and color so the key words stand out. Leave the final phrase on screen when the sequence ends. Screen readers should hear each phrase as plain text. If the visitor has reduced motion turned on, show the phrases without movement. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal.++## Typewriter Effect++Text types itself out behind a blinking cursor. Best for short taglines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/typewriter-effect/+- How it runs: plays once+- Good for: Taglines · Chat messages · Terminal screens · Short intros+- Avoid on: Long text · Buttons and labels++**Prompt**++Add a typewriter effect to [your tagline or short text]. The text should appear one character at a time, as if someone is typing it, with a blinking cursor always just after the last character. Unless the settings turn it off, vary the time between keystrokes slightly so it feels typed by a person rather than a machine. When the settings include it, back up over the last word and type a new ending. Keep it to short text, because long text is slow to wait for. Screen readers should hear the full text once, not each character. If the visitor has reduced motion turned on, show the full text immediately. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Cursor shape: **Line** · Block · Underscore+- Deletes and retypes: on · **off**+- Types like a person: **on** · off+- Cursor color: **Pink** · White · Blue · Purple · Green · Orange+- Your text: text field, starts as "Typography is the art and craft of arranging type. Good type communicates before it decorates."++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Cursor shape: Line, Deletes and retypes: off, Types like a person: on, Cursor color: Pink, Your text: "Typography is the art and craft of arra…".++## Scramble / Glitch Text++Random symbols lock into the real text, left to right. Best for tech headlines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/scramble-text/+- How it runs: plays once+- Good for: Tech headlines · Loading screens · Game titles+- Avoid on: Long text · Calm brands++**Prompt**++Add a scramble effect to [your headline or short phrase]. Each letter should start as a random character and keep flickering through random characters until it locks into the real letter. Lock the letters in reading order, from left to right, so the text becomes readable bit by bit, as if it is being decoded. Capital letters scramble most cleanly. Screen readers should hear the final text once, never the random characters. If the visitor has reduced motion turned on, show the final text immediately. Match the settings listed below.++**Settings** (the defaults in bold):++- Random characters: Alphabet · **Symbols** · Numbers · Japanese · Mixed+- Delay between letters: Short · **Medium** · Long+- Flicker speed: Slow · **Normal** · Fast+- Your text: text field, starts as "DECODE THE MESSAGE"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Random characters: Symbols, Delay between letters: Medium, Flicker speed: Normal, Your text: "DECODE THE MESSAGE".++## Variable Font Morph++A word smoothly turns bold, then light, and leans over. Best for headlines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/variable-font-morph/+- How it runs: moves by itself+- Good for: Headlines · Logos · Loading text+- Avoid on: Body text · Small text++**Prompt**++Add a variable font morph to [your headline or word]. Use a variable font, which holds a whole range of weights in one file, and change the weight smoothly so the letters grow heavier and lighter as you watch, moving through a few styles in turn and resting briefly on each. When the settings include it, the word also leans over during some changes: a font with its own slant does this best, and a slight tilt works for fonts without one. Change the weight through the font itself, not by scaling, so the text stays sharp. If the visitor has reduced motion turned on, keep the word in one style. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Leans as it changes: **on** · off+- Your text: text field, starts as "Type"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Leans as it changes: on, Your text: "Type".++## Text Clip-Path Reveal++Each line of a headline is uncovered in turn. Best for big headlines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-clip-path-reveal/+- How it runs: plays once+- Good for: Headlines · Taglines · Portfolios+- Avoid on: Body text · Buttons and labels++**Prompt**++Add a line-by-line reveal to [your multi-line headline]. Lay out every line in its final place from the start, then uncover each line with a wipe that grows from one side until the whole line shows, starting each line a moment after the one above so the headline cascades in. Nothing moves or changes size; only the visible part of each line grows, so the letter spacing stays exactly as designed. A wipe that slows down as it finishes looks calmer than one that stops abruptly. The text must stay readable by screen readers the whole time. If the visitor has reduced motion turned on, show all the lines at once. Match the settings listed below.++**Settings** (the defaults in bold):++- Starts from: **Left** · Right · Top+- Speed: Slow · **Normal** · Fast+- Delay between lines: Short · **Medium** · Long+- Feel: **Smooth** · Gentle · Even+- Your lines: text box, starts with the lines "Good design", "Is honest" and "Always."++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Starts from: Left, Speed: Normal, Delay between lines: Medium, Feel: Smooth, Your lines: "Good design Is honest Always.".++## Marquee / Ticker++Text scrolls sideways in an endless loop, with no seam. Best for news tickers.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/marquee-ticker/+- How it runs: moves by itself+- Good for: News tickers · Brand strips · Client lists+- Avoid on: Important messages · Long sentences++**Prompt**++Add a marquee to [the text or items you want to scroll]. The text should scroll sideways in an endless loop with no visible jump: place two identical copies side by side, each at least as wide as the space it scrolls through, and move them by exactly one copy's width before starting over. Put a small mark between the repeats. Rows can run in opposite directions for a decorative band. Pointing at a row should stop it so people can read it, and a tap should do the same on touch screens. Screen readers should not announce the moving text again and again. If the visitor has reduced motion turned on, keep the text still. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Text size: Small · **Medium** · Large+- Space between items: Tight · **Medium** · Wide+- Separator: Dot · · Star ★ · Dash — · **Sparkle ✦**+- Your text: text field, starts as "Animation Handbook"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Text size: Medium, Space between items: Medium, Separator: Sparkle ✦, Your text: "Animation Handbook".++## Text Morphing++One word changes into the next, letter by letter. Best for short labels.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-morphing/+- How it runs: moves by itself+- Good for: Short labels · Status words · Hero headlines+- Avoid on: Long words · Sentences++**Prompt**++Add a letter-by-letter morph to [the word that should change, and the words it cycles through]. Split each word into letters. To change words, slide the current letters out of sight in one direction, then slide the next word's letters in from the opposite side; a small delay between letters, when the settings include one, sends the change across the word like a wave. Hold each word long enough to read, then morph to the next and repeat the list. Words of similar length look cleanest. Screen readers should hear each new word once, not its letters. If the visitor has reduced motion turned on, swap the words without movement. Match the settings listed below.++**Settings** (the defaults in bold):++- Slide direction: **Up** · Down · Left · Right+- Delay between letters: **None** · Short · Long+- Speed: Slow · **Normal** · Fast+- Time on each word: Short · **Medium** · Long+- Your words, one per line: text box, starts with the lines "OCEAN", "RIVER", "STORM", "LIGHT" and "SOUND"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Slide direction: Up, Delay between letters: None, Speed: Normal, Time on each word: Medium, Your words, one per line: "OCEAN RIVER STORM LIGHT SOUND".++## Text Gradient Animation++Colors flow through the letters while the text stays still. Best for headlines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-gradient-animation/+- How it runs: moves by itself+- Good for: Headlines · Logos · Hero titles+- Avoid on: Body text · Small text++**Prompt**++Add a flowing color gradient to [your headline or logo text]. Fill the letters with a gradient instead of a flat color: paint the gradient as the text's background, show it only inside the letter shapes, and make the text color itself see-through. Then keep moving the gradient behind the letters, or turn it like a color wheel, so color flows through the word while the letters stay still. End the gradient with the color it starts with so the loop has no seam. Give the text a solid fallback color for browsers that cannot clip a background to text. If the visitor has reduced motion turned on, keep the gradient still. Match the settings listed below.++**Settings** (the defaults in bold):++- Gradient: **Flowing** · Spinning · Diagonal · Two colors+- Speed: Slow · **Normal** · Fast+- First color: Pink · White · **Blue** · Purple · Green · Orange (only with some choices of another setting)+- Second color: Pink · White · Blue · **Purple** · Green · Orange (only with some choices of another setting)+- Your text: text field, starts as "Flow"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Gradient: Flowing, Speed: Normal, Your text: "Flow".++## Outline to Fill++Hollow letters fill with color, as a wipe or a fade. Best for big headlines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/outline-to-fill/+- How it runs: plays once+- Good for: Big headlines · Logos · Posters · Section titles+- Avoid on: Small text · Body text++**Prompt**++Add an outline-to-fill effect to [your headline or logo word]. The text should start hollow, with only the outline of each letter showing, then fill with color. The fill can wipe in from one side, like paint, or fade in everywhere at once, like ink soaking through. Draw the outline and the filled text as two layers in exactly the same place so the letters never shift. Use large, heavy letters so there is enough inside each one to fill. The text must stay readable by screen readers. If the visitor has reduced motion turned on, show the filled text straight away. Match the settings listed below.++**Settings** (the defaults in bold):++- Fill direction: **Bottom up** · Top down · Left to right · Right to left · From the middle+- Speed: Slow · **Normal** · Fast+- Outline thickness: Thin · **Medium** · Thick+- Feel: Smooth · **Gentle** · Even+- Outline color: **Pink** · White · Blue · Purple · Green · Orange+- Fill color: **Pink** · White · Blue · Purple · Green · Orange+- Your text: text field, starts as "OUTLINE"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Fill direction: Bottom up, Speed: Normal, Outline thickness: Medium, Feel: Gentle, Outline color: Pink, Fill color: Pink, Your text: "OUTLINE".++## Enter/Exit Typography++Each phrase comes in, stays long enough to read, then leaves. Best for slogans.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/enter-exit-typography/+- How it runs: plays once+- Good for: Intros · Brand statements · Hero messages · Screens and signage+- Avoid on: Long sentences · Key information++**Prompt**++Add an enter-and-exit text sequence to [the short phrases you want to show]. Show one phrase at a time in the same place: each phrase comes in, holds still long enough to be read, then leaves before the next one arrives. Give each phrase its own way in and out, such as sliding, growing, blurring or wiping, and let each exit lead into the next entrance so the sequence feels connected. Leave the last phrase on screen when the sequence ends. Screen readers should hear each phrase as it appears. If the visitor has reduced motion turned on, swap the phrases without movement. Match the settings listed below.++**Settings** (the defaults in bold):++- Entrance speed: Slow · **Normal** · Fast+- Time on each phrase: Short · **Medium** · Long+- Exit speed: Slow · **Normal** · Fast++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Entrance speed: Normal, Time on each phrase: Medium, Exit speed: Normal.++## Rotate Word Carousel++One word in a sentence keeps swapping for the next. Best for hero headlines.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/rotate-word-carousel/+- How it runs: moves by itself+- Good for: Hero headlines · Taglines · Service lists+- Avoid on: Body text · Long word lists++**Prompt**++Add a rotating word to [your headline, with the word that should change]. Keep the rest of the sentence still and swap only that one word: the current word slides out of sight and the next one slides in from the opposite side, clipped by an invisible box so it seems to come from behind the text. Hold each word long enough to read, then move on, repeating the list forever. Words of similar length keep the sentence from jumping. Screen readers should hear each new word once. If the visitor has reduced motion turned on, swap the words without sliding. Match the settings listed below.++**Settings** (the defaults in bold):++- Slide direction: **Up** · Down · Left · Right+- Speed: Slow · **Normal** · Fast+- Time on each word: Short · **Medium** · Long+- Different color per word: **on** · off+- Your sentence: text field, starts as "We craft for"+- Your words, one per line: text box, starts with the lines "Designers", "Developers", "Humans", "Teams" and "Startups"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Slide direction: Up, Speed: Normal, Time on each word: Medium, Different color per word: on, Your sentence: "We craft for", Your words, one per line: "Designers Developers Humans Teams Start…".++## Glitch Text++Text tears into red and cyan strips like a broken signal. Best for bold titles.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/glitch-text/+- How it runs: moves by itself+- Good for: Bold titles · Music and games · Error pages+- Avoid on: Long text · Calm brands++**Prompt**++Add a glitch effect to [your headline or short word]. Place two copies of the text behind it, one tinted red and one tinted cyan, shifted to either side, and show only thin horizontal strips of each copy, changing which strips show so the colors seem to tear away from the letters like a broken video signal. Every so often, nudge the whole word sideways for a moment and reshuffle the strips so the pattern never repeats. Keep it below a few flickers per second and avoid full-screen flashes. If it only glitches on hover, a tap should start and stop it on touch screens. If the visitor has reduced motion turned on, keep the word still. Match the settings listed below.++**Settings** (the defaults in bold):++- Color split: Small · **Medium** · Large+- Speed: Slow · **Normal** · Fast+- Glitch strength: Mild · **Medium** · Strong+- Glitches only on hover: on · **off**+- Your text: text field, starts as "GLITCH"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Color split: Medium, Speed: Normal, Glitch strength: Medium, Glitches only on hover: off, Your text: "GLITCH".++## Text on a Path++Text travels along a wave, an arc or a circle. Best for badges and seals.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-on-path/+- How it runs: moves by itself+- Good for: Badges and seals · Playful titles · Decorations+- Avoid on: Long text · Key information++**Prompt**++Add text that travels along a curve to [your short phrase]. Define the curve once and attach the text to it so every letter sits on the line, then keep moving the point where the text starts so the letters travel along the curve like a ticker bent into shape. Repeat the phrase, with a separator such as a dot, until it covers the whole curve, and wrap around by exactly one copy so the loop has no jump. Keep the curve gentle enough that letters do not crowd on sharp bends. If the visitor has reduced motion turned on, show the text still on the curve. Match the settings listed below.++**Settings** (the defaults in bold):++- Path shape: **Wave** · Arc · Circle+- Speed: Slow · **Normal** · Fast+- Shows the path: **on** · off+- Your text: text field, starts as "FOLLOW THE CURVE ·"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Path shape: Wave, Speed: Normal, Shows the path: on, Your text: "FOLLOW THE CURVE ·".++## Wavy Text++A wave rolls through the word, letter by letter. Best for playful titles.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/wavy-text/+- How it runs: moves by itself+- Good for: Playful titles · Games and kids' sites · Loading text+- Avoid on: Serious content · Long text++**Prompt**++Add a wavy text effect to [your word or short title]. Split the text into letters and make every letter bob up and down with the same smooth motion, but start each letter a moment after the one before it, so the high point of the wave rolls from the first letter to the last and around again. Keep the letters on one line, and move them only up and down, never changing their size or spacing. Screen readers should read the word once, not letter by letter. If the visitor has reduced motion turned on, keep the letters still. Match the settings listed below.++**Settings** (the defaults in bold):++- Wave height: Low · **Medium** · High+- Speed: Slow · **Normal** · Fast+- Delay between letters: Short · **Medium** · Long+- Your text: text field, starts as "Wavy"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Wave height: Medium, Speed: Normal, Delay between letters: Medium, Your text: "Wavy".++## Highlighter Sweep++A marker sweeps in behind the key words, one after another. Best for key points.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/highlighter-sweep/+- How it runs: plays once+- Good for: Key points · Quotes · Headlines · Study notes+- Avoid on: Long paragraphs · Too many words++**Prompt**++Add a highlighter sweep to [the key words in your paragraph or quote]. Behind each key phrase, a band of marker color grows from left to right, as if drawn with a highlighter pen, and the phrases are marked one after another in reading order. Draw the band behind the text, never over it, and grow it by scaling it from its left edge, so the words never move or reflow. When a phrase wraps onto a second line, sweep each line in turn, as one continuous stroke. Keep the words dark enough to read on the marker color. If the visitor has reduced motion turned on, fade the highlights in instead of sweeping them. Match the settings listed below.++**Settings** (the defaults in bold):++- Marker color: **Yellow** · Pink · Green · Blue · Orange+- Speed: Slow · **Normal** · Fast+- How much it covers: **Whole words** · Lower half++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Marker color: Yellow, Speed: Normal, How much it covers: Whole words.++## Split-Flap Board++Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/split-flap-board/+- How it runs: plays once+- Good for: Hero titles · Travel sites · Event intros · Retro designs+- Avoid on: Long text · Calm pages++**Prompt**++Add a split-flap board to [your headline or short word]. Show each letter on its own tile, split across the middle like an old airport departures board. To change a tile, flip it through the alphabet one letter at a time until it reaches its letter: the top half of the old letter falls forward over the hinge, turning in 3D and darkening as it turns, and the bottom half of the next letter swings down into place. Start the tiles a moment apart from left to right, so they settle one by one. Turn the halves with transforms only, and let screen readers hear the final word once. If the visitor has reduced motion turned on, fade the letters in instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Word: text field, starts as "BOARDING"+- Flip speed: Slow · **Normal** · Fast+- Tile color: **Black** · Blue · Red · Green · Cream++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Word: "BOARDING", Flip speed: Normal, Tile color: Black.++## Neon Flicker++Glowing letters sputter now and then, like a worn neon sign. Best for night themes.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/neon-flicker/+- How it runs: moves by itself+- Good for: Signs and logos · Night and bar themes · Music and events · Retro sites+- Avoid on: Long text · Calm, serious pages++**Prompt**++Add a neon sign effect to [your sign word or short title]. Draw the letters as bright tubes with a soft colored glow, a faint wash of the same color on the wall behind, and a dim, unlit copy of the letters underneath. Now and then, make the light stutter: drop it to almost nothing and back a few times, at uneven moments so it never looks like a loop. When the settings include it, let one letter buzz and go dark on its own. Flicker the lit layers by changing their opacity alone, in sharp steps; draw the glow once and never animate it. Keep it below three flashes a second. If the visitor has reduced motion turned on, keep the glow steady. Match the settings listed below.++**Settings** (the defaults in bold):++- Color: **Pink** · Blue · Green · Amber · Purple+- How often it flickers: Calm · **Normal** · Busy+- Broken letter: **on** · off+- Glow size: Small · **Medium** · Large+- Frame around the word: **on** · off+- Your text: text field, starts as "OPEN"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Color: Pink, How often it flickers: Normal, Broken letter: on, Glow size: Medium, Frame around the word: on, Your text: "OPEN".++## Handwriting Draw++A word writes itself stroke by stroke, as if by a pen. Best for greetings and signatures.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/handwriting-draw/+- How it runs: plays once+- Good for: Greetings and thank-you notes · Signatures · Page intros · Invitations+- Avoid on: Long text · Small text++**Prompt**++Add a handwriting animation to [your word or signature, drawn as single SVG lines]. Write it with pen lines instead of filled letters, split into strokes in the order a person writes them: the joined letters first, then the dots on the i's and the crosses on the t's. Hide each stroke behind a dash as long as itself and slide the dash away, one stroke after another, at one steady pen speed, so longer strokes take longer, with a short pause where the pen lifts. When the settings include it, let a small pen ride on the tip of the line. Screen readers should get the word as text. If the visitor has reduced motion turned on, fade the finished word in instead. Match the settings listed below.++**Settings** (the defaults in bold):++- Word: **hello** · thanks · hi there+- Pen speed: Slow · **Normal** · Fast+- Ink color: **Blue** · Black · Red · Green+- Pen size: Fine · **Medium** · Bold+- Shows the pen: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Word: hello, Pen speed: Normal, Ink color: Blue, Pen size: Medium, Shows the pen: on.++## Text Particles++A word of dots scatters from your pointer and springs back. Best for intros.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-particles/+- How it runs: reacts to the visitor+- Good for: Hero titles · Page intros · Portfolios · Launch pages+- Avoid on: Long text · Small text++**Prompt**++Add a text particle effect to [the word or short title you want to animate]. Sample the word's pixels from a hidden canvas on an even grid, placing a dot wherever a letter covers it. Push the dots near the pointer away, so they glow as they fly, and tie each to its home with a spring, so it flies back with a slight wobble once the pointer moves on. Run one frame loop that moves by elapsed time, stop it once every dot is home, and draw fewer dots on phones. On touch screens, a dragged finger pushes the dots the same way. With reduced motion turned on, keep the dots still and only light up those near the pointer. Match the settings listed below.++**Settings** (the defaults in bold):++- Dot size: Small · **Medium** · Large+- How far they scatter: Short · **Medium** · Far+- Colors: **Sunset** · Cool · Rainbow · White+- How fast they come back: Slow · **Normal** · Fast+- Your text: text field, starts as "HELLO"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Dot size: Medium, How far they scatter: Medium, Colors: Sunset, How fast they come back: Normal, Your text: "HELLO".diff --git a/skills/animation-handbook/references/06-3d-advanced.md b/skills/animation-handbook/references/06-3d-advanced.mdnew file mode 100644index 00000000..bf4445e9--- /dev/null+++ b/skills/animation-handbook/references/06-3d-advanced.md@@ -0,0 +1,677 @@+# 06 · 3D & Advanced++WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects. 26 animations from Animation Handbook, in the home page's order. Each entry gives the live demo, how it runs, what it is good for and what to avoid it on, the prompt from its page word for word, and its settings.++## Contents++- [3D Model Orbit](#3d-model-orbit)+- [Scroll-Driven 3D Rotation](#scroll-driven-3d-rotation)+- [Parallax 3D Tilt](#parallax-3d-tilt)+- [Canvas Particle Effect](#canvas-particle-effect)+- [Fluid / Liquid Simulation](#fluid--liquid-simulation)+- [Glassmorphism Animated](#glassmorphism-animated)+- [WebGL Shader Animation](#webgl-shader-animation)+- [Noise-Based Motion](#noise-based-motion)+- [SVG Path Animation](#svg-path-animation)+- [Chromatic Aberration](#chromatic-aberration)+- [2.5D / Pseudo-3D](#25d--pseudo-3d)+- [Ray Marching / SDF Scene](#ray-marching--sdf-scene)+- [GPGPU Particle System](#gpgpu-particle-system)+- [Image Distortion on Hover](#image-distortion-on-hover)+- [Cloth / Soft-Body Simulation](#cloth--soft-body-simulation)+- [Volumetric Smoke / 3D Noise](#volumetric-smoke--3d-noise)+- [Morphing Blob](#morphing-blob)+- [3D Flip Card](#3d-flip-card)+- [3D Carousel](#3d-carousel)+- [Depth-Map Photo](#depth-map-photo)+- [Flocking](#flocking)+- [ASCII / Halftone](#ascii--halftone)+- [2D Physics](#2d-physics)+- [Liquid Glass](#liquid-glass)+- [Holographic Card](#holographic-card)+- [Infinite Zoom](#infinite-zoom)++## 3D Model Orbit++A lit 3D shape spins, or turns to face your pointer. Best for product views.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/3d-model-orbit/+- How it runs: moves by itself+- Good for: Product showcases · Hero sections · Logos · 3D previews+- Avoid on: Long reading pages · Low-power devices++**Prompt**++Add a spinning 3D object to [the product or shape you want to show]. Draw it with WebGL: store the shape as triangles and light every point with a soft base light, a direct light and a shiny highlight, so it reads as solid. Turn it around its own axis so every side comes into view, or let it turn to face the pointer, which a tap or a sideways drag should also do on touch screens. Change its size by moving the camera closer or further, not by changing the lens. If the visitor has reduced motion turned on, show the object still. Match the settings listed below.++**Settings** (the defaults in bold):++- Shape: **Cube** · Sphere · Ring · Pyramid+- Movement: **Spins** · Follows the pointer+- Speed: Slow · **Normal** · Fast+- Tumbles as it spins: **on** · off+- Distance: Close · **Medium** · Far+- Color: Pink · White · **Blue** · Purple · Green · Orange+- Edges only: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Shape: Cube, Movement: Spins, Speed: Normal, Tumbles as it spins: on, Distance: Medium, Color: Blue, Edges only: off.++## Scroll-Driven 3D Rotation++Scrolling turns a 3D cube from pose to pose. Best for product tours.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/scroll-driven-3d-rotation/+- How it runs: follows the scroll+- Good for: Product tours · Device launches · Landing pages · Storytelling sections+- Avoid on: Short pages · Forms and dashboards++**Prompt**++Add a scroll-driven 3D rotation to [the product or object you want to show]. Pin the object in view while the visitor scrolls through a tall section, and turn the scroll position, from the top of the section to its end, into a series of poses: turned to one side, tilted forward, larger, then turned round to show its back. Blend smoothly between neighboring poses so scrolling back plays it in reverse, and when the settings include it, let the object glide to catch up instead of jumping with the scroll. If the visitor has reduced motion turned on, follow the scroll exactly, with no gliding. Match the settings listed below.++**Settings** (the defaults in bold):++- Turn amount: Less · **Normal** · More+- Smooth follow: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Turn amount: Normal, Smooth follow: on.++## Parallax 3D Tilt++A card tilts toward your pointer, and a light slides over it. Best for cards.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/parallax-3d-tilt/+- How it runs: reacts to the visitor+- Good for: Feature cards · Pricing cards · Portfolio tiles · Game cards+- Avoid on: Text-heavy cards · Dense grids++**Prompt**++Add a 3D tilt to [the card you want to bring to life]. As the pointer moves over the card, rotate the card slightly around its horizontal and vertical axes according to where the pointer is, and give its container a 3D perspective so the tilt has depth. When the settings include it, move a soft light across the card with the pointer, as if it catches the light. On touch screens, dragging a finger across the card should tilt it the same way. When the pointer leaves, let the card settle back flat. If the visitor has reduced motion turned on, keep the card flat. Match the settings listed below.++**Settings** (the defaults in bold):++- Tilt amount: Small · **Medium** · Large+- 3D depth: Subtle · **Medium** · Strong+- Shine: **on** · off+- Return speed: Slow · **Normal** · Fast+- Tilts away from the pointer: on · **off**+- Grows a little: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Tilt amount: Medium, 3D depth: Medium, Shine: on, Return speed: Normal, Tilts away from the pointer: off, Grows a little: on.++## Canvas Particle Effect++Dots drift, link up when close, and dodge your pointer. Best for tech sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/canvas-particle-effect/+- How it runs: moves by itself+- Good for: Hero sections · Tech sites · Loading screens · Dark backgrounds+- Avoid on: Long reading pages · Busy layouts++**Prompt**++Add a particle background to [the section you want it behind]. Draw small dots on a canvas, give each its own direction, and bounce them off the edges. When the settings include lines, join any two dots that come close with a thin line that fades as they move apart, so a network keeps forming and breaking. Dots near the pointer, or a finger on touch screens, can be pushed away or pulled in. Checking every pair of dots gets slow quickly, so draw far fewer dots on phones and tablets, and stroke the lines in a few batches rather than one at a time. If the visitor has reduced motion turned on, show the dots still. Match the settings listed below.++**Settings** (the defaults in bold):++- Pointer effect: **Push** · Pull · None+- Number of particles: Few · **Medium** · Many+- Link distance: None · Short · **Medium** · Long+- Speed: Slow · **Normal** · Fast+- Color: Pink · White · **Blue** · Purple · Green · Orange+- Trails: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Pointer effect: Push, Number of particles: Medium, Link distance: Medium, Speed: Normal, Color: Blue, Trails: off.++## Fluid / Liquid Simulation++Blobs drift and melt into each other like liquid. Best for hero backgrounds.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/fluid-simulation/+- How it runs: moves by itself+- Good for: Hero backgrounds · Wellness brands · Creative studios · Splash screens+- Avoid on: Behind text · Small elements++**Prompt**++Add liquid blobs to [the section you want them in]. In a WebGL fragment shader, work out for every pixel its distance to each of a few moving circles, and blend those distances with a smooth minimum so circles that come close melt into one shape with soft necks between them, like drops of mercury. Move the circles on looping paths so they keep merging and separating; one can follow the pointer or a finger. Every pixel is checked against every circle, so draw fewer pixels on phones. If the visitor has reduced motion turned on, show the blobs still. Match the settings listed below.++**Settings** (the defaults in bold):++- Melting: A little · **Medium** · A lot+- Number of blobs: Few · **Medium** · Many+- Speed: Slow · **Normal** · Fast+- Blob size: Small · **Medium** · Large+- Color: Pink · White · **Blue** · Purple · Green · Orange+- Glow: **on** · off+- One blob follows the pointer: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Melting: Medium, Number of blobs: Medium, Speed: Normal, Blob size: Medium, Color: Blue, Glow: on, One blob follows the pointer: on.++## Glassmorphism Animated++Frosted glass cards blur the colors behind them. Best for cards and panels.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/glassmorphism-animated/+- How it runs: moves by itself+- Good for: Cards and panels · Dashboards · Modals · Navigation bars+- Avoid on: Plain backgrounds · Large surfaces++**Prompt**++Add frosted glass to [the cards or panels you want to style]. Give each card a see-through tinted background, blur whatever sits behind it, and add a thin light edge. Put colorful shapes that drift slowly behind the cards, with a faint pattern of dots over them, because glass over plain color looks gray and shows no frost. Put a see-through dark layer inside each card under its text so the words stay readable. A card can also breathe, its blur growing and fading, or slowly change its tint. Blurring costs a lot, so keep the glass to small cards and blur the shapes less on phones. If the visitor has reduced motion turned on, keep everything still. Match the settings listed below.++**Settings** (the defaults in bold):++- Frost: Off · Light · **Medium** · Heavy+- Tint strength: Faint · **Medium** · Strong+- Speed: Slow · **Normal** · Fast+- Tint color: Pink · White · **Blue** · Purple · Green · Orange+- Breathing frost: **on** · off+- Shifting tint: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Frost: Medium, Tint strength: Medium, Speed: Normal, Tint color: Blue, Breathing frost: on, Shifting tint: on.++## WebGL Shader Animation++Moving color patterns computed for every pixel. Best for bold backgrounds.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/webgl-shader-animation/+- How it runs: moves by itself+- Good for: Hero backgrounds · Music and events · Loading screens · Art pages+- Avoid on: Behind text · Low-power devices++**Prompt**++Add a moving shader pattern to [the background or section you want it in]. Cover the area with one WebGL surface and write a fragment shader that works out the color of every pixel from its position and the time, so the whole pattern moves as the time runs on: flowing plasma, rippling waves, cells or a kaleidoscope. When the settings include it, let the pointer, or a finger on touch screens, bend the pattern near it. Draw fewer pixels on phones, and show a clear message where WebGL is not available. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Pattern: **Plasma** · Waves · Cells · Kaleidoscope+- Speed: Slow · **Normal** · Fast+- Reacts to the pointer: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Pattern: Plasma, Speed: Normal, Reacts to the pointer: off.++## Noise-Based Motion++Smooth noise makes dots sway and a blob ripple. Best for calm backgrounds.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/noise-based-motion/+- How it runs: moves by itself+- Good for: Backgrounds · Generative art · Idle and loading states+- Avoid on: Behind text · Fast-paced screens++**Prompt**++Add noise-based motion to [the background or shape you want to bring to life]. Use smooth noise, a random value that changes gradually from place to place, instead of plain random numbers, which jump. For a field of dots, turn the noise at each dot into a direction and nudge the dot that way, then move through the noise over time so the whole field sways like grass in the wind. For a blob, push each point of its outline in or out by the noise so the edge ripples. Space the dots by distance, not by count, so phones draw fewer. If the visitor has reduced motion turned on, keep everything still. Match the settings listed below.++**Settings** (the defaults in bold):++- Shape: **Field of dots** · Blob+- Pattern size: Large · **Medium** · Small+- Speed: Slow · **Normal** · Fast+- Wobble: Small · **Medium** · Large+- Space between dots: Wide · **Medium** · Tight+- Color: Pink · White · **Blue** · Purple · Green · Orange++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Shape: Field of dots, Pattern size: Medium, Speed: Normal, Wobble: Medium, Space between dots: Medium, Color: Blue.++## SVG Path Animation++A line drawing draws itself, stroke by stroke. Best for icons and logos.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/svg-path-animation/+- How it runs: plays once+- Good for: Icons · Logos · Signatures · Illustrations+- Avoid on: Photos · Body text++**Prompt**++Add a self-drawing line to [your icon, logo or signature, drawn as SVG lines]. Measure the length of each line, hide it behind a dash exactly as long as the line, then slide the dash away so the line appears from one end to the other, as if drawn by hand. Draw several lines one after another, each starting a little after the one before. When the settings include it, fill the shapes once the lines are done. The finished drawing should be there for screen readers from the start. If the visitor has reduced motion turned on, show the drawing complete. Match the settings listed below.++**Settings** (the defaults in bold):++- Drawing: **Icon** · Signature · Logo+- Speed: Slow · **Normal** · Fast+- Line thickness: Thin · **Medium** · Thick+- Feel: **Smooth** · Gentle · Even+- Line color: Pink · White · **Blue** · Purple · Green · Orange+- Starts from the other end: on · **off**+- Fills in at the end: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Drawing: Icon, Speed: Normal, Line thickness: Medium, Feel: Smooth, Line color: Blue, Starts from the other end: off, Fills in at the end: off.++## Chromatic Aberration++A word splits into red, green and blue fringes. Best for bold titles.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/chromatic-aberration/+- How it runs: moves by itself+- Good for: Bold titles · Music and games · Error pages+- Avoid on: Body text · Light backgrounds++**Prompt**++Add a chromatic aberration effect to [your headline or short word]. Stack three copies of the text in pure red, green and blue, blend them so that where they overlap they add up to white, and shift the red and blue copies in opposite directions so colored fringes appear at the letters' edges, like a cheap camera lens. The split can breathe in and out, or jump now and then like a glitch. It only works on a dark background. Screen readers should read the text once, not three times. If the visitor has reduced motion turned on, keep the copies still. Match the settings listed below.++**Settings** (the defaults in bold):++- Movement: **Pulse** · Glitch · None+- Color split: Small · **Medium** · Large+- Direction: Sideways · **Slanted** · Up and down+- Soft color edges: on · **off**+- Your text: text field, starts as "PRISM"++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Movement: Pulse, Color split: Medium, Direction: Slanted, Soft color edges: off, Your text: "PRISM".++## 2.5D / Pseudo-3D++Flat layers slide by different amounts, faking depth. Best for hero scenes.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/2-5d-pseudo-3d/+- How it runs: reacts to the visitor+- Good for: Hero scenes · Illustrations · Game sites · Landing pages+- Avoid on: Photos · Content-heavy pages++**Prompt**++Add a 2.5D parallax scene to [the illustration or hero you want to give depth]. Split the picture into flat layers, from a far sky to the near ground, and when the pointer moves, shift every layer the opposite way by an amount that grows with how near it is: the sky barely moves and the ground moves the most, so the flat picture seems deep. Make each layer a little wider than the frame so no edge shows. On touch screens, dragging a finger should move the scene the same way. If the visitor has reduced motion turned on, keep the layers still. Match the settings listed below.++**Settings** (the defaults in bold):++- Camera movement: Small · **Medium** · Large+- Layer labels: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Camera movement: Medium, Layer labels: off.++## Ray Marching / SDF Scene++A 3D scene drawn only from formulas, circled by a camera. Best for art pages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/ray-marching-sdf/+- How it runs: moves by itself+- Good for: Art pages · Hero visuals · Tech demos+- Avoid on: Behind text · Low-power devices++**Prompt**++Add a ray-marched 3D scene to [the section you want it in]. Draw the whole scene in a fragment shader, with no 3D models: describe each shape as a formula that gives the distance to its surface, then for every pixel step a ray forward by that distance until it touches a surface, and light that point. Formulas let shapes melt together, be carved out of each other or repeat without end, while a camera circles them. Every pixel does a lot of work, so draw fewer pixels and take fewer steps on phones. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Scene: **Blend** · Cut-out · Endless+- Camera speed: Slow · **Normal** · Fast+- Soft shadows: on · **off**+- Corner shading: **on** · off+- Detail: Low · **Medium** · High+- Step count view: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Scene: Blend, Camera speed: Normal, Soft shadows: off, Corner shading: on, Detail: Medium, Step count view: off.++## GPGPU Particle System++Tens of thousands of particles flow on the graphics chip. Best for hero effects.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/gpgpu-particle-system/+- How it runs: moves by itself+- Good for: Hero effects · Data art · Launch pages+- Avoid on: Behind text · Low-power devices++**Prompt**++Add a GPU particle system to [the section you want it in]. Keep every particle's position and speed in a floating-point texture, one pixel per particle, and move them all at once in a shader that reads one texture and writes the other, swapping them after each pass, one pass per 60th of a second so it runs at the same speed on every screen. Then draw each particle as a tiny point, following a flowing field, a swirl, a pull to the middle or an orbit. That keeps tens of thousands of particles smooth. Start with far fewer on phones, and show a clear message where WebGL 2 is missing. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Movement: **Flow** · Swirl · Attract · Orbit+- Number of particles: 16,000 · **65,000** · 100,000 (phones start with 16,000)+- Speed: Slow · **Normal** · Fast+- Color: **One color** · By speed · Shifting+- Trails: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Movement: Flow, Number of particles: 65,000, Speed: Normal, Color: One color, Trails: off.++## Image Distortion on Hover++The picture ripples and bends around your pointer. Best for portfolio images.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/image-distortion-hover/+- How it runs: reacts to the visitor+- Good for: Portfolio images · Gallery tiles · Hero images · Product photos+- Avoid on: Small thumbnails · Images with text++**Prompt**++Add a hover distortion to [the image you want to react]. Draw the image with a WebGL shader and, in a circle around the pointer, read each pixel from a slightly shifted spot, so the picture seems to ripple, bulge, swirl like liquid or break into squares there while the image itself never changes. The bending fades out smoothly after the pointer leaves. On touch screens, dragging a finger across the image should do the same. If the visitor has reduced motion turned on, keep the image still. Match the settings listed below.++**Settings** (the defaults in bold):++- Effect: **Ripple** · Push · Liquid · Pixels+- Strength: Gentle · **Medium** · Strong+- Size: Small · **Medium** · Large+- Fade-out speed: Slow · **Normal** · Fast+- Moving ripples: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Effect: Ripple, Strength: Medium, Size: Medium, Fade-out speed: Normal, Moving ripples: on.++## Cloth / Soft-Body Simulation++A cloth sways in the wind, and you can drag it around. Best for playful pages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/cloth-simulation/+- How it runs: moves by itself+- Good for: Flags and banners · Playful pages · Fashion and textiles+- Avoid on: Behind text · Serious content++**Prompt**++Add a cloth simulation to [the flag, banner or fabric you want to show]. Model the cloth as a grid of points joined to their neighbors by links of fixed length. In fixed 1/60 s steps, as many as the time since the last frame needs, move every point by its own momentum plus gravity and wind, then pull linked points back toward their proper distance a few times over, so the cloth moves at the same speed on every screen. Pin some points so the cloth hangs, and let the visitor grab and drag the nearest point with the pointer or a finger. Use a coarser grid on phones. If the visitor has reduced motion turned on, show the cloth hanging still. Match the settings listed below.++**Settings** (the defaults in bold):++- Hangs from: **Two corners** · Top edge · One corner · Nothing+- Wind: Light · **Medium** · Strong+- Stiffness: Stretchy · **Medium** · Stiff+- Gravity: Light · **Normal** · Heavy+- Detail: Low · **Medium** · High (phones start with Low)+- Shows the points: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Hangs from: Two corners, Wind: Medium, Stiffness: Medium, Gravity: Normal, Detail: Medium, Shows the points: off.++## Volumetric Smoke / 3D Noise++Soft smoke curls upward, drawn as a real 3D cloud. Best for moody backgrounds.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/volumetric-smoke/+- How it runs: moves by itself+- Good for: Moody backgrounds · Title cards · Games · Sci-fi themes+- Avoid on: Behind text · Low-power devices++**Prompt**++Add volumetric smoke to [the section you want it in]. In a fragment shader, send a ray through a 3D cloud of smooth noise for every pixel and add up how much smoke it passes through, shading each step by how much smoke lies between it and the light, so the plume looks soft, deep and lit from one side. Move the noise upward over time so the smoke rises and curls, and let it drift sideways when the settings include wind. It is costly, so draw fewer pixels and take fewer steps on phones. If the visitor has reduced motion turned on, show the smoke still. Match the settings listed below.++**Settings** (the defaults in bold):++- Thickness: Thin · **Medium** · Thick+- Speed: Slow · **Normal** · Fast+- Detail: Low · **Medium** · High+- Smoke color: **Gray blue** · White · Purple · Orange+- Wind: **on** · off+- Fine grain: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Thickness: Medium, Speed: Normal, Detail: Medium, Smoke color: Gray blue, Wind: on, Fine grain: on.++## Morphing Blob++Blobs melt together, and one drop chases your pointer. Best for hero sections.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/morphing-blob/+- How it runs: moves by itself+- Good for: Hero sections · Playful brands · Loading states · Cursor effects+- Avoid on: Serious content · Busy layouts++**Prompt**++Add a gooey blob to [the section you want it in]. Draw several plain circles that drift on looping paths, and run them through a filter that blurs them and then sharpens the blurred edge again, so circles that come close melt into one liquid shape and pull apart again. One drop follows the pointer, or a finger on touch screens, and merges with the rest when it comes near. Keep the blurred area small on phones. If the visitor has reduced motion turned on, show the blob still. Match the settings listed below.++**Settings** (the defaults in bold):++- Gooeyness: Low · **Medium** · High+- Number of blobs: Few · **Medium** · Many+- Speed: Slow · **Normal** · Fast++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Gooeyness: Medium, Number of blobs: Medium, Speed: Normal.++## 3D Flip Card++A card turns over in 3D to show its back. Best for profile and product cards.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/flip-card-3d/+- How it runs: reacts to the visitor+- Good for: Profile cards · Product cards · Flashcards · Quiz answers+- Avoid on: Long text · Key information++**Prompt**++Add a 3D flip to [the card you want to turn over]. Place the front and back faces in the same spot, turn the back face around so it faces away, and hide whichever face points away from the viewer. Clicking, tapping or pressing Enter turns the card over in 3D to show its back, and again to show its front. Give the card's container a 3D perspective so the turn has depth. When the settings include it, pointing at the card can flip it too, and the card can lean toward a hovering pointer. If the visitor has reduced motion turned on, swap the faces with a quick fade instead of turning. Match the settings listed below.++**Settings** (the defaults in bold):++- Flip direction: **Sideways** · Up and over+- Speed: Slow · **Normal** · Fast+- 3D depth: Subtle · **Medium** · Strong+- Flips on hover: on · **off**+- Tilt toward the pointer: Off · **Gentle** · Strong++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Flip direction: Sideways, Speed: Normal, 3D depth: Medium, Flips on hover: off, Tilt toward the pointer: Gentle.++## 3D Carousel++Cards stand in a ring that spins in 3D as you drag it. Best for image galleries.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/carousel-3d/+- How it runs: reacts to the visitor+- Good for: Image galleries · Product picks · Portfolios · Album covers+- Avoid on: Long lists · Text-heavy cards++**Prompt**++Add a 3D carousel to [the cards or pictures you want to show]. Stand the cards in a ring: turn each one by an equal share of a full circle, push it out from the middle by the same distance, and give the container a 3D perspective. Dragging sideways turns the whole ring with the pointer or finger; on release it keeps a little speed, then settles with the nearest card facing front. Previous and next buttons and the arrow keys turn it one card at a time. Change only the ring's rotation so it stays smooth. When the settings include it, the ring turns slowly by itself. If the visitor has reduced motion turned on, jump from card to card without turning. Match the settings listed below.++**Settings** (the defaults in bold):++- Number of cards: 6 · **8** · 12+- Seen from above: **on** · off+- Spins by itself: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Number of cards: 8, Seen from above: on, Spins by itself: off.++## Depth-Map Photo++A flat photo turns 3D as you point: near parts shift more. Best for hero images.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/depth-map-photo/+- How it runs: reacts to the visitor+- Good for: Hero images · Portfolio photos · Travel stories · Album art+- Avoid on: Photos with text · Small thumbnails++**Prompt**++Add a depth effect to [the photo you want to bring to life]. Make a grayscale depth map the same size as the photo, white for near parts and black for far ones, and blur it slightly. Draw the photo with a WebGL shader that reads each pixel from a spot shifted by the pointer's position times that pixel's depth, so near parts move more than far ones and the flat photo looks three-dimensional. Zoom in a little so the edges never show, and let the view glide toward the pointer and back to the middle when it leaves. On touch screens, dragging a finger should do the same. If the visitor has reduced motion turned on, keep the photo still. Match the settings listed below.++**Settings** (the defaults in bold):++- Depth strength: Subtle · **Medium** · Strong+- Shows the depth map: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Depth strength: Medium, Shows the depth map: off.++## Flocking++Birds swirl and turn together as one flock. Best for calm backgrounds.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/flocking/+- How it runs: moves by itself+- Good for: Hero sections · Nature and travel sites · Art and game pages · Dark backgrounds+- Avoid on: Long reading pages · Busy layouts++**Prompt**++Add a flock of birds to [the section you want it behind]. Draw each bird as a small arrowhead on a canvas, pointing the way it flies. Each bird sees only the birds near it and follows three rules: keep a little room from the closest ones, turn the way its neighbors fly, and drift toward their middle, so the flock swirls and turns as one. Turn birds back before they reach the edges, and move them by the time since the last frame so the speed is the same on every screen. Use fewer birds on phones. When the settings include it, birds swerve away from the pointer or a finger. If the visitor has reduced motion turned on, show the flock still. Match the settings listed below.++**Settings** (the defaults in bold):++- Flock size: Small · **Medium** · Large+- How close they fly: Loose · **Normal** · Tight+- Flees the pointer: **on** · off+- Speed: Slow · **Normal** · Fast+- Shows one bird's view: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Flock size: Medium, How close they fly: Normal, Flees the pointer: on, Speed: Normal, Shows one bird's view: off.++## ASCII / Halftone++A moving picture is redrawn with letters or dots. Best for retro and tech looks.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/ascii-halftone/+- How it runs: moves by itself+- Good for: Retro and tech sites · Music and game pages · Hero images · Portfolio headers+- Avoid on: Photos people must see clearly · Long reading pages++**Prompt**++Add an ASCII and halftone effect to [the picture or video you want to restyle]. Each frame, draw the picture onto a small hidden canvas with one pixel for every cell of a grid, and read back each pixel's brightness. On the visible canvas, draw a character in every cell, choosing characters with more ink for brighter cells, or draw a dot whose size grows with the brightness, like a printed photo. Color the marks with the picture's own colors or with one color. Copy the characters from a ready-made sheet instead of drawing each character separately every frame, so it stays smooth, and use bigger cells on phones. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Drawn with: **Letters** · Dots+- Cell size: Small · **Medium** · Large+- Colors: **One color** · Full color+- Shows the original picture: on · **off**+- Light paper: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Drawn with: Letters, Cell size: Medium, Colors: One color, Shows the original picture: off, Light paper: off.++## 2D Physics++Balls drop where you click, bounce and pile up. Best for playful intros.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/physics-2d/+- How it runs: reacts to the visitor+- Good for: Playful intros · Empty states · Games and toys · Kids' and learning sites+- Avoid on: Forms and checkout · Serious content++**Prompt**++Add a box of bouncing balls to [the hero or empty area you want to liven up]. A click or tap drops a ball there; it falls, bounces off the walls and each other, and comes to rest in a pile. Dragging a ball with the pointer or a finger picks it up, and letting go throws it at the speed of the drag. Run the physics in fixed steps, as many as the time since the last frame needs, so it behaves the same on every screen, and stop drawing once everything is still. Fade out the oldest ball when there are too many. If the visitor has reduced motion turned on, show each new ball already resting where it would land. Match the settings listed below.++**Settings** (the defaults in bold):++- Gravity: Moon · **Earth** · Heavy+- Bounciness: Low · **Medium** · High+- Ball sizes: **All the same** · Mixed+- Shows the speed: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Gravity: Earth, Bounciness: Medium, Ball sizes: All the same, Shows the speed: off.++## Liquid Glass++Drag a glass panel and the picture behind it bends at the edges. Best for cards.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/liquid-glass/+- How it runs: reacts to the visitor+- Good for: Floating menus · Cards over photos · Tab bars · Media controls+- Avoid on: Long text · Plain backgrounds++**Prompt**++Add a liquid glass panel to [the card or menu you want to float over a picture]. The panel shows what is behind it bent and magnified near its rounded edges, like thick curved glass, with a soft highlight along the rim. Bend it with an SVG displacement filter applied to what is behind the panel, which Chromium browsers support; other browsers get blurred, tinted glass with the same highlight. Dragging with the pointer or a finger moves it, and so do the arrow keys; it stretches a little as it moves and wobbles back when it stops. Use transforms only, so it stays smooth. If the visitor has reduced motion turned on, let it jump instead of gliding, with no stretch or wobble. Match the settings listed below.++**Settings** (the defaults in bold):++- How much it bends: Subtle · **Medium** · Strong+- Frost: **Clear** · Light · Frosted+- Tint: Pink · **White** · Blue · Purple · Green · Orange+- Shape: **Card** · Pill · Circle+- Shows the bend map: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: How much it bends: Medium, Frost: Clear, Tint: White, Shape: Card, Shows the bend map: off.++## Holographic Card++A card tilts as you point, and its rainbow foil shimmers. Best for collectibles.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/holographic-card/+- How it runs: reacts to the visitor+- Good for: Trading cards · Membership cards · Rewards and badges · Product launches+- Avoid on: Text-heavy cards · Dense grids++**Prompt**++Add a holographic foil to [the card you want to make shine]. Build the card from stacked layers: its picture, a rainbow sheet blended over it to light up the colors beneath, a spot of glare when the settings include one, and on top the text on solid panels so it stays readable. As the pointer moves over the card, tilt the card toward it in 3D, slide the foil with the tilt and keep any glare under the pointer. Ease each change, and move layers only by position and transparency so it stays smooth. On touch screens, dragging a finger does the same. If the visitor has reduced motion turned on, keep the card flat and the foil still, and only brighten it. Match the settings listed below.++**Settings** (the defaults in bold):++- Foil pattern: **Smooth** · Glitter · Lines+- How far it tilts: Gentle · **Medium** · Strong+- Glare: Off · **Soft** · Bright+- Shows the layers: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Foil pattern: Smooth, How far it tilts: Medium, Glare: Soft, Shows the layers: off.++## Infinite Zoom++The view keeps zooming into pictures inside pictures. Best for page intros.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/infinite-zoom/+- How it runs: moves by itself+- Good for: Page intros · Portfolios and galleries · Story and game sites · Music and art pages+- Avoid on: Long reading pages · Forms and checkout++**Prompt**++Add an infinite zoom to [the section you want it in]. Give each picture, such as [a painting, a screen or a photo], a frame in its middle, the same shape as the view, that holds a smaller copy of the next picture, so the pictures nest inside each other. Move the view steadily into or out of the middle, growing or shrinking every picture by the same factor each second so the speed feels even. Each time a picture exactly fills the view, draw it as the outermost one, so the loop never jumps. Draw only the pictures big enough to see, and keep them sharp at full size. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Number of scenes: 1 · 3 · **5**+- Direction: **In** · Out+- Shows the scene edges: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Number of scenes: 5, Direction: In, Shows the scene edges: off.diff --git a/skills/animation-handbook/references/07-ambient-background.md b/skills/animation-handbook/references/07-ambient-background.mdnew file mode 100644index 00000000..09f3356c--- /dev/null+++ b/skills/animation-handbook/references/07-ambient-background.md@@ -0,0 +1,611 @@+# 07 · Ambient & Background++Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows. 23 animations from Animation Handbook, in the home page's order. Each entry gives the live demo, how it runs, what it is good for and what to avoid it on, the prompt from its page word for word, and its settings.++## Contents++- [Animated Gradient Background](#animated-gradient-background)+- [Mesh Gradient Animation](#mesh-gradient-animation)+- [Aurora / Northern Lights](#aurora--northern-lights)+- [Grain / Film Noise Overlay](#grain--film-noise-overlay)+- [Scanline Effect](#scanline-effect)+- [Light Leak](#light-leak)+- [Starfield / Space Particles](#starfield--space-particles)+- [Breathing / Pulsing Glow](#breathing--pulsing-glow)+- [Ambient Ripple Effect](#ambient-ripple-effect)+- [Floating Elements](#floating-elements)+- [Grid / Dot Pattern Parallax](#grid--dot-pattern-parallax)+- [Abstract Geometric Motion](#abstract-geometric-motion)+- [Particle Constellation](#particle-constellation)+- [Flow Field](#flow-field)+- [Synthwave Grid](#synthwave-grid)+- [Matrix Rain](#matrix-rain)+- [Plasma Field](#plasma-field)+- [Wave Layers](#wave-layers)+- [Snow / Rain](#snow--rain)+- [Fireworks](#fireworks)+- [Topographic Lines](#topographic-lines)+- [Light Rays](#light-rays)+- [Game of Life](#game-of-life)++## Animated Gradient Background++Colors slowly drift across a soft gradient background. Best for hero sections.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/animated-gradient-background/+- How it runs: moves by itself+- Good for: Hero sections · Landing pages · Dashboards · Splash screens+- Avoid on: Long reading pages · Small elements++**Prompt**++Add an animated gradient background to [the section you want behind your content]. Paint a soft gradient much larger than the section and slowly slide it back and forth, or turn all its colors around the color wheel, so the colors keep shifting behind the content. End the gradient on the color it starts with, so the loop never shows a seam. A long, slow cycle feels calm; a fast one pulls attention away from the content. If the visitor has reduced motion turned on, show the gradient still. Match the settings listed below.++**Settings** (the defaults in bold):++- Gradient: **Sliding** · Color wheel · Bright bands+- Speed: Slow · **Normal** · Fast+- Colors: **Cool** · Sunset · Ocean · Gray+- Muted colors: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Gradient: Sliding, Speed: Normal, Colors: Cool, Muted colors: off.++## Mesh Gradient Animation++Blurred blobs of color drift and melt together. Best for landing pages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/mesh-gradient/+- How it runs: moves by itself+- Good for: Hero sections · Landing pages · App splash screens · Dark dashboards+- Avoid on: Small elements · Long reading pages++**Prompt**++Add a mesh gradient background to [the section you want behind your content]. Place a few large circles of color behind the content and blur them, so their edges soften and the colors run into one another. Let each circle drift and grow or shrink slowly on its own path, so the colors keep blending in new ways, and clip them to the section so they never spill out. Blur is costly on phones, so blur less on small screens. If the visitor has reduced motion turned on, keep the circles still. Match the settings listed below.++**Settings** (the defaults in bold):++- Blur: Light · **Medium** · Heavy+- Speed: Slow · **Normal** · Fast+- Colors: **Cool** · Warm · Sunset · Synthwave · Earth+- Number of blobs: 3 · **4** · 5+- Blend: **Plain** · Lighter · Deeper++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Blur: Medium, Speed: Normal, Colors: Cool, Number of blobs: 4, Blend: Plain.++## Aurora / Northern Lights++Blurred bands of light sway like the northern lights. Best for dark backgrounds.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/aurora/+- How it runs: moves by itself+- Good for: Hero sections · Night and space themes · Music and meditation apps · Travel sites+- Avoid on: Light pages · Busy layouts++**Prompt**++Add an aurora background to [the dark section you want it behind]. Stack a few tall, wide bands of color that fade to transparent at the top and bottom, blur them softly, and let each one sway sideways and lean a little on its own slow cycle, so they drift apart and together like curtains of light. Make the bands wider than the section and clip them, so their ends never show. Blur less on phones to keep it smooth. If the visitor has reduced motion turned on, keep the bands still. Match the settings listed below.++**Settings** (the defaults in bold):++- Number of bands: **2** · 3 · 4 · 5+- Speed: Slow · **Normal** · Fast+- Colors: **Green** · Purple · Red+- Brightness: Dim · **Medium** · Bright+- Stars in the sky: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Number of bands: 2, Speed: Normal, Colors: Green, Brightness: Medium, Stars in the sky: off.++## Grain / Film Noise Overlay++Fine grain flickers over the page, like old film. Best for editorial sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/grain-overlay/+- How it runs: moves by itself+- Good for: Editorial sites · Portfolios · Photo and film pages · Hero sections+- Avoid on: Small text · Forms++**Prompt**++Add a film grain overlay to [the section or page you want to texture]. Cover it with a see-through layer of random light and dark dots, and draw a new set of dots again and again so the grain flickers like old film; grain works best when it is felt more than seen. Blend the layer into the picture beneath it instead of laying gray on top, and let clicks pass through it. Redraw less often on phones, where drawing every dot is the costly part. If the visitor has reduced motion turned on, show the grain still. Match the settings listed below.++**Settings** (the defaults in bold):++- Strength: Faint · **Light** · Strong+- Grain size: Fine · **Medium** · Coarse+- How often it changes: Every frame · **Like film** · Choppy · Slow+- Blend: **Film** · Lighter · Softer+- Colored grain: on · **off**+- Grain source: **Random dots** · Noise filter++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Strength: Light, Grain size: Medium, How often it changes: Like film, Blend: Film, Colored grain: off, Grain source: Random dots.++## Scanline Effect++Dark lines and a sweeping beam imitate an old TV screen. Best for retro sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/scanline/+- How it runs: moves by itself+- Good for: Retro and gaming sites · Terminal screens · Music players · Sci-fi interfaces+- Avoid on: Long reading · Forms++**Prompt**++Add a scanline effect to [the screen, panel or section you want to look like an old monitor]. Lay thin, dark horizontal lines over the content with a repeating stripe pattern, in a layer that clicks pass through, so it looks like the rows of an old tube screen. When the settings include them, sweep a soft band of light slowly down the screen again and again, darken the corners like curved glass, and give the text a soft glow. Make sure the text stays readable through the lines. If the visitor has reduced motion turned on, keep the beam still. Match the settings listed below.++**Settings** (the defaults in bold):++- Line spacing: Tight · **Medium** · Wide+- Line darkness: Light · **Medium** · Dark+- Moving beam: **on** · off+- Beam speed: Slow · **Normal** · Fast+- Beam brightness: Faint · **Medium** · Bright+- Dark corners: on · **off**+- Glowing text: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Line spacing: Medium, Line darkness: Medium, Moving beam: on, Beam speed: Normal, Beam brightness: Medium, Dark corners: off, Glowing text: off.++## Light Leak++Warm light washes in from a corner at random times. Best for photo sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/light-leak/+- How it runs: moves by itself+- Good for: Photo and film sites · Portfolios · Music pages · Lifestyle brands+- Avoid on: Dashboards · Long reading pages++**Prompt**++Add a light leak effect to [the photo, video or section you want it over]. Place a soft glow of light, classically warm amber, spilling in from one corner or down the middle, in a see-through layer that clicks pass through, and fade it in and out every so often, like stray light reaching the film in an old camera. Make the gaps between leaks random and vary each leak's strength a little, because evenly timed leaks look fake. Keep each leak soft, so it never looks like a flash. If the visitor has reduced motion turned on, keep the glow still and faint. Match the settings listed below.++**Settings** (the defaults in bold):++- Comes from: **Top left** · Top right · Bottom left · Bottom right · Down the middle+- Time between leaks: Short · **Medium** · Long+- Speed: Slow · **Normal** · Fast+- Brightness: Dim · **Medium** · Bright+- Color: **Amber** · Gold · Rose · Magenta · Cyan+- Floating light spots: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Comes from: Top left, Time between leaks: Medium, Speed: Normal, Brightness: Medium, Color: Amber, Floating light spots: off.++## Starfield / Space Particles++Stars stream toward you out of the dark. Best for space themes.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/starfield/+- How it runs: moves by itself+- Good for: Space and science themes · Hero sections · Screensavers and kiosks · Launch pages+- Avoid on: Light pages · Long reading pages++**Prompt**++Add a starfield background to [the dark section you want it behind]. Draw many small stars on a canvas and move them out from the center, or sideways past the viewer, so it feels like flying through space. Tie each star's size, brightness and speed to its distance from the center: small, dim and slow near the middle, bigger, brighter and faster toward the edge, which is what creates the depth. A slow speed keeps it calm. Draw fewer stars on phones. If the visitor has reduced motion turned on, show the stars still. Match the settings listed below.++**Settings** (the defaults in bold):++- Direction: **Outward** · Sideways+- Speed: Slow · **Normal** · Fast+- Number of stars: Few · **Medium** · Many+- Star color: **White** · Warm white · Many colors+- Twinkling: **on** · off+- Nebula haze: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Direction: Outward, Speed: Normal, Number of stars: Medium, Star color: White, Twinkling: on, Nebula haze: off.++## Breathing / Pulsing Glow++A soft glow slowly grows and shrinks, like calm breathing. Best for idle states.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/breathing-glow/+- How it runs: moves by itself+- Good for: Idle states · Voice assistants · Meditation apps · Media players+- Avoid on: Alerts · Busy screens++**Prompt**++Add a breathing glow behind [the icon or element that should look alive but at rest]. Place a soft, round, blurred glow of color behind it, and make it slowly grow and brighten, then shrink and dim, over and over, easing gently at both ends like a calm breath. Four to six seconds a breath feels relaxed; much faster feels anxious. When the settings include it, let the element itself swell very slightly with the glow. If the visitor has reduced motion turned on, keep the glow still. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- How much it grows: A little · **Medium** · A lot+- Glow color: Pink · **Blue** · Purple · Green · Orange+- Glow size: Small · **Medium** · Large+- Second glow: on · **off**+- Icon and title breathe too: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, How much it grows: Medium, Glow color: Blue, Glow size: Medium, Second glow: off, Icon and title breathe too: on.++## Ambient Ripple Effect++Rings spread from a few spots, like drops on a still pond. Best for hero areas.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ambient-ripple/+- How it runs: moves by itself+- Good for: Hero sections · Live and connected states · Maps and places · Meditation apps+- Avoid on: Buttons · Alerts++**Prompt**++Add an ambient ripple background to [the section or status you want to feel alive]. Pick a few spots and let each one send out a ring every so often that grows from nothing and gets fainter as it spreads until it disappears, so several rings overlap like drops on a still pond. It runs by itself, never on clicks. When the settings ask for uneven timing, vary the gaps slightly, because perfectly regular rings feel like a clock. If the visitor has reduced motion turned on, show a few still rings. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Time between ripples: Short · **Medium** · Long+- Ripple size: Small · **Medium** · Large+- Number of sources: 1 · **3** · 5+- Ring thickness: Thin · **Medium** · Thick+- Ring color: Pink · White · **Blue** · Purple · Green · Orange+- Uneven timing: **on** · off+- Sources drift: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Time between ripples: Medium, Ripple size: Medium, Number of sources: 3, Ring thickness: Medium, Ring color: Blue, Uneven timing: on, Sources drift: off.++## Floating Elements++Small shapes drift slowly, each on its own path. Best for hero backgrounds.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/floating-elements/+- How it runs: moves by itself+- Good for: Hero backgrounds · Landing pages · Onboarding screens · Empty states+- Avoid on: Busy layouts · Long reading pages++**Prompt**++Add floating shapes to [the section you want a gentle moving background behind]. Scatter a handful of small, see-through circles, squares or rings, and move each one slowly around its own starting point on a smooth, looping path, giving every shape its own speed, distance and starting point so no two ever move in step. Keep them behind the content and let clicks pass through. When the settings include it, shapes slide away from the pointer, or from a finger on touch screens. If the visitor has reduced motion turned on, keep the shapes still. Match the settings listed below.++**Settings** (the defaults in bold):++- Number of shapes: Few · **Medium** · Many+- Speed: Slow · **Normal** · Fast+- How far they drift: Short · **Medium** · Long+- Shapes: Circles · Squares · Rings · **Mixed**+- Colors: **Cool** · Warm · Gray · Neon+- Shapes turn: **on** · off+- Fades in and out: **on** · off+- Shapes avoid the pointer: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Number of shapes: Medium, Speed: Normal, How far they drift: Medium, Shapes: Mixed, Colors: Cool, Shapes turn: on, Fades in and out: on, Shapes avoid the pointer: off.++## Grid / Dot Pattern Parallax++A dot grid shifts gently against your pointer for depth. Best for tech sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/grid-dot-pattern-parallax/+- How it runs: moves by itself+- Good for: Tech and developer sites · Hero sections · Dashboards · Portfolios+- Avoid on: Photo backgrounds · Long reading pages++**Prompt**++Add a dot grid parallax background to [the section you want a subtle sense of depth behind]. Tile a faint grid of dots or lines behind the content, a little larger than the section, and shift it slightly in the opposite direction to the pointer, so it seems to sit deeper than the content. Keep the shift to a few percent of the pointer's movement, so it is felt more than seen. On touch screens, let it follow a dragging finger the same way, and when nothing is over it, let it drift slowly by itself. If the visitor has reduced motion turned on, keep the grid still. Match the settings listed below.++**Settings** (the defaults in bold):++- Pattern: **Dots** · Lines · Dots and lines+- Strength: Subtle · **Medium** · Strong+- Spacing: Tight · **Medium** · Wide+- Pattern color: Pink · White · **Blue** · Purple · Green · Orange+- Second layer: on · **off**+- Light under the pointer: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Pattern: Dots, Strength: Medium, Spacing: Medium, Pattern color: Blue, Second layer: off, Light under the pointer: on.++## Abstract Geometric Motion++Shapes turn, spread and flow in a calm, endless pattern. Best for music players.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/abstract-geometric-motion/+- How it runs: moves by itself+- Good for: Music and media players · Screensavers and kiosks · Loading screens · Art pages+- Avoid on: Forms · Long reading pages++**Prompt**++Add an abstract geometric animation to [the section or screen you want a calm moving background in]. Draw simple shapes on a canvas and keep them moving in an endless loop: polygons slowly turning around the center, rings spreading out and fading, slanted bars sliding across, or wavy lines with color flowing along them. Drive everything from one steadily growing time value, so the loop never restarts or jumps. Colors from one family keep it calm. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Pattern: **Polygons** · Rings · Bars · Lines+- Speed: Slow · **Normal** · Fast+- Number of shapes: Few · **Medium** · Many+- Colors: **Cool** · Warm · Neon · Gray+- Thicker lines: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Pattern: Polygons, Speed: Normal, Number of shapes: Medium, Colors: Cool, Thicker lines: off.++## Particle Constellation++Drifting dots link up with lines whenever they come close. Best for tech sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/particle-constellation/+- How it runs: moves by itself+- Good for: Tech and data sites · Hero sections · Network and security products · Loading screens+- Avoid on: Busy layouts · Long reading pages++**Prompt**++Add a particle constellation background to [the section you want it behind]. Scatter dots on a canvas, let each drift slowly in its own direction and bounce off the edges, and on every frame join any two dots that are close with a thin line that fades as they move apart, so a network keeps forming and breaking. When the settings include it, let the dots drift toward the pointer, or toward a finger on touch screens. Checking every pair of dots gets slow fast, so use fewer dots on phones. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Number of dots: Few · **Medium** · Many+- Link distance: Short · **Medium** · Long+- Speed: Slow · **Normal** · Fast+- Color: **Cyan** · Violet · Mint · Gray+- Dots follow the pointer: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Number of dots: Medium, Link distance: Medium, Speed: Normal, Color: Cyan, Dots follow the pointer: on.++## Flow Field++Particles ride invisible currents, leaving fading trails. Best for art pages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/flow-field/+- How it runs: moves by itself+- Good for: Art and creative sites · Hero sections · Loading screens · Data art+- Avoid on: Busy layouts · Long reading pages++**Prompt**++Add a flow field background to [the section you want it behind]. Fill a canvas with many particles and give every point a direction that changes smoothly from spot to spot (smooth random noise does this). Each frame, move each particle a small step along the direction under it, scaled by the time since the last frame so it runs at the same speed on every screen. Instead of clearing the canvas, cover it with a see-through dark layer once for every 60th of a second that passes, so each particle leaves a fading trail. Let the directions change slowly over time, and use fewer particles on phones. If the visitor has reduced motion turned on, show one still frame of trails. Match the settings listed below.++**Settings** (the defaults in bold):++- Swirl size: Small · **Medium** · Large+- Trail length: Short · **Medium** · Long+- Speed: Slow · **Normal** · Fast+- Number of particles: Few · **Medium** · Many+- Color: **Mint** · Ember · Ice · Rainbow++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Swirl size: Medium, Trail length: Medium, Speed: Normal, Number of particles: Medium, Color: Mint.++## Synthwave Grid++A glowing grid rolls toward you under a striped sun. Best for music and games.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/synthwave-grid/+- How it runs: moves by itself+- Good for: Music and gaming sites · Retro themes · Event pages · Hero sections+- Avoid on: Calm brands · Long reading pages++**Prompt**++Add a synthwave grid to [the section you want a retro scene in]. Draw a purple sky with a striped, glowing sun on the horizon and, below it, a glowing grid floor in perspective: lines that meet at one point on the horizon, crossed by lines that bunch up near the horizon and spread out toward the viewer. Move the cross lines steadily toward the viewer and wrap them around, fading each one in at the horizon, so the floor rolls forward forever with no visible jump. If the visitor has reduced motion turned on, show the scene still. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Number of lines: Few · **Medium** · Many+- Grid color: **Pink** · Cyan · Purple · Orange++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Number of lines: Medium, Grid color: Pink.++## Matrix Rain++Columns of glowing characters rain down a dark screen. Best for tech themes.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/matrix-rain/+- How it runs: moves by itself+- Good for: Tech and hacker themes · Loading screens · Game and event pages · 404 pages+- Avoid on: Calm brands · Long reading pages++**Prompt**++Add a matrix rain background to [the section you want it behind]. Split a dark canvas into columns and, at a steady pace, draw a bright character at the head of each column and move it down one row, sending each column back to the top at random once it passes the bottom. Instead of clearing the canvas, cover it with a see-through black layer before each step, so older characters fade into a trail behind each bright leader. Space the columns wider on phones. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Characters: **Japanese** · Binary · Hexadecimal+- Trail length: Short · **Medium** · Long+- Character size: Small · **Medium** · Large+- Glowing leaders: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Characters: Japanese, Trail length: Medium, Character size: Medium, Glowing leaders: on.++## Plasma Field++Smooth waves of color flow endlessly, made from math. Best for creative sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/plasma/+- How it runs: moves by itself+- Good for: Music and creative sites · Hero sections · Loading screens · Retro themes+- Avoid on: Serious content · Long reading pages++**Prompt**++Add a plasma background to [the section you want it behind]. For every point, add up a few waves based on its position and on time (across, down, diagonally and outward from the center) and use the sum to pick a color from a smooth palette, so the whole field flows like liquid color. To keep it fast, draw the field into a small image and scale it up smoothly to fill the section, using a smaller image on phones. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Pattern size: Small · **Medium** · Large+- Colors: **Neon** · Sunset · Ocean · Rose+- Detail: Low · **Medium** · High++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Pattern size: Medium, Colors: Neon, Detail: Medium.++## Wave Layers++Layers of waves drift sideways, each at its own speed. Best for hero sections.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/wave-layers/+- How it runs: moves by itself+- Good for: Hero sections · Page footers · Section dividers · Travel and beach sites+- Avoid on: Dense dashboards · Long reading pages++**Prompt**++Add layered waves to [the bottom of the section you want them in]. Stack a few strips of water, each one twice as wide as the section with the same wave shape repeated along its top edge: far strips sit higher, paler and with smaller waves, near strips lower, darker and with bigger ones. Slide every strip sideways by half its width, over and over, so the repeated shape hides the restart, and give near strips a quicker pace than far ones so the water feels deep. Move the strips only by shifting them, which keeps it smooth on phones. If the visitor has reduced motion turned on, keep the waves still. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Colors: **Ocean** · Sunset · Night+- Wave height: Low · **Medium** · High+- Number of layers: 2 · 3 · **4**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Colors: Ocean, Wave height: Medium, Number of layers: 4.++## Snow / Rain++Snow drifts down, or rain falls in streaks, over a dark town. Best for seasonal pages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/snow-rain/+- How it runs: moves by itself+- Good for: Winter and holiday pages · Weather apps · Cozy hero sections · Story and game scenes+- Avoid on: Light pages · Long reading pages++**Prompt**++Add falling snow or rain to [the dark section you want it over]. Lay a see-through canvas over the section and draw small particles on it, moving each one down on every frame by the time that has passed, and start it again at the top once it leaves the bottom. Snowflakes fall slowly and sway from side to side; raindrops fall fast and are drawn as short streaks that lean with the wind. When depth is on, make near particles bigger, brighter and faster than far ones. Draw fewer particles on phones. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Weather: **Snow** · Rain+- Amount: Light · **Medium** · Heavy+- Wind: None · **Gentle** · Strong+- Depth: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Weather: Snow, Amount: Medium, Wind: Gentle, Depth: on.++## Fireworks++Rockets rise and burst into glowing sparks that fall and fade. Best for celebrations.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fireworks/+- How it runs: moves by itself+- Good for: Launch and event pages · Holiday greetings · Success screens · Game wins+- Avoid on: Calm brands · Long reading pages++**Prompt**++Add fireworks to [the dark section you want them over]. On a see-through canvas laid over the section, launch a rocket from the bottom every so often; it slows as it climbs and, at the top of its climb, bursts into many sparks that fly out in all directions. Slow the sparks a little on every frame, pull them gently down and fade them out, so each burst blooms, droops and dies away. For trails, cover the canvas with a faint see-through layer instead of clearing it, the same number of times per second on every screen. Use fewer sparks on phones. If the visitor has reduced motion turned on, show a still picture of the bursts. Match the settings listed below.++**Settings** (the defaults in bold):++- How often: Rarely · **Sometimes** · Often+- Colors: **Many colors** · Gold · Blue+- Trails: None · Short · **Long**+- Burst shape: **Round** · Ring · Willow++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: How often: Sometimes, Colors: Many colors, Trails: Long, Burst shape: Round.++## Topographic Lines++Lines like those on a hiking map slowly bend and drift. Best for outdoor brands.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/topographic-lines/+- How it runs: moves by itself+- Good for: Outdoor and travel brands · Hero sections · Maps and data products · Portfolio backgrounds+- Avoid on: Busy layouts · Long reading pages++**Prompt**++Add a topographic lines background to [the section you want it behind]. Build a smooth, hilly height map from layered noise and draw its contour lines on a canvas: sample the height on a grid, and in each grid square join the points where the height crosses each level, so every line follows one height, as on a hiking map. Make every fifth line bolder when the settings include it. Shift the noise slowly by elapsed time so the hills swell, shrink and drift, and redraw each frame. Sample a coarser grid on phones. If the visitor has reduced motion turned on, show the lines still. Match the settings listed below.++**Settings** (the defaults in bold):++- Line spacing: Tight · **Medium** · Wide+- Speed: Slow · **Normal** · Fast+- Color: **Sand** · Mint · Sky blue · White+- Hill size: Small · **Medium** · Large+- Bold every fifth line: **on** · off++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Line spacing: Medium, Speed: Normal, Color: Sand, Hill size: Medium, Bold every fifth line: on.++## Light Rays++Soft beams of light fall from above and slowly sweep across. Best for hero intros.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/light-rays/+- How it runs: moves by itself+- Good for: Hero sections · Page intros · Nature and wellness sites · Product launches+- Avoid on: Light pages · Busy layouts++**Prompt**++Add soft light rays to [the dark section you want them in]. From one point just above the top edge, draw a fan of long, narrow beams on a canvas, made soft by gradients rather than blur filters: clear at the edges, brightest near the source and fading out farther away. Let each beam sway and brighten and dim on its own slow cycle, paced by elapsed time, so the light seems to sweep across the scene, and add overlapping beams together. When the settings include dust, float tiny specks that glint only where a beam crosses them, with fewer specks on phones. Keep the content above the light. If the visitor has reduced motion turned on, show the rays still. Match the settings listed below.++**Settings** (the defaults in bold):++- Light color: **Warm** · Cool+- Speed: Slow · **Normal** · Fast+- Floating dust: **on** · off+- Number of rays: Few · **Some** · Many+- Light comes from: **Top left** · Top · Top right++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Light color: Warm, Speed: Normal, Floating dust: on, Number of rays: Some, Light comes from: Top left.++## Game of Life++Cells live and die by their neighbors, and patterns grow. Best for tech sites.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/game-of-life/+- How it runs: moves by itself+- Good for: Tech and science sites · Developer portfolios · Loading and idle screens · 404 pages+- Avoid on: Calm brands · Long reading pages++**Prompt**++Add a Game of Life background to [the section you want it behind]. Split a canvas into a grid of square cells, each alive or dead, and at a steady pace work out the next generation from each cell's eight neighbors: a dead cell with exactly three live neighbors is born, a live cell with two or three stays alive, and every other cell dies. Time the generations by elapsed time, not by frames, and when the settings include trails, let dying cells fade out. Let the visitor click, drag or touch to draw cells, and start again when the world settles. Keep the cells from getting too small on phones. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.++**Settings** (the defaults in bold):++- Speed: Slow · **Normal** · Fast+- Cell size: Small · **Medium** · Large+- Start pattern: **Random** · Glider gun · Acorn+- Color: **Mint** · Amber · Sky blue · Pink+- Fading trails: **on** · off+- Grid lines: on · **off**++Copied from the site with the defaults, the prompt ends with this line:++Settings from the demo: Speed: Normal, Cell size: Medium, Start pattern: Random, Color: Mint, Fading trails: on, Grid lines: off.diff --git a/skills/animation-handbook/references/catalog.md b/skills/animation-handbook/references/catalog.mdnew file mode 100644index 00000000..489d445b--- /dev/null+++ b/skills/animation-handbook/references/catalog.md@@ -0,0 +1,220 @@+# Catalog++All 166 animations of Animation Handbook, in the home page's order and grouped by category. Each line gives the name (linked to its live demo), what it does and what it is best for, its places (the parts of a page it suits, the main one first), and the file that holds its full entry with the prompt and the settings.++Contents: [01 · Scroll-Based](#01--scroll-based) · [02 · Entrance & Exit](#02--entrance--exit) · [03 · Page Transitions](#03--page-transitions) · [04 · Micro-Interactions](#04--micro-interactions) · [05 · Text & Typography](#05--text--typography) · [06 · 3D & Advanced](#06--3d--advanced) · [07 · Ambient & Background](#07--ambient--background) · [By place](#by-place)++## 01 · Scroll-Based++Animations driven by scroll position — parallax, sticky, scrub, snap, and storytelling. 27 animations, in [01-scroll-based.md](01-scroll-based.md).++- [Parallax Depth-of-Field](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/parallax-depth-of-field/): Layers move at their own speed as the focus shifts. Best for cinematic intros. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#parallax-depth-of-field).+- [Parallax Scrolling](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/parallax-scrolling/): Far layers move slower than near ones as you scroll. Best for hero scenes. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#parallax-scrolling).+- [Reverse-Scrolling Columns](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/reverse-scrolling-columns/): Side columns run the opposite way to the middle one. Best for portfolios. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#reverse-scrolling-columns).+- [Cover Card to Fixed Header](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/cover-card-to-fixed-header/): A tall cover shrinks into a slim header as you scroll. Best for articles. Places: Scrolling, Menus & forms. Entry in [01-scroll-based.md](01-scroll-based.md#cover-card-to-fixed-header).+- [Fly-in Fly-out Contact List](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/fly-in-fly-out-contact-list/): Rows fade and slide as they near the top or bottom edge. Best for long lists. Places: Scrolling. Entry in [01-scroll-based.md](01-scroll-based.md#fly-in-fly-out-contact-list).+- [Stacking Cards](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/stacking-cards/): Cards stick at the top and pile into a deck. Best for step-by-step stories. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#stacking-cards).+- [Scroll-Triggered Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-trigger/): Animations start, follow and pin at set scroll points. Best for landing pages. Places: Scrolling. Entry in [01-scroll-based.md](01-scroll-based.md#scroll-triggered-animation).+- [Scrub Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scrub-animation/): Scroll plays it forward and back, like dragging a video. Best for product tours. Places: Scrolling. Entry in [01-scroll-based.md](01-scroll-based.md#scrub-animation).+- [Pin Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/pin-animation/): One part stays put while its text changes on scroll. Best for feature lists. Places: Scrolling. Entry in [01-scroll-based.md](01-scroll-based.md#pin-animation).+- [Snap Scrolling](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/snap-scrolling/): The box settles on one whole section at a time. Best for slides and galleries. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#snap-scrolling).+- [Scrollytelling](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scrollytelling/): A picture beside the story changes as you read down. Best for data stories. Places: Scrolling. Entry in [01-scroll-based.md](01-scroll-based.md#scrollytelling).+- [Reveal on Scroll](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/reveal-on-scroll/): Cards appear as they cross a line in the box. Best for long landing pages. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#reveal-on-scroll).+- [Stagger Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/stagger-reveal/): Items in a group appear one after another as it scrolls in. Best for card grids. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#stagger-reveal).+- [Horizontal Scroll](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/horizontal-scroll/): Scroll down and a row of panels slides sideways. Best for portfolios. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#horizontal-scroll).+- [Sticky Section](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/sticky-section/): A section holds still while its content changes. Best for feature tours. Places: Scrolling. Entry in [01-scroll-based.md](01-scroll-based.md#sticky-section).+- [Counter Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/counter-animation/): Numbers count up when they scroll into view. Best for stats. Places: Scrolling, Text. Entry in [01-scroll-based.md](01-scroll-based.md#counter-animation).+- [Progress Bar](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/progress-bar/): A bar fills as you read down the page. Best for long articles. Places: Scrolling, Loading & messages. Entry in [01-scroll-based.md](01-scroll-based.md#progress-bar).+- [Section Wipe](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/section-wipe/): Each section slides up over the one before. Best for full-screen stories. Places: Scrolling. Entry in [01-scroll-based.md](01-scroll-based.md#section-wipe).+- [Zoom Into Image](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/zoom-into-image/): A small window opens up to fill the box as you scroll. Best for hero images. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#zoom-into-image).+- [Scroll Image Sequence](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-image-sequence/): Scrolling plays a series of pictures like a flip-book. Best for products. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#scroll-image-sequence).+- [Smooth (Inertia) Scroll](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/smooth-scroll/): Scrolling glides to a stop instead of jumping. Best for portfolio sites. Places: Scrolling. Entry in [01-scroll-based.md](01-scroll-based.md#smooth-inertia-scroll).+- [Text Fill on Scroll](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/text-fill-on-scroll/): Words light up one by one as you scroll. Best for key statements. Places: Scrolling, Text. Entry in [01-scroll-based.md](01-scroll-based.md#text-fill-on-scroll).+- [Scroll Velocity Skew](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-velocity-skew/): Rows lean when you scroll fast and straighten when you stop. Best for galleries. Places: Scrolling, Images & cards. Entry in [01-scroll-based.md](01-scroll-based.md#scroll-velocity-skew).+- [SVG Line Draw on Scroll](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/svg-line-draw/): A line draws itself along a route as you scroll. Best for timelines. Places: Scrolling. Entry in [01-scroll-based.md](01-scroll-based.md#svg-line-draw-on-scroll).+- [Scrollspy Navigation](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scrollspy-nav/): A menu highlights the section you are reading. Best for long docs. Places: Scrolling, Menus & forms. Entry in [01-scroll-based.md](01-scroll-based.md#scrollspy-navigation).+- [Scroll-Driven Background Color](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/scroll-background-color/): The background color changes as you scroll through sections. Best for stories. Places: Scrolling, Backgrounds. Entry in [01-scroll-based.md](01-scroll-based.md#scroll-driven-background-color).+- [Hide-on-Scroll Header](https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/hide-on-scroll-header/): Scrolling down hides the top bar; scrolling up shows it. Best for mobile pages. Places: Menus & forms, Scrolling. Entry in [01-scroll-based.md](01-scroll-based.md#hide-on-scroll-header).++## 02 · Entrance & Exit++Element-level animations for arriving and departing — fades, slides, reveals, flips, and text staggers. 14 animations, in [02-entrance-and-exit.md](02-entrance-and-exit.md).++- [Fade In / Fade Out](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/fade-in-out/): Fades in to appear and fades out to leave. Best for pop-ups and tooltips. Places: Page intros. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#fade-in--fade-out).+- [Slide In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/slide-in/): Travels into place from one edge. Best for side panels and notifications. Places: Page intros, Menus & forms, Loading & messages. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#slide-in).+- [Slide Up Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/slide-up-reveal/): Text rises into view from behind an invisible edge. Best for headlines. Places: Page intros, Text. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#slide-up-reveal).+- [Scale In / Zoom In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/scale-in/): Grows from smaller to full size. Best for pop-ups and menus. Places: Page intros, Menus & forms. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#scale-in--zoom-in).+- [Clip-Path Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/clip-path-reveal/): A growing shape uncovers it while it stays still. Best for images and banners. Places: Page intros, Images & cards. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#clip-path-reveal).+- [Curtain Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/curtain-reveal/): A colored panel covers it, then slides away. Best for intros and logos. Places: Page intros. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#curtain-reveal).+- [Split Text Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/split-text-reveal/): Text breaks into pieces that appear one after another. Best for headlines. Places: Page intros, Text. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#split-text-reveal).+- [Letter-by-Letter Stagger](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/letter-by-letter-stagger/): A phrase appears letter by letter or typewriter-style. Best for short headlines. Places: Page intros, Text. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#letter-by-letter-stagger).+- [Word-by-Word Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/word-by-word-reveal/): Words appear one after another at a reading pace. Best for quotes and intros. Places: Page intros, Text. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#word-by-word-reveal).+- [Blur In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/blur-in/): Comes into focus from a blur, like a camera. Best for featured cards and photos. Places: Page intros, Images & cards. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#blur-in).+- [Flip In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/flip-in/): Swings into view in 3D, like a card turning over. Best for cards and tiles. Places: Page intros, Images & cards. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#flip-in).+- [Bounce In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/bounce-in/): Lands with a springy bounce. Best for badges and success messages. Places: Page intros, Loading & messages. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#bounce-in).+- [Rotate In](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/rotate-in/): Spins into place while it grows. Best for icons, stars and badges. Places: Page intros. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#rotate-in).+- [Shatter Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/02-entrance-and-exit/shatter-effect/): Breaks into pieces that fly apart and fade. Best for galleries and bold exits. Places: Images & cards, Page changes. Entry in [02-entrance-and-exit.md](02-entrance-and-exit.md#shatter-effect).++## 03 · Page Transitions++Full-page transitions between routes or views — crossfades, slides, portals, morphs, and the View Transitions API. 16 animations, in [03-page-transitions.md](03-page-transitions.md).++- [View Transitions API](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/view-transitions-api/): The browser animates the change between two pages for you. Best for web apps. Places: Page changes. Entry in [03-page-transitions.md](03-page-transitions.md#view-transitions-api).+- [Shared Element Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/shared-element-transition/): A picture grows from the list into the next page's header. Best for galleries. Places: Page changes, Images & cards. Entry in [03-page-transitions.md](03-page-transitions.md#shared-element-transition).+- [Morph Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/morph-transition/): The logo changes shape to match each page you visit. Best for brand marks. Places: Page changes. Entry in [03-page-transitions.md](03-page-transitions.md#morph-transition).+- [Crossfade Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/crossfade/): The old page fades out as the new one fades in. Best for calm page changes. Places: Page changes. Entry in [03-page-transitions.md](03-page-transitions.md#crossfade-transition).+- [Slide Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/slide-transition/): Pages slide across, and going back slides the other way. Best for step flows. Places: Page changes. Entry in [03-page-transitions.md](03-page-transitions.md#slide-transition).+- [Zoom Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/zoom-transition/): The pages zoom as they swap, as if moving in depth. Best for opening details. Places: Page changes. Entry in [03-page-transitions.md](03-page-transitions.md#zoom-transition).+- [Flash / Light Leak Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/flash-transition/): A burst of light hides the moment the page changes. Best for bold, lively sites. Places: Page changes. Entry in [03-page-transitions.md](03-page-transitions.md#flash--light-leak-transition).+- [Blur Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/blur-transition/): The old page blurs away and the new one comes into focus. Best for photo sites. Places: Page changes, Images & cards. Entry in [03-page-transitions.md](03-page-transitions.md#blur-transition).+- [Elastic Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/elastic-transition/): The new page slides in, goes too far and springs back. Best for playful apps. Places: Page changes. Entry in [03-page-transitions.md](03-page-transitions.md#elastic-transition).+- [Portal / Tunnel Zoom](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/portal-zoom/): The next page opens out of a circle you click. Best for big reveals. Places: Page changes. Entry in [03-page-transitions.md](03-page-transitions.md#portal--tunnel-zoom).+- [Dissolve Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/dissolve/): The page breaks into tiles that give way to the next. Best for photo galleries. Places: Page changes, Images & cards. Entry in [03-page-transitions.md](03-page-transitions.md#dissolve-transition).+- [FLIP Technique](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/flip-technique/): Cards glide to their new places when the layout changes. Best for sorting lists. Places: Page changes, Images & cards. Entry in [03-page-transitions.md](03-page-transitions.md#flip-technique).+- [Circle Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/circle-reveal/): Pages grow from any spot you click and shrink back into it. Best for app navigation. Places: Page changes. Entry in [03-page-transitions.md](03-page-transitions.md#circle-reveal).+- [Overlay Wipe](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/overlay-wipe/): A colored panel sweeps over the page as it changes. Best for portfolio sites. Places: Page changes. Entry in [03-page-transitions.md](03-page-transitions.md#overlay-wipe).+- [Page Curl](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/page-curl/): The page peels back from its corner like paper. Best for digital magazines. Places: Page changes, Images & cards. Entry in [03-page-transitions.md](03-page-transitions.md#page-curl).+- [Cube Transition](https://matinmonshizadeh.github.io/animation-handbook/animations/03-page-transitions/cube-transition/): The pages sit on a cube that turns to show the next. Best for photo stories. Places: Page changes, Images & cards. Entry in [03-page-transitions.md](03-page-transitions.md#cube-transition).++## 04 · Micro-Interactions++Short, user-triggered animations — hover, click, focus, loading states, and UI feedback patterns. 41 animations, in [04-micro-interactions.md](04-micro-interactions.md).++- [Hover State Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/hover-state/): Six ways a card can react when you point at it. Best for buttons and cards. Places: Buttons, Images & cards. Entry in [04-micro-interactions.md](04-micro-interactions.md#hover-state-animation).+- [Click / Tap Ripple](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/click-ripple/): A ripple spreads out from the spot you press. Best for buttons and list items. Places: Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#click--tap-ripple).+- [Focus Ring Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/focus-ring/): A ring closes in around the item the Tab key reaches. Best for forms and menus. Places: Menus & forms. Entry in [04-micro-interactions.md](04-micro-interactions.md#focus-ring-animation).+- [Button Press Scale](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/button-press-scale/): Shrinks as you press it and springs back as you let go. Best for main buttons. Places: Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#button-press-scale).+- [Magnetic Button](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/magnetic-button/): Leans toward the pointer, then springs home. Best for one main button. Places: Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#magnetic-button).+- [Toggle / Switch Slide](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/toggle-switch/): The knob slides across as the switch turns on or off. Best for settings. Places: Buttons, Menus & forms. Entry in [04-micro-interactions.md](04-micro-interactions.md#toggle--switch-slide).+- [Heart / Like Burst](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/heart-burst/): The heart pops and fills as small hearts burst out. Best for like buttons. Places: Buttons, Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#heart--like-burst).+- [Success Confetti](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/success-confetti/): Confetti bursts from the button when a task is done. Best for big moments. Places: Buttons, Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#success-confetti).+- [Skeleton Loader](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/skeleton-loader/): Gray shapes hold the place of content while it loads. Best for feeds and cards. Places: Loading & messages, Images & cards. Entry in [04-micro-interactions.md](04-micro-interactions.md#skeleton-loader).+- [Shimmer Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/shimmer-effect/): A band of light sweeps over gray placeholders. Best for loading screens. Places: Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#shimmer-effect).+- [Loading Spinner](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/loading-spinner/): Six small shapes loop to show that something is loading. Best for short waits. Places: Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#loading-spinner).+- [Progress Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/progress-animation/): A bar, a ring and steps fill up to show progress. Best for uploads. Places: Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#progress-animation).+- [Checkmark Draw](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/checkmark-draw/): A tick draws itself in a circle once a task succeeds. Best for forms. Places: Loading & messages, Menus & forms. Entry in [04-micro-interactions.md](04-micro-interactions.md#checkmark-draw).+- [Form Field Morph](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/form-field-morph/): The label moves up out of the way as you type. Best for sign-up forms. Places: Menus & forms. Entry in [04-micro-interactions.md](04-micro-interactions.md#form-field-morph).+- [Notification Badge Pulse](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/badge-pulse/): A badge on an icon pulses to catch the eye. Best for unread messages. Places: Loading & messages, Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#notification-badge-pulse).+- [Tooltip Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/tooltip-reveal/): A small label fades in after a short pause. Best for icon buttons. Places: Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#tooltip-reveal).+- [Drawer / Panel Slide](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/drawer-slide/): A side panel slides in over a dimmed page. Best for mobile menus. Places: Menus & forms. Entry in [04-micro-interactions.md](04-micro-interactions.md#drawer--panel-slide).+- [Modal Expand](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/modal-expand/): A window grows out of the button you pressed. Best for detail views. Places: Images & cards, Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#modal-expand).+- [Accordion Open/Close](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/accordion/): Each question opens smoothly to show its answer. Best for FAQ pages. Places: Menus & forms. Entry in [04-micro-interactions.md](04-micro-interactions.md#accordion-openclose).+- [Cursor Follower](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/cursor-follower/): A dot trails your pointer and flips the colors under it. Best for portfolios. Places: Backgrounds. Entry in [04-micro-interactions.md](04-micro-interactions.md#cursor-follower).+- [Error Shake](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/error-shake/): A field shakes side to side when the input is wrong. Best for sign-in forms. Places: Menus & forms, Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#error-shake).+- [Swipe to Dismiss](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/swipe-to-dismiss/): A card dragged sideways flies off and the list closes up. Best for inboxes. Places: Images & cards. Entry in [04-micro-interactions.md](04-micro-interactions.md#swipe-to-dismiss).+- [Hamburger Menu Toggle](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/hamburger-menu-toggle/): Three lines turn into an X as the menu opens. Best for mobile menus. Places: Menus & forms, Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#hamburger-menu-toggle).+- [Theme Toggle Morph](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/theme-toggle-morph/): A sun turns into a moon as the colors switch to dark. Best for theme buttons. Places: Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#theme-toggle-morph).+- [Copy to Clipboard](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/copy-to-clipboard/): Copy turns into a tick and Copied, then changes back. Best for codes and links. Places: Buttons, Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#copy-to-clipboard).+- [Star Rating](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/star-rating/): Stars fill up to your pointer and pop when you choose. Best for reviews. Places: Menus & forms, Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#star-rating).+- [Toast Notification](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/toast-notification/): Short messages slide into a corner, then leave on their own. Best for updates. Places: Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#toast-notification).+- [Segmented Control](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/segmented-control/): A highlight slides to the option you pick. Best for switching views. Places: Menus & forms, Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#segmented-control).+- [Pull to Refresh](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/pull-to-refresh/): Pulling a list down shows a spinner, then new items. Best for feeds. Places: Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#pull-to-refresh).+- [Animated Gradient Border](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/gradient-border/): A band of colors runs around the edge of a card or button. Best for featured offers. Places: Buttons, Images & cards. Entry in [04-micro-interactions.md](04-micro-interactions.md#animated-gradient-border).+- [Spotlight Hover Glow](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/spotlight-hover/): A soft glow follows the pointer and lights card edges. Best for feature grids. Places: Images & cards, Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#spotlight-hover-glow).+- [Add-to-Cart Fly](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/add-to-cart-fly/): The product flies into the cart, which bumps and counts up. Best for shops. Places: Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#add-to-cart-fly).+- [Drag to Reorder](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/drag-to-reorder/): Drag an item and the others slide aside to make room. Best for to-do lists. Places: Menus & forms. Entry in [04-micro-interactions.md](04-micro-interactions.md#drag-to-reorder).+- [Rolling Numbers](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/rolling-numbers/): Each digit rolls to its new value, like a mileage counter. Best for prices. Places: Text, Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#rolling-numbers).+- [Typing Indicator](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/typing-indicator/): Three dots in a chat bubble move in turn while someone types. Best for chat apps. Places: Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#typing-indicator).+- [Hold to Confirm](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/hold-to-confirm/): A button fills up while you hold it and acts only once it is full. Best for delete buttons. Places: Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#hold-to-confirm).+- [Expanding Search](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/expanding-search/): A search icon opens into a field, then closes when done. Best for toolbars. Places: Menus & forms, Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#expanding-search).+- [Button Loading States](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/button-loading-states/): The button becomes a spinner, then a tick or a cross. Best for Save buttons. Places: Buttons, Loading & messages. Entry in [04-micro-interactions.md](04-micro-interactions.md#button-loading-states).+- [Image Trail](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/image-trail/): Pictures pop up in a trail behind your pointer, then fade. Best for portfolios. Places: Images & cards, Page intros. Entry in [04-micro-interactions.md](04-micro-interactions.md#image-trail).+- [Gooey Menu](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/gooey-menu/): Small buttons ooze out of a round button like liquid. Best for quick actions. Places: Menus & forms, Buttons. Entry in [04-micro-interactions.md](04-micro-interactions.md#gooey-menu).+- [Dynamic Island](https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/dynamic-island/): A black pill grows into a notification, then shrinks back. Best for live updates. Places: Loading & messages, Menus & forms. Entry in [04-micro-interactions.md](04-micro-interactions.md#dynamic-island).++## 05 · Text & Typography++Animations specifically for type — kinetic motion, character-level effects, gradient flows, and word transformations. 19 animations, in [05-text-typography.md](05-text-typography.md).++- [Kinetic Typography](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/kinetic-typography/): Words arrive and leave one by one, each moving its own way. Best for intros. Places: Text, Page intros. Entry in [05-text-typography.md](05-text-typography.md#kinetic-typography).+- [Typewriter Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/typewriter-effect/): Text types itself out behind a blinking cursor. Best for short taglines. Places: Text, Page intros. Entry in [05-text-typography.md](05-text-typography.md#typewriter-effect).+- [Scramble / Glitch Text](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/scramble-text/): Random symbols lock into the real text, left to right. Best for tech headlines. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#scramble--glitch-text).+- [Variable Font Morph](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/variable-font-morph/): A word smoothly turns bold, then light, and leans over. Best for headlines. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#variable-font-morph).+- [Text Clip-Path Reveal](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-clip-path-reveal/): Each line of a headline is uncovered in turn. Best for big headlines. Places: Text, Page intros. Entry in [05-text-typography.md](05-text-typography.md#text-clip-path-reveal).+- [Marquee / Ticker](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/marquee-ticker/): Text scrolls sideways in an endless loop, with no seam. Best for news tickers. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#marquee--ticker).+- [Text Morphing](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-morphing/): One word changes into the next, letter by letter. Best for short labels. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#text-morphing).+- [Text Gradient Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-gradient-animation/): Colors flow through the letters while the text stays still. Best for headlines. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#text-gradient-animation).+- [Outline to Fill](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/outline-to-fill/): Hollow letters fill with color, as a wipe or a fade. Best for big headlines. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#outline-to-fill).+- [Enter/Exit Typography](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/enter-exit-typography/): Each phrase comes in, stays long enough to read, then leaves. Best for slogans. Places: Text, Page intros. Entry in [05-text-typography.md](05-text-typography.md#enterexit-typography).+- [Rotate Word Carousel](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/rotate-word-carousel/): One word in a sentence keeps swapping for the next. Best for hero headlines. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#rotate-word-carousel).+- [Glitch Text](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/glitch-text/): Text tears into red and cyan strips like a broken signal. Best for bold titles. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#glitch-text).+- [Text on a Path](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-on-path/): Text travels along a wave, an arc or a circle. Best for badges and seals. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#text-on-a-path).+- [Wavy Text](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/wavy-text/): A wave rolls through the word, letter by letter. Best for playful titles. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#wavy-text).+- [Highlighter Sweep](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/highlighter-sweep/): A marker sweeps in behind the key words, one after another. Best for key points. Places: Text. Entry in [05-text-typography.md](05-text-typography.md#highlighter-sweep).+- [Split-Flap Board](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/split-flap-board/): Tiles flip through the letters to spell a word, like an airport board. Best for hero titles. Places: Text, Page intros. Entry in [05-text-typography.md](05-text-typography.md#split-flap-board).+- [Neon Flicker](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/neon-flicker/): Glowing letters sputter now and then, like a worn neon sign. Best for night themes. Places: Text, Backgrounds. Entry in [05-text-typography.md](05-text-typography.md#neon-flicker).+- [Handwriting Draw](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/handwriting-draw/): A word writes itself stroke by stroke, as if by a pen. Best for greetings and signatures. Places: Text, Page intros. Entry in [05-text-typography.md](05-text-typography.md#handwriting-draw).+- [Text Particles](https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-particles/): A word of dots scatters from your pointer and springs back. Best for intros. Places: Text, Page intros. Entry in [05-text-typography.md](05-text-typography.md#text-particles).++## 06 · 3D & Advanced++WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects. 26 animations, in [06-3d-advanced.md](06-3d-advanced.md).++- [3D Model Orbit](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/3d-model-orbit/): A lit 3D shape spins, or turns to face your pointer. Best for product views. Places: Images & cards. Entry in [06-3d-advanced.md](06-3d-advanced.md#3d-model-orbit).+- [Scroll-Driven 3D Rotation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/scroll-driven-3d-rotation/): Scrolling turns a 3D cube from pose to pose. Best for product tours. Places: Scrolling, Images & cards. Entry in [06-3d-advanced.md](06-3d-advanced.md#scroll-driven-3d-rotation).+- [Parallax 3D Tilt](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/parallax-3d-tilt/): A card tilts toward your pointer, and a light slides over it. Best for cards. Places: Images & cards. Entry in [06-3d-advanced.md](06-3d-advanced.md#parallax-3d-tilt).+- [Canvas Particle Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/canvas-particle-effect/): Dots drift, link up when close, and dodge your pointer. Best for tech sites. Places: Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#canvas-particle-effect).+- [Fluid / Liquid Simulation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/fluid-simulation/): Blobs drift and melt into each other like liquid. Best for hero backgrounds. Places: Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#fluid--liquid-simulation).+- [Glassmorphism Animated](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/glassmorphism-animated/): Frosted glass cards blur the colors behind them. Best for cards and panels. Places: Images & cards, Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#glassmorphism-animated).+- [WebGL Shader Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/webgl-shader-animation/): Moving color patterns computed for every pixel. Best for bold backgrounds. Places: Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#webgl-shader-animation).+- [Noise-Based Motion](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/noise-based-motion/): Smooth noise makes dots sway and a blob ripple. Best for calm backgrounds. Places: Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#noise-based-motion).+- [SVG Path Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/svg-path-animation/): A line drawing draws itself, stroke by stroke. Best for icons and logos. Places: Images & cards, Page intros. Entry in [06-3d-advanced.md](06-3d-advanced.md#svg-path-animation).+- [Chromatic Aberration](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/chromatic-aberration/): A word splits into red, green and blue fringes. Best for bold titles. Places: Text. Entry in [06-3d-advanced.md](06-3d-advanced.md#chromatic-aberration).+- [2.5D / Pseudo-3D](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/2-5d-pseudo-3d/): Flat layers slide by different amounts, faking depth. Best for hero scenes. Places: Images & cards. Entry in [06-3d-advanced.md](06-3d-advanced.md#25d--pseudo-3d).+- [Ray Marching / SDF Scene](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/ray-marching-sdf/): A 3D scene drawn only from formulas, circled by a camera. Best for art pages. Places: Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#ray-marching--sdf-scene).+- [GPGPU Particle System](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/gpgpu-particle-system/): Tens of thousands of particles flow on the graphics chip. Best for hero effects. Places: Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#gpgpu-particle-system).+- [Image Distortion on Hover](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/image-distortion-hover/): The picture ripples and bends around your pointer. Best for portfolio images. Places: Images & cards. Entry in [06-3d-advanced.md](06-3d-advanced.md#image-distortion-on-hover).+- [Cloth / Soft-Body Simulation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/cloth-simulation/): A cloth sways in the wind, and you can drag it around. Best for playful pages. Places: Images & cards. Entry in [06-3d-advanced.md](06-3d-advanced.md#cloth--soft-body-simulation).+- [Volumetric Smoke / 3D Noise](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/volumetric-smoke/): Soft smoke curls upward, drawn as a real 3D cloud. Best for moody backgrounds. Places: Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#volumetric-smoke--3d-noise).+- [Morphing Blob](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/morphing-blob/): Blobs melt together, and one drop chases your pointer. Best for hero sections. Places: Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#morphing-blob).+- [3D Flip Card](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/flip-card-3d/): A card turns over in 3D to show its back. Best for profile and product cards. Places: Images & cards. Entry in [06-3d-advanced.md](06-3d-advanced.md#3d-flip-card).+- [3D Carousel](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/carousel-3d/): Cards stand in a ring that spins in 3D as you drag it. Best for image galleries. Places: Images & cards. Entry in [06-3d-advanced.md](06-3d-advanced.md#3d-carousel).+- [Depth-Map Photo](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/depth-map-photo/): A flat photo turns 3D as you point: near parts shift more. Best for hero images. Places: Images & cards, Page intros. Entry in [06-3d-advanced.md](06-3d-advanced.md#depth-map-photo).+- [Flocking](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/flocking/): Birds swirl and turn together as one flock. Best for calm backgrounds. Places: Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#flocking).+- [ASCII / Halftone](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/ascii-halftone/): A moving picture is redrawn with letters or dots. Best for retro and tech looks. Places: Images & cards, Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#ascii--halftone).+- [2D Physics](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/physics-2d/): Balls drop where you click, bounce and pile up. Best for playful intros. Places: Page intros, Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#2d-physics).+- [Liquid Glass](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/liquid-glass/): Drag a glass panel and the picture behind it bends at the edges. Best for cards. Places: Images & cards, Menus & forms. Entry in [06-3d-advanced.md](06-3d-advanced.md#liquid-glass).+- [Holographic Card](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/holographic-card/): A card tilts as you point, and its rainbow foil shimmers. Best for collectibles. Places: Images & cards. Entry in [06-3d-advanced.md](06-3d-advanced.md#holographic-card).+- [Infinite Zoom](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/infinite-zoom/): The view keeps zooming into pictures inside pictures. Best for page intros. Places: Page intros, Backgrounds. Entry in [06-3d-advanced.md](06-3d-advanced.md#infinite-zoom).++## 07 · Ambient & Background++Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows. 23 animations, in [07-ambient-background.md](07-ambient-background.md).++- [Animated Gradient Background](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/animated-gradient-background/): Colors slowly drift across a soft gradient background. Best for hero sections. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#animated-gradient-background).+- [Mesh Gradient Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/mesh-gradient/): Blurred blobs of color drift and melt together. Best for landing pages. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#mesh-gradient-animation).+- [Aurora / Northern Lights](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/aurora/): Blurred bands of light sway like the northern lights. Best for dark backgrounds. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#aurora--northern-lights).+- [Grain / Film Noise Overlay](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/grain-overlay/): Fine grain flickers over the page, like old film. Best for editorial sites. Places: Backgrounds, Images & cards. Entry in [07-ambient-background.md](07-ambient-background.md#grain--film-noise-overlay).+- [Scanline Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/scanline/): Dark lines and a sweeping beam imitate an old TV screen. Best for retro sites. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#scanline-effect).+- [Light Leak](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/light-leak/): Warm light washes in from a corner at random times. Best for photo sites. Places: Backgrounds, Images & cards. Entry in [07-ambient-background.md](07-ambient-background.md#light-leak).+- [Starfield / Space Particles](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/starfield/): Stars stream toward you out of the dark. Best for space themes. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#starfield--space-particles).+- [Breathing / Pulsing Glow](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/breathing-glow/): A soft glow slowly grows and shrinks, like calm breathing. Best for idle states. Places: Backgrounds, Loading & messages. Entry in [07-ambient-background.md](07-ambient-background.md#breathing--pulsing-glow).+- [Ambient Ripple Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ambient-ripple/): Rings spread from a few spots, like drops on a still pond. Best for hero areas. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#ambient-ripple-effect).+- [Floating Elements](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/floating-elements/): Small shapes drift slowly, each on its own path. Best for hero backgrounds. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#floating-elements).+- [Grid / Dot Pattern Parallax](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/grid-dot-pattern-parallax/): A dot grid shifts gently against your pointer for depth. Best for tech sites. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#grid--dot-pattern-parallax).+- [Abstract Geometric Motion](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/abstract-geometric-motion/): Shapes turn, spread and flow in a calm, endless pattern. Best for music players. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#abstract-geometric-motion).+- [Particle Constellation](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/particle-constellation/): Drifting dots link up with lines whenever they come close. Best for tech sites. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#particle-constellation).+- [Flow Field](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/flow-field/): Particles ride invisible currents, leaving fading trails. Best for art pages. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#flow-field).+- [Synthwave Grid](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/synthwave-grid/): A glowing grid rolls toward you under a striped sun. Best for music and games. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#synthwave-grid).+- [Matrix Rain](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/matrix-rain/): Columns of glowing characters rain down a dark screen. Best for tech themes. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#matrix-rain).+- [Plasma Field](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/plasma/): Smooth waves of color flow endlessly, made from math. Best for creative sites. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#plasma-field).+- [Wave Layers](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/wave-layers/): Layers of waves drift sideways, each at its own speed. Best for hero sections. Places: Backgrounds, Page intros. Entry in [07-ambient-background.md](07-ambient-background.md#wave-layers).+- [Snow / Rain](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/snow-rain/): Snow drifts down, or rain falls in streaks, over a dark town. Best for seasonal pages. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#snow--rain).+- [Fireworks](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fireworks/): Rockets rise and burst into glowing sparks that fall and fade. Best for celebrations. Places: Backgrounds, Page intros. Entry in [07-ambient-background.md](07-ambient-background.md#fireworks).+- [Topographic Lines](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/topographic-lines/): Lines like those on a hiking map slowly bend and drift. Best for outdoor brands. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#topographic-lines).+- [Light Rays](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/light-rays/): Soft beams of light fall from above and slowly sweep across. Best for hero intros. Places: Backgrounds, Page intros. Entry in [07-ambient-background.md](07-ambient-background.md#light-rays).+- [Game of Life](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/game-of-life/): Cells live and die by their neighbors, and patterns grow. Best for tech sites. Places: Backgrounds. Entry in [07-ambient-background.md](07-ambient-background.md#game-of-life).++## By place++The home page's places, each with the animations that suit it.++- **Buttons** (22): Hover State Animation, Click / Tap Ripple, Button Press Scale, Magnetic Button, Toggle / Switch Slide, Heart / Like Burst, Success Confetti, Notification Badge Pulse, Tooltip Reveal, Modal Expand, Hamburger Menu Toggle, Theme Toggle Morph, Copy to Clipboard, Star Rating, Segmented Control, Animated Gradient Border, Spotlight Hover Glow, Add-to-Cart Fly, Hold to Confirm, Expanding Search, Button Loading States, Gooey Menu+- **Text** (27): Counter Animation, Text Fill on Scroll, Slide Up Reveal, Split Text Reveal, Letter-by-Letter Stagger, Word-by-Word Reveal, Rolling Numbers, Kinetic Typography, Typewriter Effect, Scramble / Glitch Text, Variable Font Morph, Text Clip-Path Reveal, Marquee / Ticker, Text Morphing, Text Gradient Animation, Outline to Fill, Enter/Exit Typography, Rotate Word Carousel, Glitch Text, Text on a Path, Wavy Text, Highlighter Sweep, Split-Flap Board, Neon Flicker, Handwriting Draw, Text Particles, Chromatic Aberration+- **Images & cards** (44): Parallax Depth-of-Field, Parallax Scrolling, Reverse-Scrolling Columns, Stacking Cards, Snap Scrolling, Reveal on Scroll, Stagger Reveal, Horizontal Scroll, Zoom Into Image, Scroll Image Sequence, Scroll Velocity Skew, Clip-Path Reveal, Blur In, Flip In, Shatter Effect, Shared Element Transition, Blur Transition, Dissolve Transition, FLIP Technique, Page Curl, Cube Transition, Hover State Animation, Skeleton Loader, Modal Expand, Swipe to Dismiss, Animated Gradient Border, Spotlight Hover Glow, Image Trail, 3D Model Orbit, Scroll-Driven 3D Rotation, Parallax 3D Tilt, Glassmorphism Animated, SVG Path Animation, 2.5D / Pseudo-3D, Image Distortion on Hover, Cloth / Soft-Body Simulation, 3D Flip Card, 3D Carousel, Depth-Map Photo, ASCII / Halftone, Liquid Glass, Holographic Card, Grain / Film Noise Overlay, Light Leak+- **Backgrounds** (39): Scroll-Driven Background Color, Cursor Follower, Neon Flicker, Canvas Particle Effect, Fluid / Liquid Simulation, Glassmorphism Animated, WebGL Shader Animation, Noise-Based Motion, Ray Marching / SDF Scene, GPGPU Particle System, Volumetric Smoke / 3D Noise, Morphing Blob, Flocking, ASCII / Halftone, 2D Physics, Infinite Zoom, Animated Gradient Background, Mesh Gradient Animation, Aurora / Northern Lights, Grain / Film Noise Overlay, Scanline Effect, Light Leak, Starfield / Space Particles, Breathing / Pulsing Glow, Ambient Ripple Effect, Floating Elements, Grid / Dot Pattern Parallax, Abstract Geometric Motion, Particle Constellation, Flow Field, Synthwave Grid, Matrix Rain, Plasma Field, Wave Layers, Snow / Rain, Fireworks, Topographic Lines, Light Rays, Game of Life+- **Menus & forms** (20): Cover Card to Fixed Header, Scrollspy Navigation, Hide-on-Scroll Header, Slide In, Scale In / Zoom In, Focus Ring Animation, Toggle / Switch Slide, Checkmark Draw, Form Field Morph, Drawer / Panel Slide, Accordion Open/Close, Error Shake, Hamburger Menu Toggle, Star Rating, Segmented Control, Drag to Reorder, Expanding Search, Gooey Menu, Dynamic Island, Liquid Glass+- **Loading & messages** (20): Progress Bar, Slide In, Bounce In, Heart / Like Burst, Success Confetti, Skeleton Loader, Shimmer Effect, Loading Spinner, Progress Animation, Checkmark Draw, Notification Badge Pulse, Error Shake, Copy to Clipboard, Toast Notification, Pull to Refresh, Rolling Numbers, Typing Indicator, Button Loading States, Dynamic Island, Breathing / Pulsing Glow+- **Page intros** (28): Fade In / Fade Out, Slide In, Slide Up Reveal, Scale In / Zoom In, Clip-Path Reveal, Curtain Reveal, Split Text Reveal, Letter-by-Letter Stagger, Word-by-Word Reveal, Blur In, Flip In, Bounce In, Rotate In, Image Trail, Kinetic Typography, Typewriter Effect, Text Clip-Path Reveal, Enter/Exit Typography, Split-Flap Board, Handwriting Draw, Text Particles, SVG Path Animation, Depth-Map Photo, 2D Physics, Infinite Zoom, Wave Layers, Fireworks, Light Rays+- **Scrolling** (28): Parallax Depth-of-Field, Parallax Scrolling, Reverse-Scrolling Columns, Cover Card to Fixed Header, Fly-in Fly-out Contact List, Stacking Cards, Scroll-Triggered Animation, Scrub Animation, Pin Animation, Snap Scrolling, Scrollytelling, Reveal on Scroll, Stagger Reveal, Horizontal Scroll, Sticky Section, Counter Animation, Progress Bar, Section Wipe, Zoom Into Image, Scroll Image Sequence, Smooth (Inertia) Scroll, Text Fill on Scroll, Scroll Velocity Skew, SVG Line Draw on Scroll, Scrollspy Navigation, Scroll-Driven Background Color, Hide-on-Scroll Header, Scroll-Driven 3D Rotation+- **Page changes** (17): Shatter Effect, View Transitions API, Shared Element Transition, Morph Transition, Crossfade Transition, Slide Transition, Zoom Transition, Flash / Light Leak Transition, Blur Transition, Elastic Transition, Portal / Tunnel Zoom, Dissolve Transition, FLIP Technique, Circle Reveal, Overlay Wipe, Page Curl, Cube Transitiondiff --git a/tests/skill.test.js b/tests/skill.test.jsnew file mode 100644index 00000000..bcedd022--- /dev/null+++ b/tests/skill.test.js@@ -0,0 +1,171 @@+// Checks the AI skill (skills/animation-handbook/) and llms.txt, which tools/make-skill.mjs writes from the pages and the+// home page's cards.+// Run from the repo root: node --test "tests/*.test.js"+const test = require('node:test');+const assert = require('node:assert/strict');+const fs = require('node:fs');+const path = require('node:path');+const { pathToFileURL } = require('node:url');+const vm = require('node:vm');++const ROOT = path.resolve(__dirname, '..');+const ANIM = path.join(ROOT, 'animations');+const SKILL = path.join(ROOT, 'skills', 'animation-handbook');+const REFS = path.join(SKILL, 'references');+const LIVE = 'https://matinmonshizadeh.github.io/animation-handbook/';+const TOOL = 'node tools/make-skill.mjs';+// A file's text with Windows line endings read as plain ones: a checkout may hold either.+const read = f => fs.readFileSync(f, 'utf8').replace(/\r\n/g, '\n');+const decode = s => s.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');+// The part of s from the first `from` up to the next `to` after it ('' when `from` is missing).+const between = (s, from, to) => {+ const start = s.indexOf(from);+ if (start < 0) return '';+ const end = s.indexOf(to, start + from.length);+ return s.slice(start, end < 0 ? undefined : end);+};+// Every file under dir, as paths from the repo root written with "/".+const filesUnder = dir => !fs.existsSync(dir) ? [] : fs.readdirSync(dir, { withFileTypes: true }).flatMap(e =>+ e.isDirectory() ? filesUnder(path.join(dir, e.name)) : [path.relative(ROOT, path.join(dir, e.name)).split(path.sep).join('/')]);++const categories = fs.readdirSync(ANIM, { withFileTypes: true }).filter(c => c.isDirectory()).map(c => c.name);+const pages = categories.flatMap(cat => fs.readdirSync(path.join(ANIM, cat), { withFileTypes: true }).filter(d => d.isDirectory())+ .map(d => ({ cat, slug: d.name, file: path.join(ANIM, cat, d.name, 'index.html') })))+ .filter(d => fs.existsSync(d.file) && read(d.file).includes('<main class="hb-page">'));+const liveAddress = d => `${LIVE}animations/${d.cat}/${d.slug}/`;++const HOME = read(path.join(ROOT, 'index.html'));+// Where the bracket that opens at HOME[from] ('[' or '{') is closed, stepping over strings and // comments (as in pages.test.js).+function blockEnd(from) {+ const open = HOME[from], close = open === '[' ? ']' : '}';+ let depth = 0, i = from, quote = null;+ for (; i < HOME.length; i++) {+ const ch = HOME[i];+ if (quote) { if (ch === '\\') i++; else if (ch === quote) quote = null; continue; }+ if (ch === '/' && HOME[i + 1] === '/') { while (i < HOME.length && HOME[i] !== '\n') i++; continue; }+ if (ch === "'" || ch === '"' || ch === '`') quote = ch;+ else if (ch === open) depth++;+ else if (ch === close && --depth === 0) break;+ }+ return i;+}+// The value of `const NAME=` in the home page's script: an array or object literal of plain data, read with vm.+function homeConst(name) {+ const start = HOME.indexOf(`const ${name}=`);+ assert.ok(start >= 0, `const ${name} in index.html`);+ const from = start + `const ${name}=`.length;+ return vm.runInNewContext('(' + HOME.slice(from, blockEnd(from) + 1) + ')');+}++// The labels of a page's settings: the name of each setting in Try it (the p or label with class hb-setting-name, or the+// words beside a switch), or the label its control sets with data-hb-label. A setting marked data-hb-skip only compares the+// demo with something else and is never copied, so it is left out; one marked hidden shows (and is copied) with some choices+// of another setting, so it counts.+function settingLabels(html) {+ const tryIt = between(html, '<section class="hb-step hb-try"', '<section class="hb-step hb-prompt-step"');+ return tryIt.split('<div class="hb-setting"').slice(1)+ .filter(part => !/^[^>]*\sdata-hb-skip(?=[\s=>])/.test(part))+ .flatMap(part => {+ const own = part.match(/\sdata-hb-label="([^"]+)"/);+ if (own) return [decode(own[1])];+ return [...part.matchAll(/<(p|label) class="hb-setting-name"[^>]*>([^<]*)<\/\1>|<label class="hb-switch-row"><span>([^<]*)<\/span>/g)]+ .map(m => decode((m[2] ?? m[3]).trim()));+ });+}++// The anchors GitHub gives the headings of a file, in order: each heading lowercased, every character but letters, digits,+// spaces, "-" and "_" dropped and each space made a "-", with -1, -2… added to one already used in the file.+function anchors(headings) {+ const seen = new Map();+ return headings.map(h => {+ const slug = h.toLowerCase().replace(/[^\p{L}\p{M}\p{N}_ -]/gu, '').replace(/ /g, '-');+ const n = seen.get(slug) || 0;+ seen.set(slug, n + 1);+ return n ? `${slug}-${n}` : slug;+ });+}++test('the skill and llms.txt are what tools/make-skill.mjs writes from the pages and the home page now', async () => {+ const { buildSkill } = await import(pathToFileURL(path.join(ROOT, 'tools', 'make-skill.mjs')).href);+ const built = buildSkill(ROOT);+ const want = ['skills/animation-handbook/SKILL.md', 'skills/animation-handbook/references/catalog.md',+ ...categories.map(cat => `skills/animation-handbook/references/${cat}.md`), 'llms.txt'];+ assert.deepEqual(Object.keys(built).sort(), want.sort(), 'the files the tool writes');+ const stale = want.filter(rel => !fs.existsSync(path.join(ROOT, rel)) || read(path.join(ROOT, rel)) !== built[rel]);+ assert.deepEqual(stale, [], `files missing or out of date: run ${TOOL}`);+ assert.deepEqual(filesUnder(SKILL).filter(rel => !want.includes(rel)), [], 'files in the skill folder that the tool does not write');+});++test('SKILL.md has only a name, a description and a license, and a short body that links every reference file', () => {+ const text = read(path.join(SKILL, 'SKILL.md'));+ const parts = text.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);+ assert.ok(parts, 'SKILL.md starts with its front matter between two --- lines');+ const fields = parts[1].split('\n').map(line => line.match(/^([a-z-]+): (.+)$/));+ assert.ok(fields.every(Boolean), 'every front matter line is "key: value"');+ const front = Object.fromEntries(fields.map(f => [f[1], f[2]]));+ assert.deepEqual(Object.keys(front), ['name', 'description', 'license']);+ assert.equal(front.name, 'animation-handbook');+ assert.equal(front.name, path.basename(SKILL), 'the name is the folder name');+ assert.match(front.name, /^[a-z0-9]+(?:-[a-z0-9]+)*$/, 'the name is lowercase letters, digits and single hyphens');+ assert.ok(front.name.length <= 64, 'the name has at most 64 characters');+ assert.ok(front.description.length <= 1024, `the description has ${front.description.length} characters, at most 1024`);+ // ": " would start a mapping in the YAML some installers read; < and > would read as XML tags, which some refuse.+ for (const bad of [': ', '<', '>']) assert.ok(!front.description.includes(bad), `the description has no "${bad}"`);+ assert.equal(front.license, 'MIT');+ const body = parts[2].split('\n');+ assert.ok(body.length < 200, `the body has ${body.length} lines, fewer than 200`);+ const files = fs.readdirSync(REFS);+ assert.ok(files.includes('catalog.md'), 'references/catalog.md is there');+ for (const file of files) assert.ok(parts[2].includes(`](references/${file})`), `SKILL.md links references/${file}`);+});++test('every page has one entry in its category file and one line in the catalog, holding its prompt and every setting', () => {+ assert.ok(pages.length > 0, 'there are guided-steps pages');+ const catalog = read(path.join(REFS, 'catalog.md'));+ const problems = [];+ for (const d of pages) {+ const where = `${d.cat}/${d.slug}`, address = liveAddress(d), file = path.join(REFS, `${d.cat}.md`);+ if (!fs.existsSync(file)) { problems.push(`${where}: there is no references/${d.cat}.md`); continue; }+ // The entries of a category file are its "## " sections; each names its page by the live address.+ const entries = read(file).split(/\n(?=## )/).filter(entry => entry.includes(address));+ const lines = catalog.split('\n').filter(line => line.includes(address));+ if (lines.length !== 1) problems.push(`${where}: ${lines.length} lines in catalog.md hold its live address`);+ if (entries.length !== 1) { problems.push(`${where}: ${entries.length} entries in ${d.cat}.md hold its live address`); continue; }+ const html = read(d.file);+ const prompt = decode(html.match(/<p class="hb-prompt">([^<]*)<\/p>/)[1]).replace(/\s+/g, ' ').trim();+ if (!entries[0].includes(`\n${prompt}\n`)) problems.push(`${where}: its entry does not hold the page's prompt word for word`);+ for (const label of settingLabels(html)) {+ if (!entries[0].includes(`\n- ${label}: `)) problems.push(`${where}: its entry has no line for the setting "${label}"`);+ }+ }+ assert.deepEqual(problems, [], `run ${TOOL} after changing a page`);+});++test('llms.txt lists every card once, in the order of CATS, with its live address and its description', () => {+ const text = read(path.join(ROOT, 'llms.txt'));+ const cards = homeConst('CATS').flatMap(cat => cat.entries.map(([slug, , desc]) => ({ address: `${LIVE}${cat.folder}/${slug}/`, desc })));+ assert.ok(text.startsWith('# Animation Handbook\n'), 'llms.txt starts with the title');+ assert.match(text, new RegExp(`^> .*\\b${cards.length}\\b`, 'm'), 'the summary under the title gives the count');+ const lines = text.split('\n').filter(line => line.startsWith(`- [`) && line.includes(`](${LIVE}animations/`));+ assert.equal(lines.length, cards.length, 'one line per card');+ cards.forEach((card, i) => {+ assert.ok(lines[i].includes(`](${card.address}): `), `line ${i + 1} links ${card.address}: ${lines[i]}`);+ assert.ok(lines[i].endsWith(`: ${card.desc}`), `line ${i + 1} ends with the card's description: ${lines[i]}`);+ });+});++test('every reference file over 100 lines starts with a contents list that links each of its sections', () => {+ for (const file of fs.readdirSync(REFS)) {+ const text = read(path.join(REFS, file));+ if (text.split('\n').length <= 100) continue;+ // Every heading takes an anchor, the title and Contents too; the sections are the "## " headings but Contents.+ const all = [...text.matchAll(/^(#+) (.+)$/gm)].map(m => ({ level: m[1].length, heading: m[2] }));+ const slugs = anchors(all.map(h => h.heading));+ const sections = all.map((h, i) => ({ ...h, anchor: slugs[i] })).filter(h => h.level === 2 && h.heading !== 'Contents');+ const top = text.slice(0, text.search(/^## (?!Contents$)/m));+ const links = [...top.matchAll(/\[([^\]]+)\]\(#([^)]+)\)/g)];+ assert.ok(sections.length > 0, `${file} has sections`);+ assert.deepEqual(links.map(m => m[1]), sections.map(s => s.heading), `${file}: the contents before its first section name every section, in order`);+ assert.deepEqual(links.map(m => m[2]), sections.map(s => s.anchor), `${file}: each contents link opens its section`);+ }+});diff --git a/tools/make-skill.mjs b/tools/make-skill.mjsnew file mode 100644index 00000000..c8ff8ba3--- /dev/null+++ b/tools/make-skill.mjs@@ -0,0 +1,394 @@+#!/usr/bin/env node+// Writes the AI skill and llms.txt from the pages and the home page's cards: a development tool, not part of the site.+// Run it from the repo root after adding a page, and after changing any page's prompt, settings, description or Good for+// and Avoid on tags (tests/skill.test.js fails until then).+// Usage: node tools/make-skill.mjs+// It reads CATS, PLACES and PLACE_LIST from the script of index.html (the categories and cards in the home page's order,+// each card's places and the places' names) and every card's page, animations/<category>/<slug>/index.html: its <h1>, its+// one-line description, its kind, its prompt (the words on the page, entities decoded and white space squeezed), its+// Good for and Avoid on tags and its Try it settings. The settings are read by the page script's own readSettings and+// pageCopyText (assets/js/demo-page.js), run on a small stand-in for the browser's DOM built from the page's prompt and+// Try it step, the way the home page reads a page for its cards' Copy prompt: the same controls in the same order, the+// same labels and values, and the same "Settings from the demo: …" line the page copies with its defaults. A setting+// the page shows only for some choices of another one (marked hidden) is listed too, with a note, but is not in that+// line, as on the page.+// It writes skills/animation-handbook/SKILL.md, skills/animation-handbook/references/catalog.md, one+// skills/animation-handbook/references/<category folder>.md per category, and llms.txt at the root. Each is written with+// LF line endings, and only when its text changed; it prints every file with its size. Running it twice changes+// nothing. buildSkill(root), exported for the test, returns the same files as { 'path from the root': 'text' } and+// writes nothing.+// Exit code 1 when a card has no page, a page lacks a part the skill needs, or the skill folder holds a file this tool+// does not write.+import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';+import { createRequire } from 'node:module';+import { dirname, join, relative, resolve, sep } from 'node:path';+import { fileURLToPath } from 'node:url';+import vm from 'node:vm';++const SKILL = 'skills/animation-handbook';+const REPO = 'https://github.com/matinmonshizadeh/animation-handbook';+// How each kind of page runs, in plain words.+const KIND = { once: 'plays once', loop: 'moves by itself', do: 'reacts to the visitor', scroll: 'follows the scroll' };+// What the home page passes as the window when it reads a page it has fetched: styles are not computed, and with no+// matchMedia here the phone defaults do not count. PHONE answers the page script's phone question with yes.+const NO_STYLE = { getComputedStyle: () => ({ display: '' }) };+const PHONE = { getComputedStyle: () => ({ display: '' }), matchMedia: () => ({ matches: true }) };++const squeeze = s => s.replace(/\s+/g, ' ').trim();+const lineCount = text => text.split('\n').length - 1;+const wordCount = text => text.split(/\s+/).filter(Boolean).length;++// Where the bracket that opens at text[from] ('[' or '{') is closed, stepping over strings and // comments (as the tests+// read the home page).+function blockEnd(text, from) {+ const open = text[from], close = open === '[' ? ']' : '}';+ let depth = 0, i = from, quote = null;+ for (; i < text.length; i++) {+ const ch = text[i];+ if (quote) { if (ch === '\\') i++; else if (ch === quote) quote = null; continue; }+ if (ch === '/' && text[i + 1] === '/') { while (i < text.length && text[i] !== '\n') i++; continue; }+ if (ch === "'" || ch === '"' || ch === '`') quote = ch;+ else if (ch === open) depth++;+ else if (ch === close && --depth === 0) break;+ }+ return i;+}+// The value of `const NAME=` in the home page's script: an array or object literal of plain data, read with vm.+function homeConst(home, name) {+ const start = home.indexOf(`const ${name}=`);+ if (start < 0) throw new Error(`index.html has no const ${name}=`);+ const from = start + `const ${name}=`.length;+ return vm.runInNewContext('(' + home.slice(from, blockEnd(home, from) + 1) + ')');+}++// The entities the pages write; any other one stops the build, so a new one is added here rather than copied as it is.+const ENTITIES = { amp: '&', lt: '<', gt: '>', quot: '"', apos: "'", nbsp: '\u00a0' };+function decode(s, where) {+ return s.replace(/&(?:#(\d+)|#[xX]([0-9a-fA-F]+)|([A-Za-z][A-Za-z0-9]*));/g, (all, dec, hex, name) => {+ if (dec || hex) return String.fromCodePoint(parseInt(dec || hex, dec ? 10 : 16));+ if (Object.hasOwn(ENTITIES, name)) return ENTITIES[name];+ throw new Error(`${where}: the entity ${all} is not one this tool reads (add it to ENTITIES in tools/make-skill.mjs)`);+ });+}++// A stand-in for the browser's DOM: just enough of Element and Document for the page script's readSettings and+// pageCopyText. Selectors are lists of compound selectors (a tag, .class, [attr], [attr=value] or [attr="value"]), the only+// kind that script uses.+const SELECTORS = new Map();+function compile(selector) {+ if (!SELECTORS.has(selector)) {+ SELECTORS.set(selector, selector.split(',').map(part => {+ const m = part.trim().match(/^([a-z][\w-]*)?((?:\.[\w-]+|\[[\w-]+(?:=(?:"[^"]*"|[^\]"]+))?\])*)$/i);+ if (!m || !part.trim()) throw new Error(`the stand-in DOM cannot read the selector "${selector}"`);+ const tests = m[1] ? [el => el.tagName === m[1].toLowerCase()] : [];+ for (const [, cls, attr, quoted, bare] of m[2].matchAll(/\.([\w-]+)|\[([\w-]+)(?:=(?:"([^"]*)"|([^\]"]+)))?\]/g)) {+ const value = quoted ?? bare;+ if (cls) tests.push(el => (el.attrs.class || '').split(/\s+/).includes(cls));+ else if (value === undefined) tests.push(el => Object.hasOwn(el.attrs, attr));+ else tests.push(el => el.attrs[attr] === value);+ }+ return el => tests.every(fn => fn(el));+ }));+ }+ return SELECTORS.get(selector);+}+class StandIn {+ constructor(tagName, attrs, parentElement) {+ Object.assign(this, { tagName, attrs, parentElement, childNodes: [], ownerDocument: parentElement ? parentElement.ownerDocument || parentElement : null });+ }+ getAttribute(name) { return Object.hasOwn(this.attrs, name) ? this.attrs[name] : null; }+ hasAttribute(name) { return Object.hasOwn(this.attrs, name); }+ get id() { return this.attrs.id || ''; }+ // With showHidden set on the document, an element marked hidden counts as shown (see readPage).+ get hidden() { return this.hasAttribute('hidden') && !(this.ownerDocument || this).showHidden; }+ get checked() { return this.hasAttribute('checked'); }+ get textContent() { return this.childNodes.map(n => (typeof n === 'string' ? n : n.textContent)).join(''); }+ // The value a field starts with: a text field's value attribute (without line breaks, as the browser keeps it), a+ // textarea's text, a menu's chosen option.+ get value() {+ if (this.tagName === 'textarea') return this.textContent;+ if (this.tagName === 'select') { const o = this.selectedOptions[0]; return o ? o.attrs.value ?? squeeze(o.textContent) : ''; }+ if (this.tagName !== 'input') return undefined;+ if (this.hasAttribute('value')) return this.attrs.value.replace(/[\r\n]/g, '');+ if ((this.attrs.type || '').toLowerCase() === 'range') throw new Error('a slider has no value attribute to start from');+ return '';+ }+ get selectedOptions() {+ const options = this.querySelectorAll('option'), chosen = options.filter(o => o.hasAttribute('selected'));+ if (this.hasAttribute('multiple')) return chosen;+ if (chosen.length) return [chosen[chosen.length - 1]];+ const first = options.find(o => !o.hasAttribute('disabled'));+ return first ? [first] : [];+ }+ *elements() { for (const n of this.childNodes) if (typeof n !== 'string') { yield n; yield* n.elements(); } }+ matches(selector) { return compile(selector).some(test => test(this)); }+ closest(selector) { for (let n = this; n; n = n.parentElement) if (n.matches(selector)) return n; return null; }+ querySelector(selector) { for (const el of this.elements()) if (el.matches(selector)) return el; return null; }+ querySelectorAll(selector) { return [...this.elements()].filter(el => el.matches(selector)); }+ getElementById(id) { for (const el of this.elements()) if (el.attrs.id === id) return el; return null; }+}+const VOID = new Set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'source', 'track', 'wbr']);+// The markup as a stand-in document, read as the browser reads this markup: entities decoded, a void element (input,+// br…) or one written <x/> without an end tag, a textarea's text taken as it is but for its first line break. Every+// other element must be closed in order; anything else stops the build rather than reading the page wrongly.+function standIn(html, where) {+ const doc = new StandIn('#document', {}, null);+ const TOKEN = /<!--[\s\S]*?-->|<\/([a-zA-Z][\w-]*)\s*>|<([a-zA-Z][\w-]*)((?:\s+[^\s"'>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*(\/?)>|[^<]+|</g;+ let node = doc, m;+ while ((m = TOKEN.exec(html))) {+ if (m[1]) {+ if (node.tagName !== m[1].toLowerCase()) throw new Error(`${where}: </${m[1]}> where <${node.tagName}> is open`);+ node = node.parentElement;+ } else if (m[2]) {+ const attrs = {};+ for (const [, name, dq, sq, bare] of m[3].matchAll(/([^\s"'>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)) {+ if (!Object.hasOwn(attrs, name.toLowerCase())) attrs[name.toLowerCase()] = decode(dq ?? sq ?? bare ?? '', where);+ }+ const el = new StandIn(m[2].toLowerCase(), attrs, node);+ node.childNodes.push(el);+ if (el.tagName === 'textarea') {+ const end = html.indexOf('</textarea>', TOKEN.lastIndex);+ if (end < 0) throw new Error(`${where}: a textarea is not closed`);+ el.childNodes.push(decode(html.slice(TOKEN.lastIndex, end), where).replace(/^\n/, ''));+ TOKEN.lastIndex = end + '</textarea>'.length;+ } else if (!VOID.has(el.tagName) && !m[4]) node = el;+ } else if (!m[0].startsWith('<!--')) node.childNodes.push(decode(m[0], where));+ }+ if (node !== doc) throw new Error(`${where}: <${node.tagName}> is not closed`);+ return doc;+}++// The anchor GitHub gives a heading: lowercased, every character but letters, digits, spaces, "-" and "_" dropped, each+// space made a "-", and -1, -2… added to an anchor already used in the same file (`seen` holds those).+function anchor(heading, seen) {+ const slug = heading.toLowerCase().replace(/[^\p{L}\p{M}\p{N}_ -]/gu, '').replace(/ /g, '-');+ const n = seen.get(slug) || 0;+ seen.set(slug, n + 1);+ return n ? `${slug}-${n}` : slug;+}++// One page as the skill tells it: { title, lede, kind, prompt, good, avoid, settings, line } where settings holds one+// { label, text } per setting in Try it (but one marked data-hb-skip, which the page never copies), and line is what+// Copy prompt adds to the prompt with the defaults ('' on a page without settings).+function readPage(root, folder, slug, DemoPage) {+ const where = `${folder}/${slug}`, file = join(root, folder, slug, 'index.html');+ if (!existsSync(file)) throw new Error(`${where}: the card has no page (index.html)`);+ const html = readFileSync(file, 'utf8').replace(/\r\n?/g, '\n'); // as the browser reads it+ const one = (pattern, what) => {+ const m = html.match(pattern);+ if (!m) throw new Error(`${where}: no ${what}`);+ return m;+ };+ const words = (pattern, what) => squeeze(decode(one(pattern, what)[1], where));+ const tags = cls => {+ const list = one(new RegExp(`<ul class="hb-tags ${cls}">([\\s\\S]*?)</ul>`), `<ul class="hb-tags ${cls}">`)[1];+ return [...list.matchAll(/<li>([^<]*)<\/li>/g)].map(m => squeeze(decode(m[1], where)));+ };+ const promptHtml = one(/<p class="hb-prompt">[^<]*<\/p>/, 'prompt (<p class="hb-prompt"> with words only)')[0];+ const tryAt = html.indexOf('<section class="hb-step hb-try"');+ const tryEnd = tryAt < 0 ? -1 : html.indexOf('</section>', tryAt);+ if (tryAt >= 0 && tryEnd < 0) throw new Error(`${where}: the Try it step is not closed`);+ const tryHtml = tryAt < 0 ? '' : html.slice(tryAt, tryEnd + '</section>'.length);+ const doc = standIn(`<main class="hb-page">${promptHtml}${tryHtml}</main>`, where);+ const prompt = squeeze(doc.querySelector('.hb-prompt').textContent);+ const copied = DemoPage.pageCopyText(doc, NO_STYLE);+ if (!copied.startsWith(prompt)) throw new Error(`${where}: Copy prompt does not start with the prompt`);+ // The settings, read once more with the ones marked hidden counted as shown: a page shows such a setting only for some+ // choices of another one (First color and Second color with Two colors, say), and copies it then. The entry lists it+ // too, so that the prompt's words about it have a setting to match; with the defaults it is not copied.+ const tryStep = doc.querySelector('.hb-try');+ doc.showHidden = true;+ const items = tryStep ? DemoPage.readSettings(doc, tryStep, NO_STYLE) : [];+ const phoneItems = tryStep ? DemoPage.readSettings(doc, tryStep, PHONE) : [];+ doc.showHidden = false;+ const settings = items.map(({ label, value, control }, i) => {+ if (!label) throw new Error(`${where}: a setting in Try it has no label (the page leaves it out of Copy prompt)`);+ let text = describe(control, value, phoneItems[i].value);+ for (let n = control; n !== tryStep; n = n.parentElement) {+ if (n.hasAttribute('hidden')) { text += ' (only with some choices of another setting)'; break; }+ }+ return { label, text };+ });+ return {+ title: words(/<h1>([^<]*)<\/h1>/, '<h1>'),+ lede: words(/<p class="hb-lede">([^<]*)<\/p>/, 'one-line description (<p class="hb-lede">)'),+ kind: one(/<body class="hb" data-hb-kind="(once|loop|do|scroll)"/, 'page kind (data-hb-kind on the body)')[1],+ prompt, good: tags('hb-good'), avoid: tags('hb-avoid'), settings,+ line: copied.slice(prompt.length).replace(/^\n\n/, '')+ };+}++// A setting's choices in plain words: the default in bold, the phone default named where a page starts lower there.+function describe(control, value, phoneValue) {+ const phone = phoneValue !== value ? ` (phones start with ${phoneValue})` : '';+ const choice = el => el.getAttribute('aria-label') || squeeze(el.textContent); // as the page script names a choice+ if (control.matches('.seg, .swatches')) {+ const pressed = control.querySelector('.on, [aria-pressed="true"]');+ return control.querySelectorAll('button').map(b => (b === pressed ? `**${choice(b)}**` : choice(b))).join(' · ') + phone;+ }+ if (control.matches('input[type=checkbox]')) return (value === 'on' ? '**on** · off' : 'on · **off**') + phone;+ if (control.matches('input[type=text]')) {+ const start = squeeze(control.value);+ return (start ? `text field, starts as "${start}"` : 'text field, starts empty') + phone;+ }+ if (control.matches('textarea')) { // its lines kept apart: the page copies them on one line, but they are lines+ const lines = control.value.split('\n').map(squeeze).filter(Boolean).map(line => `"${line}"`);+ if (lines.length < 2) return (lines.length ? `text box, starts as ${lines[0]}` : 'text box, starts empty') + phone;+ return `text box, starts with the lines ${lines.slice(0, -1).join(', ')} and ${lines[lines.length - 1]}` + phone;+ }+ if (control.matches('select')) {+ const chosen = control.selectedOptions[0];+ return control.querySelectorAll('option').map(o => (o === chosen ? `**${squeeze(o.textContent)}**` : squeeze(o.textContent))).join(' · ') + phone;+ }+ return `slider, starts at ${value}` + phone;+}++function entry(page) {+ const lines = [`## ${page.title}`, '', page.lede, '',+ `- Live demo: ${page.address}`,+ `- How it runs: ${KIND[page.kind]}`,+ `- Good for: ${page.good.join(' · ')}`,+ `- Avoid on: ${page.avoid.join(' · ')}`,+ '', '**Prompt**', '', page.prompt, ''];+ if (!page.settings.length) lines.push('**Settings**: none. The page has no settings, so the prompt is complete as it is.', '');+ else {+ lines.push('**Settings** (the defaults in bold):', '', ...page.settings.map(s => `- ${s.label}: ${s.text}`), '');+ if (page.line) lines.push('Copied from the site with the defaults, the prompt ends with this line:', '', page.line, '');+ }+ return lines;+}++const SKILL_BODY = ({ total, base, cats }) => `# Animation Handbook++[Animation Handbook](${base}) is a free reference of ${total} web animation techniques. On the site, each one has a page where it plays live, a few plain settings for most of them (speed, direction, color and the like) and a prompt that says in plain words how to build it, with no code. This skill holds all of those prompts and settings, so you can build any of the techniques in the user's own project.++## How to use it++1. **Find the technique** in [references/catalog.md](references/catalog.md): one line per animation, with what it does, what it is best for and its places, the parts of a page it suits (${cats.places}). Match both what the user describes and where it goes. When two fit equally well, build one and mention the other.+2. **Read its entry** in the category file the catalog line names: the prompt, the settings with their defaults, how it runs, what it is good for and what to avoid it on. If the user's place is on its Avoid on list, say so and suggest a better fit from the catalog.+3. **Choose the settings** from the user's words: "a panel that slides in slowly from the left" picks the slow speed and the left side. Keep the default (in bold) for anything they did not mention, and ask only when a choice changes the result a lot and nothing they said points either way. The choices are named, not numbered, so turn each into values that fit its name and the project.+4. **Build it** in the user's own stack, from plain HTML, CSS and JavaScript to React, Vue, Svelte or whatever the project already uses. Follow the prompt as the specification, with the user's own element in place of each [part in square brackets]. "Match the settings listed below" means the settings from step 3; the line at the end of each entry shows how the site lists them.+5. **Check it** against the rules below, then tell the user which technique you built, with its live demo address, and which settings you chose.++## The rules every animation follows++The handbook's demos follow these rules and the prompts take them for granted, so keep them even where a prompt does not repeat them.++- **Animate transform and opacity only.** Move, scale, rotate and fade; never animate width, height, top, left or box-shadow, which make the browser lay out or repaint the page on every frame.+- **Move a JavaScript frame loop by elapsed time.** Each frame moves by the time since the last one, capped at about 50 ms, never by a fixed step per frame, so it runs at the same speed on a 30 Hz, 60 Hz or 120 Hz screen.+- **Follow reduced motion.** When the device asks for reduced motion, show the end state or a short fade instead of the movement, and start loops paused.+- **Give a hover or a drag a touch equivalent.** A hover effect also works with a tap, and a drag uses pointer events so that touch works too.+- **Make it work from the keyboard.** An effect that follows the pointer or shows on hover also shows on keyboard focus, and the arrow keys move what follows the pointer. An effect that starts on a press also starts on Enter or Space, from the middle of the control.+- **Keep controls at least 44×44 px on phones**, buttons and handles drawn inside the animation included.+- **Keep text at least 4.5:1 against its background.**+- **Give heavy effects a lighter phone version.** A big blur, many particles or a shader gets a lighter version on phones, which are up to 600 px wide, or up to 500 px tall when held sideways.+- **Add no library the project does not already use.** Every prompt works with plain code; use GSAP, Framer Motion, Three.js or the like only where the project has it.++## Where to look++- [references/catalog.md](references/catalog.md): all ${total} in one list, grouped by category, with an index by place.+${cats.lines}++The end of each live demo address (animations/02-entrance-and-exit/rotate-in/, for example) is also the technique's folder in the repository, ${REPO}: it holds the demo's own code and a README on how it works, the values that matter and production notes.+`;++export function buildSkill(root) {+ const DemoPage = createRequire(import.meta.url)(join(root, 'assets/js/demo-page.js'));+ const home = readFileSync(join(root, 'index.html'), 'utf8');+ const base = (home.match(/<link rel="canonical" href="([^"]+\/)">/) || [])[1];+ if (!base) throw new Error('index.html has no canonical address ending in /');+ const CATS = homeConst(home, 'CATS'), PLACES = homeConst(home, 'PLACES');+ const placeName = Object.fromEntries(homeConst(home, 'PLACE_LIST').map(p => [p.key, p.name]));+ const total = CATS.reduce((n, cat) => n + cat.entries.length, 0);++ // Every category with its pages, each page with its address, places and anchor in its category file.+ const cats = CATS.map(cat => {+ const folder = cat.folder.replace(/\/$/, ''), file = `${folder.split('/').pop()}.md`;+ // The anchors of the file's title and its Contents heading come before the entries'.+ const seen = new Map();+ for (const heading of [`${cat.n} · ${cat.name}`, 'Contents']) anchor(heading, seen);+ const pages = cat.entries.map(([slug]) => {+ const page = readPage(root, folder, slug, DemoPage);+ const places = (PLACES[slug] || []).map(key => placeName[key]);+ if (!places.length || places.includes(undefined)) throw new Error(`${folder}/${slug}: no known place in PLACES`);+ return { ...page, slug, address: `${base}${folder}/${slug}/`, places, anchor: anchor(page.title, seen) };+ });+ return { ...cat, file, pages };+ });++ const files = {};+ files[`${SKILL}/SKILL.md`] = [+ '---',+ 'name: animation-handbook',+ `description: Builds web animations from Animation Handbook, a set of ${total} tested techniques with plain-words build prompts and settings (scroll effects, entrances and exits, page transitions, micro-interactions for buttons and forms, text effects, 3D and WebGL, ambient backgrounds). Use when the user asks to add, pick or improve an animation, transition, hover or click effect, loading state, scroll effect or background motion in a web page or app, in any framework or plain HTML, CSS and JavaScript.`,+ 'license: MIT',+ '---',+ '',+ SKILL_BODY({ total, base, cats: {+ places: Object.values(placeName).join(', '),+ lines: cats.map(cat => `- [references/${cat.file}](references/${cat.file}): ${cat.name}, ${cat.pages.length} animations. ${cat.desc}`).join('\n')+ } })+ ].join('\n');++ const seen = new Map();+ anchor('Catalog', seen); // the file's title+ const sections = [...cats.map(cat => `${cat.n} · ${cat.name}`), 'By place'].map(h => ({ heading: h, anchor: anchor(h, seen) }));+ const byPlace = Object.entries(placeName).map(([key, name]) => {+ const names = cats.flatMap(cat => cat.pages.filter(p => (PLACES[p.slug] || []).includes(key)).map(p => p.title));+ return `- **${name}** (${names.length}): ${names.join(', ')}`;+ });+ files[`${SKILL}/references/catalog.md`] = [+ '# Catalog', '',+ `All ${total} animations of Animation Handbook, in the home page's order and grouped by category. Each line gives the name (linked to its live demo), what it does and what it is best for, its places (the parts of a page it suits, the main one first), and the file that holds its full entry with the prompt and the settings.`, '',+ `Contents: ${sections.map(s => `[${s.heading}](#${s.anchor})`).join(' · ')}`, '',+ ...cats.flatMap(cat => [`## ${cat.n} · ${cat.name}`, '', `${cat.desc} ${cat.pages.length} animations, in [${cat.file}](${cat.file}).`, '',+ ...cat.pages.map(p => `- [${p.title}](${p.address}): ${p.lede} Places: ${p.places.join(', ')}. Entry in [${cat.file}](${cat.file}#${p.anchor}).`), '']),+ '## By place', '', "The home page's places, each with the animations that suit it.", '', ...byPlace, ''+ ].join('\n');++ for (const cat of cats) {+ files[`${SKILL}/references/${cat.file}`] = [+ `# ${cat.n} · ${cat.name}`, '',+ `${cat.desc} ${cat.pages.length} animations from Animation Handbook, in the home page's order. Each entry gives the live demo, how it runs, what it is good for and what to avoid it on, the prompt from its page word for word, and its settings.`, '',+ '## Contents', '', ...cat.pages.map(p => `- [${p.title}](#${p.anchor})`), '',+ ...cat.pages.flatMap(entry)+ ].join('\n');+ }++ files['llms.txt'] = [+ '# Animation Handbook', '',+ `> A visual reference of ${total} web animation techniques, each with a live demo and a plain-words prompt for building it with an AI assistant.`, '',+ `Each page plays one technique live and gives a ready-made prompt that describes it in plain words, with no code. Most pages also have a few plain settings, such as speed or direction, and the prompt you copy lists your choices. Each technique's folder on GitHub has a README on how it works, the values that matter and production notes. To give an AI coding assistant all ${total} prompts and settings at once, install the Agent Skill: \`npx skills add matinmonshizadeh/animation-handbook\`.`, '',+ ...CATS.flatMap(cat => [`## ${cat.name}`, '',+ ...cat.entries.map(([slug, name, desc]) => `- [${name}](${base}${cat.folder.replace(/\/$/, '')}/${slug}/): ${desc}`), '']),+ '## Optional', '',+ `- [Source on GitHub](${REPO}): every demo's code, each technique's README and the Agent Skill`, ''+ ].join('\n');+ return files;+}++// Run as a command, not imported by the test: write the files that changed and print them all.+if (process.argv[1] && resolve(process.argv[1]).toLowerCase() === fileURLToPath(import.meta.url).toLowerCase()) {+ const ROOT = fileURLToPath(new URL('..', import.meta.url));+ try {+ const files = buildSkill(ROOT);+ for (const [rel, text] of Object.entries(files)) {+ const file = join(ROOT, rel);+ const old = existsSync(file) ? readFileSync(file, 'utf8').replace(/\r\n/g, '\n') : null;+ if (old !== text) {+ mkdirSync(dirname(file), { recursive: true });+ writeFileSync(file, text);+ }+ console.log(`${rel}: ${lineCount(text)} lines, ${wordCount(text)} words${old === null ? ' (new)' : old === text ? '' : ' (written)'}`);+ }+ // The skill folder holds only what this tool writes: a stray file (a category that was renamed, say) is named here.+ const under = dir => readdirSync(dir, { withFileTypes: true }).flatMap(e =>+ e.isDirectory() ? under(join(dir, e.name)) : [relative(ROOT, join(dir, e.name)).split(sep).join('/')]);+ const stray = under(join(ROOT, SKILL)).filter(rel => !Object.hasOwn(files, rel));+ for (const rel of stray) console.error(`${rel}: not written by this tool; remove it`);+ if (stray.length) process.exitCode = 1;+ } catch (err) {+ console.error(err.message);+ process.exitCode = 1;+ }+}