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: our version of link previews (checked on its site 2026-10-22); review fixes: the hero of the focus-in version fits any stage and comes in a little later and slower part by part, as its prompt now says in plain words
matin2fe039ae79d3
diff --git a/famous/index.html b/famous/index.htmlindex 70afb80c..7bc03432 100644--- a/famous/index.html+++ b/famous/index.html@@ -310,22 +310,24 @@ button{font:inherit;color:inherit}.mn-panel i:nth-child(5){top:50.5cqh;width:24cqw;--d:.56s}/* link previews: a pointer rests on a link and a small card rises above it */-.gp-wiki{background:radial-gradient(80% 90% at 60% 70%,#111627,#08080a 72%)}+.gp-wiki{background:radial-gradient(80% 110% at 25% 0,#141830,#08080a 72%)}.gp-wiki .tx{left:10cqw;height:3.6cqh;border-radius:1cqh;background:#2a3042}-.gp-wiki .tx1{top:29cqh;width:78cqw}-.gp-wiki .tx2{top:40cqh;width:68cqw}-.gp-wiki .tx3{top:59cqh;width:26cqw}-.gp-wiki .tx4{top:59cqh;left:39cqw;width:20cqw;background:var(--c1)}-.gp-wiki .tx5{top:59cqh;left:61cqw;width:27cqw}-.gp-wiki .tx6{top:70cqh;width:56cqw}-.gp-wiki .tx7{top:81cqh;width:70cqw}-.wk-card{position:absolute;left:33cqw;top:23cqh;width:46cqw;height:29cqh;border-radius:2.2cqw;background:#1b2030;border:1px solid #343c54;box-shadow:0 1.5cqw 4cqw rgba(0,0,0,.45)}+.gp-wiki .tx1{top:17cqh;width:78cqw}+.gp-wiki .tx2{top:28cqh;width:68cqw}+.gp-wiki .tx3{top:39cqh;width:26cqw}+.gp-wiki .tx4{top:39cqh;left:39cqw;width:20cqw;background:var(--c1)}+.gp-wiki .tx5{top:39cqh;left:61cqw;width:27cqw}+.gp-wiki .tx6{top:50cqh;width:56cqw}+.gp-wiki .tx7{top:61cqh;width:70cqw}+.wk-card{position:absolute;left:46cqw;top:46cqh;width:46cqw;height:28cqh;border-radius:2.2cqw;background:#181a23;border:1px solid rgba(255,255,255,.17);box-shadow:0 1.5cqw 4cqw rgba(0,0,0,.5)}+.wk-card::before{content:"";position:absolute;left:2cqw;top:-1.1cqw;width:2cqw;height:2cqw;background:#181a23;border:solid rgba(255,255,255,.17);border-width:1px 0 0 1px;transform:rotate(45deg)}.wk-card i{border-radius:1cqw}-.wk-card .im{left:2.6cqw;top:2.6cqw;width:12cqw;height:12cqw;background:linear-gradient(135deg,var(--c6),var(--c1))}-.wk-card .l1{left:17cqw;top:3.4cqw;width:25cqw;height:2cqw;background:#e9ebf3}-.wk-card .l2{left:17cqw;top:7.6cqw;width:20cqw;height:1.6cqw;background:#7b839b}-.wk-card .l3{left:17cqw;top:11cqw;width:23cqw;height:1.6cqw;background:#7b839b}-.wk-ptr{left:45cqw;top:65cqh;width:4.4cqw;height:4.4cqw;border-radius:50%;background:rgba(255,255,255,.95);box-shadow:0 0 0 1cqw rgba(255,255,255,.22)}+.wk-card .im{left:2.4cqw;top:2.4cqw;width:12cqw;height:12cqw;background:linear-gradient(140deg,var(--c1),var(--c3))}+.wk-card .im::after{content:"";position:absolute;inset:22% 18% 20% 18%;background:#fff;clip-path:polygon(0 66%,100% 0,66% 100%,48% 68%)}+.wk-card .l1{left:16.6cqw;top:3.2cqw;width:14cqw;height:2cqw;background:#fff}+.wk-card .l2{left:16.6cqw;top:7.2cqw;width:25cqw;height:1.5cqw;background:#9aa0b8}+.wk-card .l3{left:16.6cqw;top:10.4cqw;width:20cqw;height:1.5cqw;background:#9aa0b8}+.wk-ptr{left:47cqw;top:37.3cqh;width:4.4cqw;height:4.4cqw;border-radius:50%;border:2px solid #fff;background:rgba(255,255,255,.22);box-shadow:0 0 0 1px rgba(8,8,10,.7),0 .8cqw 2cqw rgba(0,0,0,.45)}/* the color that sweeps across a headline: a bright band, clipped to the bars */.gp-sweep{background:radial-gradient(80% 90% at 50% 50%,#12141f,#08080a)}@@ -424,7 +426,7 @@ button{font:inherit;color:inherit}@keyframes g-panel{0%,14%{opacity:0;transform:translateY(-3cqh)}28%,72%{opacity:1;transform:none}86%,100%{opacity:0;transform:translateY(-2cqh)}}@keyframes g-drop{0%,22%{opacity:0;transform:translateY(-4cqh)}36%,72%{opacity:1;transform:none}84%,100%{opacity:0;transform:translateY(-2cqh)}}@keyframes g-ptr{0%,8%{transform:translate(30cqw,12cqh)}24%,80%{transform:none}94%,100%{transform:translate(30cqw,12cqh)}}-@keyframes g-card{0%,38%{opacity:0;transform:translateY(5cqh)}50%,76%{opacity:1;transform:none}88%,100%{opacity:0;transform:translateY(2cqh)}}+@keyframes g-card{0%,31%{opacity:0;transform:translateY(5cqh)}36%,84%{opacity:1;transform:none}89%,100%{opacity:0;transform:translateY(4cqh)}}@keyframes g-sweep{0%,10%{transform:translateX(-100%);opacity:1}46%{transform:translateX(0);opacity:1}82%{transform:translateX(0);opacity:1}94%,100%{transform:translateX(0);opacity:0}}@keyframes g-glow{0%,16%{opacity:0}28%,70%{opacity:1}84%,100%{opacity:0}}@keyframes g-play{0%,16%{opacity:0;transform:translateY(2.6cqw)}28%,70%{opacity:1;transform:none}84%,100%{opacity:0;transform:translateY(1.6cqw)}}@@ -990,7 +992,7 @@ html.fx-open{overflow:hidden;padding-right:var(--fx-gap,0px)} /* the page does n<h3 class="fx-sub">Good to know</h3><dl class="fx-know"><div><dt>Starts</dt><dd>As the page opens. The headline is clear within a second; everything ends in about two and a half seconds.</dd></div>- <div><dt>On phones</dt><dd>The headline wraps onto more lines that arrive together. Use less blur there, where it costs more.</dd></div>+ <div><dt>On phones</dt><dd>Use less blur on phones, where it costs more.</dd></div><div><dt>Reduced motion</dt><dd>The opening is skipped: everything shows at once.</dd></div></dl><h3 class="fx-sub">Build it with these animations</h3>@@ -1000,7 +1002,7 @@ html.fx-open{overflow:hidden;padding-right:var(--fx-gap,0px)} /* the page does n<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, the buttons and the main picture at the top of your page]</mark>. As the page opens, bring in the headline, each line fading in while it rises a little and sharpens out of a soft blur, the second a moment after the first. Then bring in the line under it, the buttons and the picture the same way, each a little later and slower. Use one smooth ease-out, so the headline is clear within a second and everything ends in about two and a half seconds. 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>+ <div class="fx-pbox"><p class="fx-prompt">Add a focus-in opening to <mark>[the headline, the line under it, the buttons and the picture at the top of your page]</mark>. As the page opens, bring in the headline, each line fading in while it rises a little and sharpens out of a soft blur, the second a moment after the first. Then bring in the line under it, the buttons and the picture the same way, each a little later and slower. Let every part start fast and settle gently: the headline is clear within a second and everything ends in about two and a half seconds. 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><a class="fx-real" href="https://linear.app/" target="_blank" rel="noopener">Watch the real one on linear.app <span aria-hidden="true">↗</span><span class="sr"> (opens in a new tab)</span></a></section>@@ -1040,11 +1042,21 @@ html.fx-open{overflow:hidden;padding-right:var(--fx-gap,0px)} /* the page does n</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://en.wikipedia.org/wiki/Animation" target="_blank" rel="noopener">en.wikipedia.org/wiki/Animation<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <p class="fx-seen">Seen on <a href="https://en.wikipedia.org/wiki/Animation" target="_blank" rel="noopener">en.wikipedia.org/wiki/Animation<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-22">2026</time></p><h2 id="wikipedia-previews-t" tabindex="-1">Link previews</h2><p class="fx-chips"><span class="fx-chip">Starts on hover</span><span class="fx-chip">Made from 2 animations</span></p>+ <div class="fx-version">+ <div class="fx-stage">+ <iframe title="Our version: Link previews" data-src="versions/wikipedia-previews.html"></iframe>+ <span class="fx-vlabel" aria-hidden="true">Our version</span>+ </div>+ <div class="fx-player">+ <button type="button" class="fx-pbtn" data-fx-cmd="show">Show me</button>+ <p class="fx-phint">Built from the prompt below. Point at it, or press Show me.</p>+ </div>+ </div><h3 class="fx-sub">What you see</h3>- <p class="fx-what">On any article, 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>+ <p class="fx-what">On any article, rest the pointer on a link and, after about half a second, a small card with the linked article's first lines and picture fades in under the link, rising slightly into place. It stays while the pointer is on it and fades out a moment after the pointer leaves.</p><h3 class="fx-sub">Good to know</h3><dl class="fx-know"><div><dt>Starts</dt><dd>Resting the pointer on a link for a moment, or reaching it with the keyboard.</dd></div>@@ -1057,7 +1069,7 @@ html.fx-open{overflow:hidden;padding-right:var(--fx-gap,0px)} /* the page does n<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>+ <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 about half a second, a small card with the linked page's title, first sentences and picture fades in below the link, rising into place. The card stays while the pointer is on it and fades a moment after the pointer leaves. The wait keeps cards from flashing while the pointer only passes by, and a card with no room below 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><a class="fx-real" href="https://en.wikipedia.org/wiki/Animation" target="_blank" rel="noopener">Watch the real one on en.wikipedia.org <span aria-hidden="true">↗</span><span class="sr"> (opens in a new tab)</span></a></section>diff --git a/famous/versions/linear-intro.html b/famous/versions/linear-intro.htmlindex f257c275..07b6bcce 100644--- a/famous/versions/linear-intro.html+++ b/famous/versions/linear-intro.html@@ -11,30 +11,30 @@:root{--c1:#6ea8ff;--c2:#5fd88a;--c3:#b98cff;--c4:#ff9d5c;--c5:#ff6f8b;--c6:#3fd6c4;--c7:#ffce5a;color-scheme:dark}html.lite{--bs:.4}*{box-sizing:border-box;margin:0}-html{background:#0b0b0f;scrollbar-width:thin;scrollbar-color:#3c3c4a #0b0b0f}+html{background:#0b0b0f;overflow:hidden;scrollbar-width:thin;scrollbar-color:#3c3c4a #0b0b0f}body{color:#f4f4f2;font:400 15px/1.5 'Schibsted Grotesk',system-ui,-apple-system,'Segoe UI',sans-serif;-webkit-font-smoothing:antialiased}-.hero{display:flex;flex-direction:column;align-items:center;min-height:100vh;min-height:100svh;padding:clamp(44px,12vh,92px) clamp(16px,5vw,48px) 0;text-align:center;overflow:hidden;background:radial-gradient(90% 60% at 50% 0,rgba(110,168,255,.1),transparent 70%)}+.hero{display:flex;flex-direction:column;align-items:center;height:100vh;height:100svh;padding:clamp(44px,12vh,92px) clamp(16px,5vw,48px) 0;text-align:center;overflow:hidden;background:radial-gradient(90% 60% at 50% 0,rgba(110,168,255,.1),transparent 70%)}h1{font-size:clamp(22px,min(9.5vw,9.4vh),60px);line-height:1.08;font-weight:650;letter-spacing:-.025em}.ln{display:block}.sub{max-width:30em;margin-top:clamp(8px,1.8vh,16px);font-size:clamp(13px,min(3.6vw,3.6vh),18px);line-height:1.45;color:#b9bccd;text-wrap:balance}.cta{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:clamp(12px,3vh,26px)}-.btn{min-width:44px;min-height:44px;padding:0 20px;border-radius:99px;border:1.5px solid rgba(255,255,255,.32);background:none;color:#f4f4f2;font:600 clamp(14px,2vh,16px) 'Schibsted Grotesk',system-ui,sans-serif;cursor:pointer;transition:transform .15s}+.btn{min-width:44px;min-height:44px;padding:0 clamp(14px,4vw,20px);border-radius:99px;border:1.5px solid rgba(255,255,255,.32);background:none;color:#f4f4f2;font:600 clamp(14px,2vh,16px) 'Schibsted Grotesk',system-ui,sans-serif;cursor:pointer;transition:transform .15s}.btn.p{border-color:var(--c1);background:var(--c1);color:#0b0b0f}.btn:active{transform:scale(.97)}.btn:focus-visible{outline:3px solid #fff;outline-offset:3px}/* Every part comes in the same way: it fades up from transparent while it rises a little and sharpens out of a soft blur. Only the delay, the length, the rise and the blur differ. */.a{--d:0s;--t:1.2s;--y:.34em;--b:calc(.2em * var(--bs, 1))}.ln+.ln{--d:.09s}-.sub{--d:.2s;--y:.7em;--b:calc(.5em * var(--bs, 1))}-.cta{--d:.45s;--t:1.1s;--y:7px;--b:calc(6px * var(--bs, 1))}+.sub{--d:.2s;--t:1.35s;--y:.7em;--b:calc(.5em * var(--bs, 1))}+.cta{--d:.45s;--t:1.5s;--y:7px;--b:calc(6px * var(--bs, 1))}.sw{--d:.9s;--t:2.2s;--y:0px;--b:calc(8px * var(--bs, 1))}.lite .sw{--b:0px}.pre .a{opacity:0;transform:translateY(var(--y));filter:blur(var(--b))}.on .a{animation:rise var(--t) cubic-bezier(.3,.8,.35,1) var(--d) backwards}@keyframes rise{from{opacity:0;transform:translateY(var(--y));filter:blur(var(--b))}}/* the app window: shapes only, cropped by the bottom of the box and faded out there */-.sw{position:relative;isolation:isolate;flex:1 0 96px;width:100%;max-width:780px;margin-top:clamp(14px,3.6vh,38px)}-.sw::before{content:"";position:absolute;z-index:-1;inset:-14% -8% 20%;background:radial-gradient(55% 65% at 50% 38%,rgba(110,168,255,.3),rgba(185,140,255,.16) 58%,transparent 78%)}+.sw{position:relative;isolation:isolate;flex:1 1 0;min-height:0;width:100%;max-width:780px;margin-top:clamp(14px,3.6vh,38px)}+.sw::before{content:"";position:absolute;z-index:-1;left:-6%;right:-6%;top:-60px;height:240px;background:radial-gradient(closest-side,rgba(110,168,255,.3),rgba(185,140,255,.16) 58%,transparent)}.lite .sw::before{display:none}.win{position:absolute;inset:0;overflow:hidden;text-align:left;border:1px solid rgba(255,255,255,.12);border-bottom:0;border-radius:14px 14px 0 0;background:linear-gradient(#181823,#101018);-webkit-mask-image:linear-gradient(#000 calc(100% - min(70px,40%)),transparent);mask-image:linear-gradient(#000 calc(100% - min(70px,40%)),transparent)}.wb{display:flex;align-items:center;gap:6px;height:30px;padding:0 12px;border-bottom:1px solid rgba(255,255,255,.07)}@@ -69,7 +69,7 @@ h1{font-size:clamp(22px,min(9.5vw,9.4vh),60px);line-height:1.08;font-weight:650;<body><main class="hero"><h1><span class="a ln">Your headline</span><span class="a ln">comes into focus</span></h1>- <p class="a sub">Then the rest follows, one part at a time.</p>+ <p class="a sub">Then the rest follows, in turn.</p><div class="a cta"><button type="button" class="btn p">Get started</button><button type="button" class="btn">Learn more</button></div><div class="a sw"><div class="win" role="img" aria-label="An abstract app window: a column of rows beside a page with a heading, three lines of text, three cards and a chart of bars."><div class="wb"><i></i><i></i><i></i><b></b></div>@@ -102,7 +102,7 @@ addEventListener('message', e => {if (e.source !== parent || !e.data) return;if (e.data.fx === 'replay') play();});-reduce.addEventListener('change', () => { clearTimeout(timer); if (reduce.matches) mode(''); });+reduce.addEventListener('change', () => { clearTimeout(timer); mode(''); });addEventListener('load', () => Promise.race([document.fonts && document.fonts.ready, new Promise(r => setTimeout(r, 1000))]).then(arrive));</script></body>diff --git a/famous/versions/wikipedia-previews.html b/famous/versions/wikipedia-previews.htmlnew file mode 100644index 00000000..e936e3fc--- /dev/null+++ b/famous/versions/wikipedia-previews.html@@ -0,0 +1,188 @@+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<meta name="robots" content="noindex">+<title>Our version: Link previews</title>+<style>+@font-face{font-family:'Schibsted Grotesk';src:url('../../assets/fonts/schibsted-latin-ext.woff2') format('woff2');font-weight:400 900;font-display:swap;unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}+@font-face{font-family:'Schibsted Grotesk';src:url('../../assets/fonts/schibsted-latin.woff2') format('woff2');font-weight:400 900;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}+:root{--c1:#6ea8ff;--c2:#5fd88a;--c3:#b98cff;--c4:#ff9d5c;--c5:#ff6f8b;--c6:#3fd6c4;--c7:#ffce5a;--card:#181a23;--edge:rgba(255,255,255,.17);color-scheme:dark}+*{box-sizing:border-box;margin:0}+html,body{height:100%}+html{background:#0b0b0f}+body{color:#f4f4f2;font:400 15px/1.5 'Schibsted Grotesk',system-ui,-apple-system,'Segoe UI',sans-serif;-webkit-font-smoothing:antialiased}+/* the stage is a short article on a dark page; the card is laid over it, so it can cover the lines under its link like a pop-up */+.stage{position:relative;height:100%;min-height:200px;overflow:hidden;display:flex;flex-direction:column;background:radial-gradient(80% 110% at 25% 0,#141830,#0b0b0f 72%)}+.doc{width:100%;max-width:640px;margin:auto;padding:46px clamp(18px,5vw,44px) 14px}+h1{margin-bottom:.45em;font-size:clamp(21px,3.4vw,32px);font-weight:700;line-height:1.15;letter-spacing:-.025em}+.doc p{font-size:clamp(14px,1.5vw + 6px,20px);line-height:1.7;color:#d2d5e2}+.doc p+p{margin-top:.7em;color:#b4b8cb}+@media(max-width:600px),(max-height:380px){.doc p+p{display:none}}+@media(max-height:270px){h1{display:none}.doc{padding-top:44px}}+/* a link: underlined by dots, lit while it holds the card; its touch area is 44px tall */+a.lk{position:relative;display:inline-block;margin:0 -3px;padding:0 3px;border-radius:5px;color:var(--c1);white-space:nowrap;text-decoration:underline dotted;text-decoration-thickness:1.5px;text-underline-offset:4px;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background .15s,color .15s}+a.lk::after{content:"";position:absolute;left:50%;top:50%;width:max(100%,44px);height:44px;transform:translate(-50%,-50%)}+a.lk.hov{background:rgba(110,168,255,.2);color:#fff;text-decoration-style:solid}+a.lk:active{background:rgba(110,168,255,.3)}+a.lk:focus-visible{outline:3px solid #fff;outline-offset:2px;color:#fff}+/* the card: it comes in 18/100 s, rising 20px toward its link, and leaves a little faster; a small point aims at where the pointer came in */+.card{position:absolute;left:0;top:0;z-index:5;width:min(clamp(300px,36vw,336px),calc(100% - 20px));display:flex;gap:12px;padding:12px;border-radius:14px;background:var(--card);border:1px solid var(--edge);box-shadow:0 18px 40px rgba(0,0,0,.55);opacity:0;visibility:hidden;pointer-events:none;transform:translateY(var(--dy,20px));transition:opacity .15s ease-in,transform .15s ease-in,visibility 0s linear .15s}+.card.on{opacity:1;visibility:visible;pointer-events:auto;transform:none;transition:opacity .18s ease-out,transform .18s ease-out,visibility 0s}+.card::before{content:"";position:absolute;top:-6px;left:var(--tx,24px);width:10px;height:10px;margin-left:-5px;background:var(--card);border:solid var(--edge);border-width:1px 0 0 1px;transform:rotate(45deg)}+.card.up::before{top:auto;bottom:-6px;border-width:0 1px 1px 0}+.lite .card{box-shadow:0 10px 22px rgba(0,0,0,.55)}+.pic{flex:none;width:clamp(64px,8vw,76px);height:clamp(64px,8vw,76px);border-radius:10px;background:linear-gradient(140deg,var(--a),var(--b))}+.pic svg{display:block;width:100%;height:100%}+.card h2{font-size:clamp(15px,1.7vw,16px);font-weight:650;line-height:1.25;color:#fff}+.card p{margin-top:3px;font-size:clamp(13px,1.5vw,14px);line-height:1.45;color:#b9bdd0}+.note{position:absolute;left:50%;bottom:14px;z-index:6;max-width:calc(100% - 24px);padding:7px 14px;border-radius:99px;background:#f4f4f2;color:#16161b;font-size:13px;font-weight:600;white-space:nowrap;opacity:0;transform:translate(-50%,6px);pointer-events:none;transition:opacity .2s,transform .2s}+.note.on{opacity:1;transform:translate(-50%,0)}+/* the demo's pointer: a dot with a dark ring, so it shows on the page and on the card */+.dot{position:absolute;left:0;top:0;z-index:7;width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:50%;border:2px solid #fff;background:rgba(255,255,255,.22);box-shadow:0 0 0 2px rgba(11,11,15,.7),0 3px 12px rgba(0,0,0,.5);opacity:0;pointer-events:none;transition:opacity .2s}+.dot.on{opacity:1}+@media (prefers-reduced-motion:reduce){.card,.card.on{transform:none}.card{transition:opacity .12s linear,visibility 0s linear .12s}.card.on{transition:opacity .12s linear}.note,.note.on{transform:translateX(-50%);transition:opacity .15s}.dot{transition:none}}+</style>+<script>+{+ const q = '(max-width:600px),(max-height:500px)';+ let lite;+ try { lite = window.parent.matchMedia(q).matches; } catch (e) { lite = screen.width <= 600 || screen.height <= 500; }+ document.documentElement.classList.toggle('lite', lite);+}+</script>+</head>+<body>+<div class="stage" id="stage" role="group" aria-label="A short article about paper planes with four links. Rest the pointer on a link, or reach it with the keyboard, and a small card about it appears; press Escape to hide the card.">+ <main class="doc">+ <h1>Paper planes</h1>+ <p>A paper plane is a <a class="lk" href="#" data-k="0">glider</a> made from one flat sheet. Its <a class="lk" href="#" data-k="1">wings</a> are creased so air slides under them, and the <a class="lk" href="#" data-k="2">lift</a> that follows keeps it up. Folding one is <a class="lk" href="#" data-k="3">origami</a>.</p>+ <p>The same sheet, folded two ways, can float far or dive fast. Small bends at the tail decide which.</p>+ </main>+ <div class="card" id="tip" role="tooltip"></div>+ <p class="note" id="note" role="status"></p>+ <i class="dot" id="dot" aria-hidden="true"></i>+</div>+<script>+const $ = s => document.querySelector(s), clamp = (v, a, b) => Math.min(Math.max(v, a), b);+const reduce = matchMedia('(prefers-reduced-motion: reduce)');+const stage = $('#stage'), card = $('#tip'), note = $('#note'), dot = $('#dot'), links = [...document.querySelectorAll('a.lk')];+const SHOW = 500, HIDE = 300, KEYS = 300; // the pointer rests half a second before a card shows, a key takes 300 ms, and a card stays 300 ms after the pointer leaves++// Our own cards: a title, a few short lines and a picture drawn in shapes on a gradient.+const W7 = 'fill="#fff" fill-opacity=".95"', SH = 'fill="#0b0b0f" fill-opacity=".22"', AIR = 'fill="none" stroke="#fff" stroke-opacity=".55" stroke-width="2" stroke-linecap="round"';+const CARDS = [+ { t: 'Glider', d: 'A craft with no engine that rides the air as it slowly sinks.', a: '#6ea8ff', b: '#b98cff', s: `<path ${W7} d="M12 42 62 16 46 58 38 44Z"/><path ${SH} d="M38 44 62 16 32 48Z"/><path ${AIR} d="M10 24q14-8 26 0M20 14q10-5 20 0"/>` },+ { t: 'Wings', d: 'The flat surfaces that meet the air. Their shape sets the push.', a: '#3fd6c4', b: '#6ea8ff', s: `<path ${W7} d="M8 46C22 26 50 26 64 42 50 50 24 52 8 46Z"/><path ${AIR} d="M12 20q24-10 48 0M16 12q20-8 40 0"/>` },+ { t: 'Lift', d: 'The upward push of moving air. It has to beat the weight.', a: '#ff9d5c', b: '#ff6f8b', s: `<path ${W7} d="M36 12 54 34H43v26H29V34H18Z"/><path ${AIR} d="M10 64h52"/>` },+ { t: 'Origami', d: 'Folding one sheet into a shape, with no cuts and no glue.', a: '#ffce5a', b: '#ff9d5c', s: `<path ${W7} d="M36 10 62 36 36 62 10 36Z"/><path ${SH} d="M36 10 62 36H10Z"/><path fill="none" stroke="#0b0b0f" stroke-opacity=".25" stroke-width="2" d="M10 36 36 62 62 36"/>` }+];++// The card follows what the live effect does: a pointer must rest on a link for 500 ms (a pass over it shows nothing); the card then+// fades in below the link while rising into place; it stays while the pointer is on it and for 300 ms after the pointer leaves the link+// or the card; a pointer that goes to another link closes it at once, and the next card waits its own 500 ms.+let cur = null, open = false, dismissed = null, showT = 0, hideT = 0, noteT = 0, run = false, timers = [], acted = false, seen = null;+const setHov = a => links.forEach(l => l.classList.toggle('hov', l === a));+function reveal(a, x) {+ const c = CARDS[a.dataset.k];+ card.innerHTML = `<div class="pic" style="--a:${c.a};--b:${c.b}"><svg viewBox="0 0 72 72" aria-hidden="true">${c.s}</svg></div><div><h2>${c.t}</h2><p>${c.d}</p></div>`;+ const s = stage.getBoundingClientRect(), r = a.getBoundingClientRect(), H = s.height, cw = card.offsetWidth, ch = card.offsetHeight, M = 10, G = 9;+ const lx = x - s.left, below = r.bottom - s.top + G, above = r.top - s.top - G - ch;+ const up = below + ch > H - M && (above >= M || r.top - s.top > H - (r.bottom - s.top)); // no room below: above the link+ const left = clamp(lx - 18, M, s.width - cw - M); // its left edge sits just left of where the pointer came in, and always inside the box+ card.style.transition = 'none';+ card.style.left = left + 'px'; card.style.top = clamp(up ? above : below, M, H - ch - M) + 'px';+ card.style.setProperty('--tx', clamp(lx - left, 22, cw - 22) + 'px'); card.style.setProperty('--dy', (up ? -20 : 20) + 'px');+ card.classList.toggle('up', up);+ void card.offsetWidth; card.style.transition = ''; // placed at rest, so the rise starts from the new place+ card.classList.add('on'); open = true; a.setAttribute('aria-describedby', 'tip');+}+function conceal() { card.classList.remove('on'); open = false; links.forEach(l => l.removeAttribute('aria-describedby')); }+function done() { clearTimeout(showT); clearTimeout(hideT); conceal(); cur = dismissed = null; setHov(null); }+function enter(a, x, wait = SHOW) {+ clearTimeout(hideT);+ if (cur === a || dismissed === a) return; // the same link (its card stays) or one the visitor dismissed+ if (open) conceal(); // another card is open: it goes at once+ clearTimeout(showT); cur = a; setHov(a);+ showT = setTimeout(() => reveal(a, x), wait);+}+function leave() {+ if (!cur) return;+ clearTimeout(showT); clearTimeout(hideT);+ if (!open) return done(); // never shown: a pass over a link leaves nothing behind+ hideT = setTimeout(done, HIDE);+}++// The visitor's pointer (touch has no hover, so a tap only opens the link), keys and focus.+const zone = el => el && el.closest ? el.closest('a.lk, .card') : null;+document.addEventListener('pointerover', e => {+ if (e.pointerType === 'touch' || run) return;+ const to = zone(e.target); if (!to || to === zone(e.relatedTarget)) return;+ if (to.classList.contains('card')) clearTimeout(hideT); else enter(to, e.clientX);+});+document.addEventListener('pointerout', e => {+ if (e.pointerType === 'touch' || run) return;+ const from = zone(e.target); if (from && from !== zone(e.relatedTarget)) leave();+});+document.addEventListener('focusin', e => {+ const a = e.target.closest && e.target.closest('a.lk'); if (!a || !a.matches(':focus-visible')) return;+ acted = true; stopRun(); // a key that brings focus here is the visitor's: it ends a run and the arrival+ const r = a.getBoundingClientRect(); enter(a, r.left + Math.min(24, r.width / 2), KEYS);+});+document.addEventListener('focusout', e => { if (e.target.closest && e.target.closest('a.lk')) leave(); });+document.addEventListener('click', e => {+ const a = e.target.closest && e.target.closest('a.lk'); if (!a) return;+ e.preventDefault(); if (cur) { dismissed = cur; clearTimeout(showT); clearTimeout(hideT); conceal(); }+ note.textContent = 'Link opened: ' + CARDS[a.dataset.k].t; note.classList.add('on'); clearTimeout(noteT); noteT = setTimeout(() => note.classList.remove('on'), 1700);+});+// Escape hides a card that is shown or waiting, and leaves the pointer and the focus where they are; with none, it passes on (the pop-up closes).+addEventListener('keydown', e => {+ if (e.key !== 'Escape' || !(run || open || (cur && cur !== dismissed))) return;+ e.stopImmediatePropagation(); e.preventDefault();+ if (run) { acted = true; stopRun(); } else { dismissed = cur; clearTimeout(showT); clearTimeout(hideT); conceal(); }+}, true);++// Show me: a dot sweeps over the first link without stopping (no card), then rests on the third until its card has shown, and leaves.+const at = (ms, fn) => timers.push(setTimeout(fn, ms));+function stopRun() { timers.forEach(clearTimeout); timers = []; if (run) { run = false; dot.classList.remove('on'); done(); } }+function glide(x, y, ms) { dot.style.transition = reduce.matches ? 'none' : `opacity .2s, transform ${ms}ms cubic-bezier(.45,0,.25,1)`; dot.style.transform = `translate(${x.toFixed(1)}px,${y.toFixed(1)}px)`; }+function show() {+ stopRun(); done(); run = true;+ const s = stage.getBoundingClientRect(), W = s.width, H = s.height, pos = a => { const r = a.getBoundingClientRect(); return [r.left - s.left, r.right - s.left, r.top - s.top + r.height / 2]; };+ const [g0, g1, gy] = pos(links[0]), [l0, l1, ly] = pos(links[2]), lx = (l0 + l1) / 2;+ const place = (x, y) => { dot.style.transition = 'none'; dot.style.transform = `translate(${x}px,${y}px)`; void dot.offsetWidth; dot.classList.add('on'); };+ if (reduce.matches) { // no travel: the dot is simply at the link, the card fades in and out+ place(lx, ly); enter(links[2], lx);+ at(2000, () => { dot.classList.remove('on'); leave(); }); at(2700, () => { run = false; timers = []; });+ return;+ }+ place(Math.max(g0 - 36, 14), gy);+ at(300, () => glide(Math.min(g1 + 36, W - 14), gy, 460));+ at(420, () => enter(links[0], g0 + 8)); at(640, leave); // over the first link for about 0.2 s: nothing shows+ at(850, () => glide(lx, ly, 620));+ at(1470, () => enter(links[2], lx)); // resting on the third: the card shows 500 ms later+ at(2900, () => { const dy = card.classList.contains('up') ? 70 : -70; glide(clamp(lx + 60, 14, W - 14), clamp(ly + dy, 14, H - 14), 480); });+ at(2980, leave); // the card goes 300 ms after the pointer leaves+ at(3400, () => dot.classList.remove('on')); at(3650, () => { run = false; timers = []; });+}+// The visitor's own pointer, touch or key stops a run and takes over. A pointer that has not moved says nothing, and neither does a first sighting.+addEventListener('pointermove', e => {+ if (!e.isTrusted || e.pointerType === 'touch') return;+ seen = seen || [e.clientX, e.clientY];+ if (e.pointerType === 'mouse' && !e.movementX && !e.movementY) return;+ if (Math.hypot(e.clientX - seen[0], e.clientY - seen[1]) < 5) return;+ acted = true;+ if (run) { stopRun(); const z = zone(e.target); if (z && z.matches('a.lk')) enter(z, e.clientX); }+}, true);+['pointerdown', 'touchstart', 'keydown', 'wheel'].forEach(t => addEventListener(t, e => { if (e.isTrusted) { acted = true; if (e.key !== 'Escape') stopRun(); } }, { capture: true, passive: true }));+addEventListener('message', e => {+ if (e.source !== parent || !e.data) return;+ if (e.data.fx === 'show') { acted = true; show(); }+});+reduce.addEventListener('change', () => { stopRun(); done(); });+new ResizeObserver(() => { if (cur || run) { stopRun(); done(); } }).observe(stage);+addEventListener('load', () => setTimeout(() => { if (!acted && !reduce.matches) show(); }, 700));+</script>+</body>+</html>diff --git a/tests/famous.test.js b/tests/famous.test.jsindex 9f87a465..be3a2d0c 100644--- a/tests/famous.test.js+++ b/tests/famous.test.js@@ -489,7 +489,7 @@ const SITE_PHRASES = [const CHECKED_IDS = ['stripe-ribbon', 'apple-scroll', 'landonorris-reveal', 'linear-intro', 'apple-menu', 'wikipedia-previews', 'apple-sweep', 'spotify-cards', 'youtube-loading', 'pudding-chart', 'medium-top-bar'];const CHECKED_DAY = '2026-10-13';// Entries checked again on their site before the gallery release, and the day of that check.-const RECHECKED = { 'apple-menu': '2026-10-22', 'apple-scroll': '2026-10-22', 'landonorris-reveal': '2026-10-22', 'linear-intro': '2026-10-22', 'stripe-ribbon': '2026-10-22' };+const RECHECKED = { 'apple-menu': '2026-10-22', 'apple-scroll': '2026-10-22', 'landonorris-reveal': '2026-10-22', 'linear-intro': '2026-10-22', 'stripe-ribbon': '2026-10-22', 'wikipedia-previews': '2026-10-22' };// The text a visitor reads, with each tag ending a word (textOf above joins the end of one element to the start of the next, so a// slogan at the end of a card label would run into the card's name and go unseen).