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: Famous effects entries 1 to 6 (Stripe, Apple's headset, Lando Norris, Linear, Apple's menu, Wikipedia), each with its cards and prompt, and tests for entries, cards and prompts
matin4862377f7639
diff --git a/famous/index.html b/famous/index.htmlindex 3aa6a6d9..5c540eb5 100644--- a/famous/index.html+++ b/famous/index.html@@ -197,6 +197,104 @@ button{font:inherit;color:inherit}.pv *{will-change:transform}.card:not(.playing) .pv .anim,.card:not(.playing) .pv .anim::before,.card:not(.playing) .pv .anim::after{animation-play-state:paused!important}@media(prefers-reduced-motion:reduce){.pv .anim,.pv .anim::before,.pv .anim::after{animation-play-state:paused!important}}+/* aurora: Aurora / Northern Lights */+.pv-aurora{background:#04060e}+.pv-aurora .band{position:absolute;top:-40%;height:180%;width:44%;filter:blur(26px);opacity:.85;border-radius:50%}+.pv-aurora .b1{left:2%;background:linear-gradient(var(--c6),transparent);animation:aur 6s ease-in-out infinite}+.pv-aurora .b2{left:34%;background:linear-gradient(var(--c1),transparent);animation:aur 7.5s ease-in-out infinite -2s}+.pv-aurora .b3{left:62%;background:linear-gradient(var(--c3),transparent);animation:aur 6.8s ease-in-out infinite -4s}+@keyframes aur{0%,100%{transform:translateX(-10%) skewX(-14deg) scaleY(.9)}50%{transform:translateX(14%) skewX(12deg) scaleY(1.1)}}+/* grain2: Grain / Film Noise Overlay */+.pv-grain2{background:radial-gradient(circle at 50% 40%,#1a1710,#08080a);overflow:hidden}+.pv-grain2 .g{position:absolute;inset:-50%;opacity:.5;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");animation:d-grain .5s steps(4) infinite}+@keyframes d-grain{0%{transform:translate(0,0)}25%{transform:translate(-6%,4%)}50%{transform:translate(4%,-6%)}75%{transform:translate(-4%,-4%)}100%{transform:translate(0,0)}}+/* shader: WebGL Shader Animation */+.pv-shader{background:#05080a;overflow:hidden}+.pv-shader .p{position:absolute;inset:-30%;background:radial-gradient(circle at 30% 30%,var(--accent),transparent 45%),radial-gradient(circle at 70% 60%,var(--c3),transparent 45%),radial-gradient(circle at 50% 80%,var(--c1),transparent 45%);filter:blur(10px);mix-blend-mode:screen;animation:d-shader 9s linear infinite}+@keyframes d-shader{0%{transform:rotate(0) scale(1.25)}100%{transform:rotate(360deg) scale(1.25)}}+/* scrub: Scroll Image Sequence */+.pv-scrub{background:#08090c;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px}+.pv-scrub .knob{width:26%;max-width:44px;aspect-ratio:1;border-radius:7px;border:1px solid var(--accent);animation:scrubr 2.6s ease-in-out infinite alternate}+.pv-scrub .track{position:relative;width:62%;height:6px;border-radius:3px;background:#20242c;overflow:hidden}+.pv-scrub .fill{position:absolute;inset:0;border-radius:3px;background:var(--accent);transform-origin:left;animation:scrubf 2.6s ease-in-out infinite alternate}+@keyframes scrubf{from{transform:scaleX(.06)}to{transform:scaleX(1)}}+@keyframes scrubr{from{transform:rotate(0)}to{transform:rotate(180deg)}}+/* pin: Pin Animation */+.pv-pin{background:#08090c;overflow:hidden;position:relative;display:grid;place-items:center}+.pv-pin .bg{position:absolute;left:12%;right:12%;top:0;display:flex;flex-direction:column;gap:10px;animation:pinsc 4s linear infinite}+.pv-pin .bg b{height:12px;border-radius:2px;background:#181c22}+.pv-pin .box{position:relative;z-index:2;width:30%;aspect-ratio:1;border-radius:6px;background:color-mix(in srgb,var(--accent) 22%,#101218);border:1px solid var(--accent)}+@keyframes pinsc{to{transform:translateY(-50%)}}+/* cursor: Cursor Follower */+.pv-cursor{background:#08090c;position:relative}+.pv-cursor .tgt{position:absolute;width:9%;aspect-ratio:1;border-radius:50%;border:1px solid var(--ink-dim);animation:m-tgt 4s ease-in-out infinite}+.pv-cursor .foll{position:absolute;width:12%;aspect-ratio:1;border-radius:50%;background:color-mix(in srgb,var(--accent) 40%,transparent);border:1px solid var(--accent);animation:m-foll 4s ease-in-out infinite}+@keyframes m-tgt{0%{left:20%;top:30%}25%{left:70%;top:24%}50%{left:74%;top:64%}75%{left:24%;top:68%}100%{left:20%;top:30%}}+@keyframes m-foll{0%{left:20%;top:30%}29%{left:70%;top:24%}54%{left:74%;top:64%}79%{left:24%;top:68%}100%{left:20%;top:30%}}+/* mesh: Morphing Blob */+.pv-mesh{background:#0a0710}+.pv-mesh .m{position:absolute;width:70%;height:70%;border-radius:50%;filter:blur(24px);mix-blend-mode:screen}+.pv-mesh .m1{top:-14%;left:-10%;background:radial-gradient(circle,var(--c4),transparent 65%);animation:mesh 9s ease-in-out infinite}+.pv-mesh .m2{bottom:-16%;right:-8%;background:radial-gradient(circle,var(--c3),transparent 65%);animation:mesh 11s ease-in-out infinite -3s}+.pv-mesh .m3{top:20%;left:38%;background:radial-gradient(circle,var(--c5),transparent 65%);animation:mesh 10s ease-in-out infinite -6s}+@keyframes mesh{0%,100%{transform:translate(0,0) scale(1)}33%{transform:translate(18%,-12%) scale(1.2)}66%{transform:translate(-14%,14%) scale(.85)}}+/* clipreveal: Clip-Path Reveal */+.pv-clipreveal{background:#08090c;display:grid;place-items:center}+.pv-clipreveal .sq{width:56%;height:56%;border-radius:6px;background:color-mix(in srgb,var(--accent) 40%,#12141a);clip-path:circle(0% at 50% 50%);animation:e-clipr 3s var(--ease) infinite}+@keyframes e-clipr{0%{clip-path:circle(0% at 50% 50%)}45%,75%{clip-path:circle(72% at 50% 50%)}100%{clip-path:circle(0% at 50% 50%)}}+/* split: Split Text Reveal */+.pv-split{background:#08090c;display:flex;align-items:center;justify-content:center;gap:5px}+.pv-split b{font-family:var(--disp);font-weight:800;font-size:30px;color:var(--accent);opacity:0;animation:e-split 2.8s var(--ease) infinite}+.pv-split b:nth-child(2){animation-delay:.09s}+.pv-split b:nth-child(3){animation-delay:.18s}+.pv-split b:nth-child(4){animation-delay:.27s}+.pv-split b:nth-child(5){animation-delay:.36s}+@keyframes e-split{0%{opacity:0;transform:translateY(50%)}32%,74%{opacity:1;transform:none}100%{opacity:0;transform:translateY(-30%)}}+/* blurin: Blur In */+.pv-blurin{background:#08090c;display:grid;place-items:center}+.pv-blurin .word{font-family:var(--disp);font-weight:800;font-size:34px;color:var(--accent);animation:e-blurin 3s ease-in-out infinite}+@keyframes e-blurin{0%,100%{opacity:0;filter:blur(12px)}40%,62%{opacity:1;filter:blur(0)}}+/* stagger: Stagger Reveal */+.pv-stagger{background:#08090c;display:grid;grid-template-columns:repeat(3,1fr);gap:9px;place-content:center;padding:16%}+.pv-stagger i{aspect-ratio:1;border-radius:4px;background:color-mix(in srgb,var(--accent) 34%,#181c22);opacity:0;transform:scale(.5);animation:stg 2.8s var(--ease) infinite}+.pv-stagger i:nth-child(1){animation-delay:0s}+.pv-stagger i:nth-child(2){animation-delay:.07s}+.pv-stagger i:nth-child(3){animation-delay:.14s}+.pv-stagger i:nth-child(4){animation-delay:.1s}+.pv-stagger i:nth-child(5){animation-delay:.17s}+.pv-stagger i:nth-child(6){animation-delay:.24s}+.pv-stagger i:nth-child(7){animation-delay:.2s}+.pv-stagger i:nth-child(8){animation-delay:.27s}+.pv-stagger i:nth-child(9){animation-delay:.34s}+@keyframes stg{0%{opacity:0;transform:scale(.5)}32%,76%{opacity:1;transform:none}100%{opacity:0;transform:scale(.5)}}+/* hamb: Hamburger Menu Toggle */+.pv-hamb{background:#08090c;display:grid;place-items:center}+.pv-hamb .frame{width:26%;max-width:48px;aspect-ratio:1;display:grid;place-items:center;border:1px solid #232830;border-radius:10px}+.pv-hamb .bars{position:relative;width:52%;height:15px}+.pv-hamb .bars i{position:absolute;left:0;right:0;height:2.5px;border-radius:2px;background:var(--accent)}+.pv-hamb .bars i:nth-child(1){top:0;animation:hb1 3s var(--ease) infinite}+.pv-hamb .bars i:nth-child(2){top:6.2px;animation:hb2 3s var(--ease) infinite}+.pv-hamb .bars i:nth-child(3){bottom:0;animation:hb3 3s var(--ease) infinite}+@keyframes hb1{0%,30%{transform:none}44%,82%{transform:translateY(6.2px) rotate(45deg)}96%,100%{transform:none}}+@keyframes hb2{0%,30%{opacity:1}44%,82%{opacity:0}96%,100%{opacity:1}}+@keyframes hb3{0%,30%{transform:none}44%,82%{transform:translateY(-6.2px) rotate(-45deg)}96%,100%{transform:none}}+/* glass: Glassmorphism Animated */+.pv-glass{background:#05080a;position:relative;overflow:hidden;display:grid;place-items:center}+.pv-glass .blob{position:absolute;width:52%;aspect-ratio:1;border-radius:50%;filter:blur(18px)}+.pv-glass .g1{background:var(--accent);left:-8%;top:-12%;animation:d-gb1 6s ease-in-out infinite}+.pv-glass .g2{background:var(--c3);right:-10%;bottom:-14%;animation:d-gb2 7s ease-in-out infinite}+.pv-glass .gcard{position:relative;width:62%;height:52%;border-radius:10px;background:rgba(255,255,255,.06);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);border:1px solid rgba(255,255,255,.2)}+@keyframes d-gb1{0%,100%{transform:translate(0,0)}50%{transform:translate(34%,22%)}}+@keyframes d-gb2{0%,100%{transform:translate(0,0)}50%{transform:translate(-28%,-20%)}}+/* tooltip: Tooltip Reveal */+.pv-tooltip{background:#08090c;display:grid;place-items:center;position:relative}+.pv-tooltip .tgt{width:15%;aspect-ratio:1;border-radius:50%;background:#2a2e36}+.pv-tooltip .tip{position:absolute;top:30%;padding:5px 10px;border-radius:5px;background:var(--accent);color:#0b0b0d;font-family:var(--text);font-size:10px;animation:m-tip 2.8s var(--ease) infinite}+@keyframes m-tip{0%,25%{opacity:0;transform:translateY(6px) scale(.9)}45%,80%{opacity:1;transform:none}100%{opacity:0}}+/* fade: Fade In / Fade Out */+.pv-fade{background:#08090c;display:grid;place-items:center}+.pv-fade .sq{width:40%;height:44%;border-radius:6px;background:color-mix(in srgb,var(--accent) 26%,#12141a);border:1px solid var(--accent);animation:e-fade 2.6s ease-in-out infinite}+@keyframes e-fade{0%,100%{opacity:0}40%,60%{opacity:1}}/* ── end of previews ── */</style></head>@@ -223,8 +321,102 @@ button{font:inherit;color:inherit}<p class="fx-legal">The Animation Handbook is not connected to any of these sites or their owners, and none of them has reviewed or approved this page. Each effect is described in our own words and shown only with the handbook's own demos.</p></div><nav class="fx-jump" aria-label="Effects on this page">+ <a href="#stripe-ribbon">Stripe · ribbon</a>+ <a href="#apple-scroll">Apple · headset</a>+ <a href="#landonorris-reveal">Lando Norris · reveal</a>+ <a href="#linear-intro">Linear · headline</a>+ <a href="#apple-menu">Apple · menu</a>+ <a href="#wikipedia-previews">Wikipedia · previews</a></nav>+ <section class="fx" id="stripe-ribbon" aria-labelledby="stripe-ribbon-t" data-fx-site="Stripe" data-fx-start="loop">+ <p class="fx-seen">Seen on <a href="https://stripe.com/" target="_blank" rel="noopener">stripe.com<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <h2 id="stripe-ribbon-t" tabindex="-1">The twisting ribbon of light</h2>+ <p class="fx-what">Behind the headline, a thick ribbon of glowing color slowly twists in depth, sharp in places and blurred in others, as if filmed by a camera, under a fine grain. From 2020 to 2025 the same place held a flat band of blended colors that flowed like slow paint, the look <a href="../animations/07-ambient-background/mesh-gradient/">Mesh Gradient Animation</a> makes.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c7" data-slug="aurora"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The soft light</span></div><div class="meta"><h4 class="title"><a href="../animations/07-ambient-background/aurora/">Aurora / Northern Lights</a></h4><p class="desc">Blurred bands of light sway like the northern lights. Best for dark backgrounds.</p></div></article>+ <article class="card c7" data-slug="grain-overlay"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The grain</span></div><div class="meta"><h4 class="title"><a href="../animations/07-ambient-background/grain-overlay/">Grain / Film Noise Overlay</a></h4><p class="desc">Fine grain flickers over the page, like old film. Best for editorial sites.</p></div></article>+ <article class="card c6" data-slug="webgl-shader-animation"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">On the chip</span></div><div class="meta"><h4 class="title"><a href="../animations/06-3d-advanced/webgl-shader-animation/">WebGL Shader Animation</a></h4><p class="desc">Moving color patterns computed for every pixel. Best for bold backgrounds.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a slowly twisting ribbon of colored light behind <mark>[the heading at the top of your page]</mark>. Draw one thick, soft band in three or four of your own colors that drifts and turns in depth, so parts of it come into sharp focus while others blur, like a camera with a shallow focus, and lay a fine grain over it so the colors feel printed rather than flat. Keep the movement slow and the heading readable on every color it passes. Draw it on the graphics chip, show a still picture of it until it is ready, and pause it when it is off screen. On phones, draw a lighter version. If the visitor has reduced motion turned on, show the still picture.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for The twisting ribbon of light"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>++ <section class="fx" id="apple-scroll" aria-labelledby="apple-scroll-t" data-fx-site="Apple" data-fx-start="scroll">+ <p class="fx-seen">Seen on <a href="https://www.apple.com/apple-vision-pro/" target="_blank" rel="noopener">apple.com/apple-vision-pro<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <h2 id="apple-scroll-t" tabindex="-1">The headset that comes apart as you scroll</h2>+ <p class="fx-what">The headset stays in the middle of the screen while you scroll: its parts rise out of it layer by layer, then it tips up to show its lenses, and scrolling back puts it together. Then a short headline and a paragraph about the part on screen scroll up under it.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c1" data-slug="scroll-image-sequence"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Scroll plays it</span></div><div class="meta"><h4 class="title"><a href="../animations/01-scroll-based/scroll-image-sequence/">Scroll Image Sequence</a></h4><p class="desc">Scrolling plays a series of pictures like a flip-book. Best for products.</p></div></article>+ <article class="card c1" data-slug="pin-animation"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">It stays put</span></div><div class="meta"><h4 class="title"><a href="../animations/01-scroll-based/pin-animation/">Pin Animation</a></h4><p class="desc">One part stays put while its text changes on scroll. Best for feature lists.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a scroll-driven product reveal to <mark>[your product section]</mark>. Pin the product in the middle of the screen while the visitor scrolls through a section a few screens tall, and let the scroll play a short video or a series of pictures of it, so it turns or comes apart as they scroll down and goes back together as they scroll up. Then let a short headline and a paragraph about the part on screen scroll up under it. Show a still picture until the video or pictures are ready, and give the product a text description for screen readers. Touch scrolling drives it the same way. If the visitor has reduced motion turned on, show a few still pictures with their text instead.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for The headset that comes apart as you scroll"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>++ <section class="fx" id="landonorris-reveal" aria-labelledby="landonorris-reveal-t" data-fx-site="Lando Norris" data-fx-start="hover">+ <p class="fx-seen">Seen on <a href="https://landonorris.com/" target="_blank" rel="noopener">landonorris.com<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <h2 id="landonorris-reveal-t" tabindex="-1">The liquid reveal under the pointer</h2>+ <p class="fx-what">A large portrait stands in the middle of the screen. Wherever the pointer goes, a soft, liquid-looking blob shows a second picture through it, his racing helmet, as if the portrait were being wiped away.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c4" data-slug="cursor-follower"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Follows the pointer</span></div><div class="meta"><h4 class="title"><a href="../animations/04-micro-interactions/cursor-follower/">Cursor Follower</a></h4><p class="desc">A dot trails your pointer and flips the colors under it. Best for portfolios.</p></div></article>+ <article class="card c6" data-slug="morphing-blob"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The liquid shape</span></div><div class="meta"><h4 class="title"><a href="../animations/06-3d-advanced/morphing-blob/">Morphing Blob</a></h4><p class="desc">Blobs melt together, and one drop chases your pointer. Best for hero sections.</p></div></article>+ <article class="card c2" data-slug="clip-path-reveal"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The hidden picture</span></div><div class="meta"><h4 class="title"><a href="../animations/02-entrance-and-exit/clip-path-reveal/">Clip-Path Reveal</a></h4><p class="desc">A growing shape uncovers it while it stays still. Best for images and banners.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a liquid reveal to <mark>[the picture at the top of your page, with a second picture hidden under it]</mark>. Stack the two pictures exactly. Wherever the pointer goes, a soft, round blob follows a little behind it, wobbling and stretching with its speed, and the hidden picture shows through the blob, as if the top picture were being wiped away. Let the blob shrink away when the pointer stops or leaves. Draw the mask on the graphics chip or with a clip, never by resizing the pictures, so it stays smooth. On touch screens, let a finger dragged across the picture do the same. If the visitor has reduced motion turned on, show a plain circle at the pointer, without the wobble or the lag.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for The liquid reveal under the pointer"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>++ <section class="fx" id="linear-intro" aria-labelledby="linear-intro-t" data-fx-site="Linear" data-fx-start="load">+ <p class="fx-seen">Seen on <a href="https://linear.app/" target="_blank" rel="noopener">linear.app<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <h2 id="linear-intro-t" tabindex="-1">The headline that comes into focus</h2>+ <p class="fx-what">As the page opens, the headline comes in line by line, each line fading in while it rises a little and sharpens out of a soft blur; the short line under it and a small link follow the same way, then a large flat picture of the app fades in below.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c2" data-slug="split-text-reveal"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Lines in turn</span></div><div class="meta"><h4 class="title"><a href="../animations/02-entrance-and-exit/split-text-reveal/">Split Text Reveal</a></h4><p class="desc">Text breaks into pieces that appear one after another. Best for headlines.</p></div></article>+ <article class="card c2" data-slug="blur-in"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Blur to sharp</span></div><div class="meta"><h4 class="title"><a href="../animations/02-entrance-and-exit/blur-in/">Blur In</a></h4><p class="desc">Comes into focus from a blur, like a camera. Best for featured cards and photos.</p></div></article>+ <article class="card c1" data-slug="stagger-reveal"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Part after part</span></div><div class="meta"><h4 class="title"><a href="../animations/01-scroll-based/stagger-reveal/">Stagger Reveal</a></h4><p class="desc">Items in a group appear one after another as it scrolls in. Best for card grids.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a focus-in opening to <mark>[the headline, the line under it and the main picture at the top of your page]</mark>. As the page opens, show the headline line by line, each line fading in while it rises a little and sharpens out of a soft blur; then let the line under it and a small link follow the same way, and fade the main picture in last. Keep each step short, so the whole opening is over in about a second and nobody waits to read. Animate only fading, blur and small moves, and use less blur on phones, where it costs more. If the visitor has reduced motion turned on, show everything at once.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for The headline that comes into focus"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>++ <section class="fx" id="apple-menu" aria-labelledby="apple-menu-t" data-fx-site="Apple" data-fx-start="press">+ <p class="fx-seen">Seen on <a href="https://www.apple.com/" target="_blank" rel="noopener">apple.com<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <h2 id="apple-menu-t" tabindex="-1">The menu that drops in, link by link</h2>+ <p class="fx-what">On a phone, the two-line menu button folds into an X while the menu fills the screen and its links drop into place one after another. On a computer, pointing at a top item opens a panel that grows down from the bar, its links appearing in turn, while the page behind blurs.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c4" data-slug="hamburger-menu-toggle"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The button</span></div><div class="meta"><h4 class="title"><a href="../animations/04-micro-interactions/hamburger-menu-toggle/">Hamburger Menu Toggle</a></h4><p class="desc">Three lines turn into an X as the menu opens. Best for mobile menus.</p></div></article>+ <article class="card c1" data-slug="stagger-reveal"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Links in turn</span></div><div class="meta"><h4 class="title"><a href="../animations/01-scroll-based/stagger-reveal/">Stagger Reveal</a></h4><p class="desc">Items in a group appear one after another as it scrolls in. Best for card grids.</p></div></article>+ <article class="card c6" data-slug="glassmorphism-animated"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The blurred page</span></div><div class="meta"><h4 class="title"><a href="../animations/06-3d-advanced/glassmorphism-animated/">Glassmorphism Animated</a></h4><p class="desc">Frosted glass cards blur the colors behind them. Best for cards and panels.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a menu that opens in steps to <mark>[the main menu in your site's header]</mark>. On phones, a tap on the menu button folds its lines into an X while the menu opens to fill the screen, and its links drop a few pixels into place one after another. On computers, pointing at a top item, or reaching it with the keyboard, opens a panel below it the same way while the page behind blurs. Keep the wait between links tiny, so the whole menu is there in about half a second, and close it faster than it opens. Make every opener a real button that tells screen readers whether its menu is open. If the visitor has reduced motion turned on, show and hide the menus at once.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for The menu that drops in, link by link"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>++ <section class="fx" id="wikipedia-previews" aria-labelledby="wikipedia-previews-t" data-fx-site="Wikipedia" data-fx-start="hover">+ <p class="fx-seen">Seen on <a href="https://www.wikipedia.org/" target="_blank" rel="noopener">wikipedia.org<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <h2 id="wikipedia-previews-t" tabindex="-1">Link previews</h2>+ <p class="fx-what">Rest the pointer on a link and, after a short pause, a small card with the linked article's first lines and picture fades in under the link, rising slightly into place; move away and it fades out.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c4" data-slug="tooltip-reveal"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The pause</span></div><div class="meta"><h4 class="title"><a href="../animations/04-micro-interactions/tooltip-reveal/">Tooltip Reveal</a></h4><p class="desc">A small label fades in after a short pause. Best for icon buttons.</p></div></article>+ <article class="card c2" data-slug="fade-in-out"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The fade</span></div><div class="meta"><h4 class="title"><a href="../animations/02-entrance-and-exit/fade-in-out/">Fade In / Fade Out</a></h4><p class="desc">Fades in to appear and fades out to leave. Best for pop-ups and tooltips.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add link previews to <mark>[the links in your articles that point to other pages]</mark>. When the pointer rests on a link for a moment, a small card with the linked page's title, first sentences and picture fades in just below the link while rising a little into place; when the pointer leaves, it fades away. The wait keeps cards from flashing while the pointer only passes by, and a card that would fall off the screen opens above the link instead. Show the same card when keyboard focus reaches the link. On touch screens, where there is no hover, let a tap open the link as usual. If the visitor has reduced motion turned on, show and hide the card without movement.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for Link previews"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>+<section class="fx-more" aria-labelledby="fx-more-t"><h2 id="fx-more-t">Seen one we should add?</h2><p>Seen an effect on a well-known site that you want explained?</p>@@ -266,6 +458,21 @@ if(location.protocol==='file:')document.querySelectorAll('a[href]').forEach(a=>{// ── previews: written by tools/make-famous.mjs from the home page; run it again, never edit by hand ──const PREVIEWS={+"aurora":{"pv":"aurora","still":0.5,"markup":"<span class=\"band b1 anim\"><\/span><span class=\"band b2 anim\"><\/span><span class=\"band b3 anim\"><\/span>"},+"grain-overlay":{"pv":"grain2","still":0.5,"markup":"<span class=\"g anim\"><\/span>"},+"webgl-shader-animation":{"pv":"shader","still":0.5,"markup":"<span class=\"p anim\"><\/span>"},+"scroll-image-sequence":{"pv":"scrub","still":0.5,"markup":"<span class=\"knob anim\"><\/span><span class=\"track\"><span class=\"fill anim\"><\/span><\/span>"},+"pin-animation":{"pv":"pin","still":0.5,"markup":"<div class=\"bg anim\"><b><\/b><b><\/b><b><\/b><b><\/b><b><\/b><b><\/b><b><\/b><b><\/b><\/div><span class=\"box\"><\/span>"},+"cursor-follower":{"pv":"cursor","still":0.5,"markup":"<span class=\"tgt anim\"><\/span><span class=\"foll anim\"><\/span>"},+"morphing-blob":{"pv":"mesh","still":0.5,"markup":"<span class=\"m m1 anim\"><\/span><span class=\"m m2 anim\"><\/span><span class=\"m m3 anim\"><\/span>"},+"clip-path-reveal":{"pv":"clipreveal","still":0.5,"markup":"<span class=\"sq anim\"><\/span>"},+"split-text-reveal":{"pv":"split","still":0.5,"markup":"<b class=\"anim\">S<\/b><b class=\"anim\">P<\/b><b class=\"anim\">L<\/b><b class=\"anim\">I<\/b><b class=\"anim\">T<\/b>"},+"blur-in":{"pv":"blurin","still":0.5,"markup":"<span class=\"word anim\">Focus<\/span>"},+"stagger-reveal":{"pv":"stagger","still":0.5,"markup":"<i class=\"anim\"><\/i><i class=\"anim\"><\/i><i class=\"anim\"><\/i><i class=\"anim\"><\/i><i class=\"anim\"><\/i><i class=\"anim\"><\/i><i class=\"anim\"><\/i><i class=\"anim\"><\/i><i class=\"anim\"><\/i>"},+"hamburger-menu-toggle":{"pv":"hamb","still":0.5,"markup":"<span class=\"frame\"><span class=\"bars\"><i class=\"anim\"><\/i><i class=\"anim\"><\/i><i class=\"anim\"><\/i><\/span><\/span>"},+"glassmorphism-animated":{"pv":"glass","still":0.5,"markup":"<span class=\"blob g1 anim\"><\/span><span class=\"blob g2 anim\"><\/span><span class=\"gcard\"><\/span>"},+"tooltip-reveal":{"pv":"tooltip","still":0.5,"markup":"<span class=\"tgt\"><\/span><span class=\"tip anim\">Info<\/span>"},+"fade-in-out":{"pv":"fade","still":0.5,"markup":"<span class=\"sq anim\"><\/span>"}};// ── end of previews ──diff --git a/tests/famous.test.js b/tests/famous.test.jsindex 53f2dc3d..0cb1fb0d 100644--- a/tests/famous.test.js+++ b/tests/famous.test.js@@ -241,3 +241,113 @@ test('the two preview blocks are what tools/make-famous.mjs writes from the homeconst { buildFamous } = await tool();assert.ok(buildFamous(ROOT)['famous/index.html'] === PAGE, `famous/index.html is out of date: run ${TOOL}`);});++// ---------- The page: entries, cards and prompts ----------+const STARTS = ['loop', 'load', 'scroll', 'hover', 'press'];+const words = s => s.split(/\s+/).filter(Boolean).length;+// Each entry as { id, site, start, body }, in page order.+const ENTRIES = [...PAGE.matchAll(/<section class="fx" id="([a-z0-9-]+)" aria-labelledby="\1-t" data-fx-site="([^"]+)" data-fx-start="([a-z]+)">([\s\S]*?)<\/section>/g)]+ .map(m => ({ id: m[1], site: decode(m[2]), start: m[3], body: m[4] }));+// A card exactly as the template writes it: its accent, slug, label, link, name and line.+const CARD = /<article class="card (c[1-7])" data-slug="([a-z0-9-]+)"><div class="stage"><div class="pv" aria-hidden="true"><\/div><span class="tag">([^<]+)<\/span><\/div><div class="meta"><h4 class="title"><a href="([^"]+)">([^<]+)<\/a><\/h4><p class="desc">([^<]+)<\/p><\/div><\/article>/g;+// The words that would name an entry's site in a prompt: its name (without a leading "The"), its address and the name in that+// address. A single letter, as X, is too short to count ("an X" is a shape); its address still counts.+const siteWords = e => {+ const href = e.body.match(/<p class="fx-seen">Seen on <a href="([^"]+)"/)[1], host = new URL(href).hostname.replace(/^www\./, '');+ return [e.site.replace(/^The /, ''), host, host.split('.').slice(-2)[0]].filter(w => w.length > 1);+};+// Whether text holds word as a word of its own (not inside a longer one), ignoring case.+const names = (text, word) => new RegExp('(^|[^a-z0-9])' + escapeRe(word.toLowerCase()) + '([^a-z0-9]|$)', 'i').test(text);++test('every entry is written as the template says, so the tests below see it', () => {+ assert.ok(ENTRIES.length > 0, 'the page has entries');+ assert.equal(ENTRIES.length, count(PAGE, '<section class="fx"'), 'each <section class="fx"> has its id, aria-labelledby, data-fx-site and data-fx-start in that order');+ assert.equal(new Set(ENTRIES.map(e => e.id)).size, ENTRIES.length, 'every id is unique');+ assert.ok(PAGE.indexOf('<nav class="fx-jump"') < PAGE.indexOf('<section class="fx"'), 'the entries come after the jump row');+});++for (const e of ENTRIES) {+ test(`${e.id}: seen on its site in the year it was checked, a heading, what you see in 25 to 70 words and what starts it`, () => {+ const seen = e.body.match(/<p class="fx-seen">Seen on <a href="(https:\/\/[^"]+)" target="_blank" rel="noopener">([^<]+)<span class="sr"> \(opens in a new tab\)<\/span><\/a> in <time datetime="((\d{4})-\d{2}-\d{2})">(\d{4})<\/time><\/p>/);+ assert.ok(seen, 'Seen on: the site\'s address as a link that opens a new tab, then the year in a <time>');+ const [, href, label, day, year, shown] = seen;+ assert.equal(label, href.replace(/^https:\/\//, '').replace(/^www\./, '').replace(/\/$/, ''), 'the link shows the address without https:// or www.');+ assert.equal(shown, year, 'the year shown is the year of the day checked');+ assert.ok(!Number.isNaN(Date.parse(day)) && Date.parse(day) <= Date.now(), `${day} is a day that has come`);+ assert.equal(count(e.body, '<p class="fx-seen">'), 1, 'one Seen on line');+ assert.equal(count(e.body, '<h2 '), 1, 'one heading');+ assert.ok(e.body.includes(`<h2 id="${e.id}-t" tabindex="-1">`), 'the heading the entry is named by, which a jump focuses');+ const what = e.body.match(/<p class="fx-what">([\s\S]*?)<\/p>/);+ assert.ok(what, 'what you see');+ const n = words(textOf(what[1]));+ assert.ok(n >= 25 && n <= 70, `what you see has ${n} words, not 25 to 70`);+ assert.ok(STARTS.includes(e.start), `data-fx-start "${e.start}" is one of ${STARTS.join(', ')}`);+ assert.ok(e.site.trim(), 'data-fx-site names the site');+ assert.ok(e.body.includes('<h3 class="fx-sub">Made with these animations</h3>') && e.body.includes('<h3 class="fx-sub">A prompt to build something similar</h3>'), 'its two parts');+ });++ test(`${e.id}: one to three cards, each an animation of the home page with its name, line and page, and a short label`, async () => {+ const { homeConst } = await tool();+ const CATS = homeConst(HOME, 'CATS');+ const cards = [...e.body.matchAll(CARD)];+ assert.equal(cards.length, count(e.body, '<article'), 'every card is written as the template says');+ assert.ok(cards.length >= 1 && cards.length <= 3, `${cards.length} cards, not 1 to 3`);+ for (const [, accent, slug, label, href, name, desc] of cards) {+ const cat = CATS.find(c => c.entries.some(x => x[0] === slug));+ assert.ok(cat, `${slug} is a card on the home page`);+ const [, cardName, line] = cat.entries.find(x => x[0] === slug);+ assert.equal(accent, cat.cat.replace('-cat', ''), `${slug}: its category's accent`);+ assert.equal(href, `../${cat.folder}/${slug}/`, `${slug}: its page's link`);+ assert.ok(fs.existsSync(path.join(ROOT, cat.folder, slug, 'index.html')), `${slug}: its page exists`);+ assert.equal(decode(name), cardName, `${slug}: the home page's name`);+ assert.equal(decode(desc), line, `${slug}: the home page's line`);+ const n = words(decode(label));+ assert.ok(n >= 1 && n <= 3, `${slug}: the label "${label}" has ${n} words, not 1 to 3`);+ }+ });++ test(`${e.id}: its prompt follows the rules for prompts and names no site of the page, and Copy prompt names the entry`, () => {+ const box = e.body.match(/<div class="fx-pbox"><p class="fx-prompt">([\s\S]*?)<\/p><\/div>/);+ assert.ok(box, 'the prompt in its box');+ const prompt = textOf(box[1]), n = words(prompt);+ assert.ok(n >= 60 && n <= 130, `${n} words, not 60 to 130`);+ assert.ok(prompt.startsWith('Add '), 'starts with "Add "');+ const parts = prompt.match(/\[[^\]]+\]/g) || [];+ assert.ok(parts.length >= 1, 'at least one [part to fill in]');+ assert.equal(count(box[1], '<mark>['), parts.length, 'each [part] is marked');+ assert.ok(!/`|<code|<pre/.test(box[1]), 'no code');+ assert.ok(!prompt.includes('Match the settings listed below.'), 'the page has no settings to match');+ assert.match(prompt, /reduced motion/i, 'says what happens under reduced motion');+ if (e.start === 'hover' || e.start === 'press') assert.match(prompt, /\b(touch|tap|finger)/i, 'names touch, a tap or a finger');+ for (const other of ENTRIES) for (const w of siteWords(other)) assert.ok(!names(prompt, w), `names "${w}"`);+ const title = e.body.match(/<h2 [^>]*>([^<]+)<\/h2>/)[1];+ assert.ok(e.body.includes(`<button type="button" class="copy" aria-label="Copy prompt for ${title}">`), 'Copy prompt names its entry');+ });+}++test('the jump row links each entry once, in page order, each chip starting with its site, and the skip link leads to the first entry', () => {+ const nav = between(PAGE, '<nav class="fx-jump" aria-label="Effects on this page">', '</nav>');+ const links = [...nav.matchAll(/<a href="#([a-z0-9-]+)">([^<]+)<\/a>/g)];+ assert.deepEqual(links.map(m => m[1]), ENTRIES.map(e => e.id), 'one chip per entry, in order');+ for (const [, id, label] of links) assert.ok(decode(label).startsWith(`${ENTRIES.find(e => e.id === id).site} · `), `${id}: "${label}" starts with its site`);+ assert.ok(PAGE.includes(`<a class="skip" href="#${ENTRIES[0].id}">Skip to the first effect</a>`), 'the skip link');+});++test('two different animations on the page never share a preview', async () => {+ const { homeConst } = await tool();+ const CATS = homeConst(HOME, 'CATS'), PV = homeConst(HOME, 'PV');+ const byPreview = new Map();+ for (const slug of new Set([...PAGE.matchAll(CARD)].map(m => m[2]))) {+ const cat = CATS.find(c => c.entries.some(x => x[0] === slug));+ const key = PV[slug] || 'sig' + parseInt(cat.n, 10);+ byPreview.set(key, [...(byPreview.get(key) || []), slug]);+ }+ assert.deepEqual([...byPreview].filter(([, slugs]) => slugs.length > 1).map(([key, slugs]) => `${key}: ${slugs.join(', ')}`), []);+});++test('no company name in the page\'s title, description or social card, and no word that implies approval', () => {+ const head = [TITLE, LEDE, meta('property="og:title"'), meta('property="og:description"'), meta('name="twitter:title"'), meta('name="twitter:description"')].join(' ');+ for (const w of ENTRIES.flatMap(siteWords)) assert.ok(!names(head, w), `"${w}" in the title, description or social card`);+ const shown = textOf(MARKUP.replace(`<p class="fx-legal">${LEGAL}</p>`, ''));+ assert.ok(!/\b(official|officially|approved|endorsed|sponsored|partner|partners|as used by)\b/i.test(shown), 'no word that implies approval');+});