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: the home page knows where each animation can go (PLACES) and its eight first picks (PICKS)
matin894ce7d55095
diff --git a/index.html b/index.htmlindex caf6b9ca..939f55ef 100644--- a/index.html+++ b/index.html@@ -1094,6 +1094,148 @@ const PV={'particle-constellation':'particles','flow-field':'flow','synthwave-grid':'synth'};+// Where each animation can go: the place keys of the home page's tiles (the first one labels its card).+const PLACES={+ // 01+ 'parallax-depth-of-field':['scroll','imgcard'],+ 'parallax-scrolling':['scroll','imgcard'],+ 'reverse-scrolling-columns':['scroll','imgcard'],+ 'cover-card-to-fixed-header':['scroll','menu'],+ 'fly-in-fly-out-contact-list':['scroll'],+ 'stacking-cards':['scroll','imgcard'],+ 'scroll-trigger':['scroll'],+ 'scrub-animation':['scroll'],+ 'pin-animation':['scroll'],+ 'snap-scrolling':['scroll','imgcard'],+ 'scrollytelling':['scroll'],+ 'reveal-on-scroll':['scroll','imgcard'],+ 'stagger-reveal':['scroll','imgcard'],+ 'horizontal-scroll':['scroll','imgcard'],+ 'sticky-section':['scroll'],+ 'counter-animation':['scroll','text'],+ 'progress-bar':['scroll','load'],+ 'section-wipe':['scroll'],+ 'zoom-into-image':['scroll','imgcard'],+ 'scroll-image-sequence':['scroll','imgcard'],+ 'smooth-scroll':['scroll'],+ 'text-fill-on-scroll':['scroll','text'],+ 'scroll-velocity-skew':['scroll','imgcard'],+ 'svg-line-draw':['scroll'],+ 'scrollspy-nav':['scroll','menu'],+ 'scroll-background-color':['scroll','bg'],+ // 02+ 'fade-in-out':['intro'],+ 'slide-in':['intro','menu','load'],+ 'slide-up-reveal':['intro','text'],+ 'scale-in':['intro','menu'],+ 'clip-path-reveal':['intro','imgcard'],+ 'curtain-reveal':['intro'],+ 'split-text-reveal':['intro','text'],+ 'letter-by-letter-stagger':['intro','text'],+ 'word-by-word-reveal':['intro','text'],+ 'blur-in':['intro','imgcard'],+ 'flip-in':['intro','imgcard'],+ 'bounce-in':['intro','load'],+ 'rotate-in':['intro'],+ // 03+ 'view-transitions-api':['page'],+ 'shared-element-transition':['page','imgcard'],+ 'morph-transition':['page'],+ 'crossfade':['page'],+ 'slide-transition':['page'],+ 'zoom-transition':['page'],+ 'flash-transition':['page'],+ 'blur-transition':['page','imgcard'],+ 'elastic-transition':['page'],+ 'portal-zoom':['page'],+ 'dissolve':['page','imgcard'],+ 'flip-technique':['page','imgcard'],+ // 04+ 'hover-state':['btn','imgcard'],+ 'click-ripple':['btn'],+ 'focus-ring':['menu'],+ 'button-press-scale':['btn'],+ 'magnetic-button':['btn'],+ 'toggle-switch':['btn','menu'],+ 'heart-burst':['btn','load'],+ 'success-confetti':['btn','load'],+ 'skeleton-loader':['load','imgcard'],+ 'shimmer-effect':['load'],+ 'loading-spinner':['load'],+ 'progress-animation':['load'],+ 'checkmark-draw':['load','menu'],+ 'form-field-morph':['menu'],+ 'badge-pulse':['load','btn'],+ 'tooltip-reveal':['btn'],+ 'drawer-slide':['menu'],+ 'modal-expand':['imgcard','btn'],+ 'accordion':['menu'],+ 'cursor-follower':['bg'],+ 'error-shake':['menu','load'],+ 'swipe-to-dismiss':['imgcard'],+ 'hamburger-menu-toggle':['menu','btn'],+ 'theme-toggle-morph':['btn'],+ 'copy-to-clipboard':['btn','load'],+ 'star-rating':['menu','btn'],+ 'toast-notification':['load'],+ 'segmented-control':['menu','btn'],+ 'pull-to-refresh':['load'],+ // 05+ 'kinetic-typography':['text','intro'],+ 'typewriter-effect':['text','intro'],+ 'scramble-text':['text'],+ 'variable-font-morph':['text'],+ 'text-clip-path-reveal':['text','intro'],+ 'marquee-ticker':['text'],+ 'text-morphing':['text'],+ 'text-gradient-animation':['text'],+ 'outline-to-fill':['text'],+ 'enter-exit-typography':['text','intro'],+ 'rotate-word-carousel':['text'],+ 'glitch-text':['text'],+ 'text-on-path':['text'],+ 'wavy-text':['text'],+ // 06+ '3d-model-orbit':['imgcard'],+ 'scroll-driven-3d-rotation':['scroll','imgcard'],+ 'parallax-3d-tilt':['imgcard'],+ 'canvas-particle-effect':['bg'],+ 'fluid-simulation':['bg'],+ 'glassmorphism-animated':['imgcard','bg'],+ 'webgl-shader-animation':['bg'],+ 'noise-based-motion':['bg'],+ 'svg-path-animation':['imgcard','intro'],+ 'chromatic-aberration':['text'],+ '2-5d-pseudo-3d':['imgcard'],+ 'ray-marching-sdf':['bg'],+ 'gpgpu-particle-system':['bg'],+ 'image-distortion-hover':['imgcard'],+ 'cloth-simulation':['imgcard'],+ 'volumetric-smoke':['bg'],+ 'morphing-blob':['bg'],+ 'flip-card-3d':['imgcard'],+ // 07+ 'animated-gradient-background':['bg'],+ 'mesh-gradient':['bg'],+ 'aurora':['bg'],+ 'grain-overlay':['bg','imgcard'],+ 'scanline':['bg'],+ 'light-leak':['bg','imgcard'],+ 'starfield':['bg'],+ 'breathing-glow':['bg','load'],+ 'ambient-ripple':['bg'],+ 'floating-elements':['bg'],+ 'grid-dot-pattern-parallax':['bg'],+ 'abstract-geometric-motion':['bg'],+ 'particle-constellation':['bg'],+ 'flow-field':['bg'],+ 'synthwave-grid':['bg'],+ 'matrix-rain':['bg'],+ 'plasma':['bg']+};+// The eight cards of "Good places to start", in this order.+const PICKS=['click-ripple','typewriter-effect','flip-card-3d','aurora','hamburger-menu-toggle','loading-spinner','parallax-scrolling','slide-up-reveal'];+function pvMarkup(k){switch(k){case 'sig1': return '<div class="s1 anim">'+'<b></b>'.repeat(9)+'</div>';diff --git a/tests/pages.test.js b/tests/pages.test.jsindex e5c0ec44..69397364 100644--- a/tests/pages.test.js+++ b/tests/pages.test.js@@ -5,6 +5,7 @@ const assert = require('node:assert/strict');const fs = require('node:fs');const path = require('node:path');const { sections, table } = require('./helpers/markdown.js');+const vm = require('node:vm');const ROOT = path.resolve(__dirname, '..');const ANIM = path.join(ROOT, 'animations');@@ -416,3 +417,44 @@ test('the home page uses Schibsted Grotesk and the new intro line', () => {for (const old of ['Bricolage', 'PlexMono', 'var(--mono)', '--mono:']) assert.ok(!HOME.includes(old), `still uses ${old}`);assert.ok(HOME.includes('See 129 web animations move, learn when to use each one, and copy a prompt to build it.'));});++// 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;+ 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 === "'" || ch === '"' || ch === '`') quote = ch;+ else if (ch === open) depth++;+ else if (ch === close && --depth === 0) break;+ }+ // vm builds the value in its own realm; the JSON copy is made of ordinary arrays and objects that deepEqual accepts.+ return JSON.parse(JSON.stringify(vm.runInNewContext('(' + HOME.slice(from, i + 1) + ')')));+}+const PLACE_KEYS = ['btn', 'text', 'imgcard', 'bg', 'menu', 'load', 'intro', 'scroll', 'page'];++test('every animation on the home page has one or more places, all of them known', () => {+ const places = homeConst('PLACES');+ const slugs = homeConst('CATS').flatMap(cat => cat.entries.map(e => e[0]));+ assert.deepEqual(Object.keys(places), slugs, 'PLACES lists every card once, in home order');+ for (const slug of slugs) {+ assert.ok(places[slug].length >= 1, `${slug} has a place`);+ for (const key of places[slug]) assert.ok(PLACE_KEYS.includes(key), `${slug}: unknown place ${key}`);+ assert.equal(new Set(places[slug]).size, places[slug].length, `${slug} lists a place twice`);+ }+});++test('every place holds at least one animation', () => {+ const used = new Set(Object.values(homeConst('PLACES')).flat());+ for (const key of PLACE_KEYS) assert.ok(used.has(key), `${key} holds no animation`);+});++test('the eight Start cards are on the home page', () => {+ const picks = homeConst('PICKS'), slugs = new Set(Object.keys(homeConst('PLACES')));+ assert.equal(picks.length, 8);+ for (const slug of picks) assert.ok(slugs.has(slug), slug);+});