Skip to content

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.

feat: our version of gray shapes while it loads; the entry describes what its site shows now, still shapes swapped for content (checked 2026-10-22)

matinf91dacbaefbb
diff --git a/famous/index.html b/famous/index.html
index 7818ed84..c9cf0566 100644
--- a/famous/index.html
+++ b/famous/index.html
@@ -360,27 +360,27 @@ button{font:inherit;color:inherit}
.gp-cards .play::after{content:"";position:absolute;left:32%;top:25%;width:42%;height:50%;background:#0b1226;clip-path:polygon(0 0,100% 50%,0 100%)}
.gp-cards .ptr{left:44.3cqw;top:26.5cqw;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)}
-/* gray shapes that fill in: a sheen passes over each, then the content takes their places */
-.gp-load{background:#0a0b10}
+/* gray shapes that fill in: they sit still while the content loads, then the text swaps in at once and each picture switches on a moment after the one before it; at rest the first card is filled and the others are still gray */
+.gp-load{background:#0b0b0f}
.gp-load .ld{position:absolute;top:19.5cqw;width:26.6cqw;height:25cqw}
.gp-load .l-a{left:5.4cqw}
.gp-load .l-b{left:36.7cqw}
.gp-load .l-c{left:68cqw}
-.gp-load .ld i{background:#282d3b;overflow:hidden}
-.gp-load .ld i::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.16) 50%,transparent 70%);transform:translateX(-100%)}
-.gp-load .th{left:0;top:0;width:100%;height:15cqw;border-radius:1.6cqw}
+.gp-load .ld i{background:#2f3445;overflow:hidden}
+.gp-load .th{left:0;top:0;width:100%;height:15cqw;border-radius:1.6cqw;background:#232738}
.gp-load .av{left:0;top:17.4cqw;width:5.6cqw;height:5.6cqw;border-radius:50%}
-.gp-load .m1{left:7.2cqw;top:17.6cqw;width:19cqw;height:2cqw;border-radius:1cqw}
-.gp-load .m2{left:7.2cqw;top:21.4cqw;width:13cqw;height:1.7cqw;border-radius:1cqw}
+.gp-load .m1{left:7.2cqw;top:17.6cqw;width:17.5cqw;height:2cqw;border-radius:.6cqw}
+.gp-load .m2{left:7.2cqw;top:21.4cqw;width:11.6cqw;height:1.7cqw;border-radius:.6cqw}
.gp-load .ld i b{position:absolute;inset:0;opacity:0}
-.gp-load .l-a .th b{background:linear-gradient(135deg,var(--c3),var(--c1))}
-.gp-load .l-b .th b{background:linear-gradient(135deg,var(--c4),var(--c5))}
-.gp-load .l-c .th b{background:linear-gradient(135deg,var(--c6),var(--c2))}
+.gp-load .l-a i b{opacity:1}
+.gp-load .l-a .th b{background:radial-gradient(circle at 74% 28%,var(--c7) 0 9%,#0000 9.6%),radial-gradient(ellipse 72% 40% at 20% 112%,#0b1530 0 97%,#0000 100%),linear-gradient(155deg,var(--c1),var(--c6))}
+.gp-load .l-b .th b{background:radial-gradient(circle at 30% 70%,#ffe2b0 0 17%,#0000 17.6%),radial-gradient(circle at 62% 74%,#ffd08a 0 19%,#0000 19.6%),linear-gradient(155deg,var(--c4),var(--c5))}
+.gp-load .l-c .th b{background:radial-gradient(circle at 26% 30%,#f4f1ff 0 6.5%,#0000 7.1%),radial-gradient(ellipse 85% 36% at 30% 120%,#0d0b2a 0 97%,#0000 100%),linear-gradient(155deg,var(--c3),#2b2a72)}
.gp-load .l-a .av b{background:var(--c1)}
-.gp-load .l-b .av b{background:var(--c5)}
-.gp-load .l-c .av b{background:var(--c2)}
-.gp-load .m1 b{background:#d5d9e6}
-.gp-load .m2 b{background:#7b839b}
+.gp-load .l-b .av b{background:var(--c4)}
+.gp-load .l-c .av b{background:var(--c3)}
+.gp-load .m1 b{background:#e6e8f0}
+.gp-load .m2 b{background:#8f96ad}
/* the chart that changes step by step as the text goes by */
.gp-chart{background:radial-gradient(80% 90% at 70% 60%,#10152a,#08080a 72%)}
@@ -439,8 +439,8 @@ button{font:inherit;color:inherit}
@keyframes g-hv{0%,13%{opacity:0}17%,45.5%{opacity:1}49%,100%{opacity:0}}
@keyframes g-pl{0%,13%{opacity:0;transform:translateY(1cqw)}17%,45.5%{opacity:1;transform:none}49%,100%{opacity:0;transform:translateY(1cqw)}}
@keyframes g-pt{0%{opacity:0;transform:translate(-41.5cqw,-15.7cqw)}6%{opacity:1;transform:translate(-41.5cqw,-15.7cqw)}16%,40%{opacity:1;transform:translate(-31.3cqw,0)}50%,78%{opacity:1;transform:none}86%{opacity:1;transform:translate(8cqw,-16.7cqw)}92%,100%{opacity:0;transform:translate(8cqw,-16.7cqw)}}
-@keyframes g-sheen{0%{transform:translateX(-100%)}17%{transform:translateX(100%)}18%{transform:translateX(-100%)}35%,100%{transform:translateX(100%)}}
-@keyframes g-fill{0%,40%{opacity:0}52%,86%{opacity:1}97%,100%{opacity:0}}
+@keyframes g-pop{0%,31%{opacity:0}31.5%,88%{opacity:1}88.5%,100%{opacity:0}}
+@keyframes g-fill{0%,33%{opacity:0}33.4%,88%{opacity:1}88.5%,100%{opacity:0}}
@keyframes g-bars{0%,26%{transform:scaleY(var(--a))}36%,62%{transform:scaleY(var(--b))}72%,92%{transform:scaleY(var(--c))}100%{transform:scaleY(var(--a))}}
@keyframes g-mark{0%,26%{transform:none}36%,62%{transform:translateY(6cqw)}72%,92%{transform:translateY(12cqw)}100%{transform:none}}
@keyframes g-page{0%,10%{transform:translateY(-6cqh)}38%,56%{transform:translateY(-40cqh)}70%,92%{transform:translateY(-32cqh)}100%{transform:translateY(-6cqh)}}
@@ -492,10 +492,10 @@ button{font:inherit;color:inherit}
.gp-cards .cb{--d:1.95s}
.gp-cards .ptr{animation:g-pt 6s ease-in-out infinite backwards;animation-delay:calc(0s - var(--x))}
.gp-load{--x:1.5s}
- .gp-load .ld i::after{animation:g-sheen 7s ease-in-out infinite backwards;animation-delay:calc(0s - var(--x))}
- .gp-load .ld i b{animation:g-fill 7s var(--ease) infinite backwards;animation-delay:calc(var(--d,0s) - var(--x))}
- .gp-load .l-b i b{--d:.14s}
- .gp-load .l-c i b{--d:.28s}
+ .gp-load .ld i b{animation:g-pop 7s linear infinite backwards;animation-delay:calc(0s - var(--x))}
+ .gp-load .ld .th b{animation-name:g-fill;animation-delay:calc(var(--d,0s) - var(--x))}
+ .gp-load .l-b{--d:.15s}
+ .gp-load .l-c{--d:.3s}
.gp-chart{--x:3.2s}
.gp-chart .bar{animation:g-bars 7s var(--ease) infinite backwards;animation-delay:calc(0s - var(--x))}
.gp-chart .mk{animation:g-mark 7s var(--ease) infinite backwards;animation-delay:calc(0s - var(--x))}
@@ -845,7 +845,7 @@ html.fx-open{overflow:hidden;padding-right:var(--fx-gap,0px)} /* the page does n
</div>
<div class="t-meta">
<h3 class="t-title"><a href="#youtube-loading">Gray shapes while it loads</a></h3>
- <p class="t-desc">Gray boxes hold each video's place until it loads.</p>
+ <p class="t-desc">Still gray boxes hold each video's place until the real thing swaps in.</p>
<p class="t-foot"><a class="t-site" href="https://www.youtube.com/" target="_blank" rel="noopener">Seen on youtube.com <span aria-hidden="true">↗</span><span class="sr"> (opens in a new tab)</span></a><span class="t-count">1 animation</span></p>
</div>
</li>
@@ -1151,23 +1151,33 @@ html.fx-open{overflow:hidden;padding-right:var(--fx-gap,0px)} /* the page does n
</section>
<section class="fx" id="youtube-loading" aria-labelledby="youtube-loading-t" data-fx-site="YouTube" data-fx-start="load">
- <p class="fx-seen">Seen on <a href="https://www.youtube.com/" target="_blank" rel="noopener">youtube.com<span class="sr"> (opens in a new tab)</span></a> in&nbsp;<time datetime="2026-10-13">2026</time></p>
+ <p class="fx-seen">Seen on <a href="https://www.youtube.com/" target="_blank" rel="noopener">youtube.com<span class="sr"> (opens in a new tab)</span></a> in&nbsp;<time datetime="2026-10-22">2026</time></p>
<h2 id="youtube-loading-t" tabindex="-1">Gray shapes while it loads</h2>
<p class="fx-chips"><span class="fx-chip">Starts on load</span><span class="fx-chip">Made from 1 animation</span></p>
+ <div class="fx-version">
+ <div class="fx-stage">
+ <iframe title="Our version: Gray shapes while it loads" data-src="versions/youtube-loading.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="replay">Replay</button>
+ <p class="fx-phint">Built from the prompt below. Press Replay to see it again.</p>
+ </div>
+ </div>
<h3 class="fx-sub">What you see</h3>
- <p class="fx-what">Before the videos appear, gray boxes and bars in the shapes of thumbnails, round channel pictures and titles fill the page; then the real content takes their places.</p>
+ <p class="fx-what">Before the videos appear, gray boxes and bars in the shapes of pictures, round channel icons and titles fill the page, and they sit perfectly still. When the videos arrive, the whole grid of shapes gives way to the real cards in the same places: the text at once, then the pictures one by one as each finishes loading.</p>
<h3 class="fx-sub">Good to know</h3>
<dl class="fx-know">
- <div><dt>Starts</dt><dd>While the content loads. It stops when the content arrives.</dd></div>
- <div><dt>On phones</dt><dd>Fewer shapes are shown.</dd></div>
- <div><dt>Reduced motion</dt><dd>The shapes stay still.</dd></div>
+ <div><dt>Starts</dt><dd>While the content loads. The shapes leave as the content arrives.</dd></div>
+ <div><dt>On phones</dt><dd>Fewer shapes are shown, so they fit the screen.</dd></div>
+ <div><dt>Reduced motion</dt><dd>Everything appears at once, the pictures together with the text.</dd></div>
</dl>
<h3 class="fx-sub">Build it with these animations</h3>
<div class="fx-cards">
<article class="card c4" data-slug="skeleton-loader"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Gray shapes</span></div><div class="meta"><h4 class="title"><a href="../animations/04-micro-interactions/skeleton-loader/">Skeleton Loader</a></h4><p class="desc">Gray shapes hold the place of content while it loads. Best for feeds and cards.</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 loading state to <mark>[the grid or feed whose content loads]</mark>. While the content loads, show gray shapes in the sizes of what is coming, such as a picture box, a round avatar and two lines of text, and let them pulse gently between lighter and darker. When the content arrives, put it exactly where the shapes were and fade it in, so nothing on the page jumps. Show only as many shapes as fit the screen, fewer on phones, and stop the pulse as soon as the content is in. Tell screen readers that the content is loading. If the visitor has reduced motion turned on, keep the shapes still.</p></div>
+ <div class="fx-pbox"><p class="fx-prompt">Add a loading state to <mark>[the grid or feed whose content loads]</mark>. While the content loads, show still gray shapes where each item will go, in the sizes of what is coming: a picture box, a round avatar and two lines of text. When the content arrives, swap it in for the shapes in exactly the same places, so nothing on the page jumps: the text and avatars at once, then each picture a moment later, one after another, with no fade. Show only as many shapes as fit the screen, fewer on phones. Tell screen readers that the content is loading. If the visitor has reduced motion turned on, show everything at once, the pictures together with the text.</p></div>
<button type="button" class="copy" aria-label="Copy prompt for Gray shapes while it loads"><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://www.youtube.com/" target="_blank" rel="noopener">Watch the real one on youtube.com <span aria-hidden="true">↗</span><span class="sr"> (opens in a new tab)</span></a>
</section>
diff --git a/famous/versions/youtube-loading.html b/famous/versions/youtube-loading.html
new file mode 100644
index 00000000..33b410d6
--- /dev/null
+++ b/famous/versions/youtube-loading.html
@@ -0,0 +1,126 @@
+<!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: Gray shapes while it loads</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;--sk:#1f2230;--sk2:#2a2e3d;color-scheme:dark}
+*{box-sizing:border-box;margin:0}
+html{height:100%;overflow:hidden;background:#0b0b0f}
+body,main{height:100%}
+body{color:#f1f2f6;font:400 13px/1.3 'Schibsted Grotesk',system-ui,-apple-system,'Segoe UI',sans-serif;-webkit-font-smoothing:antialiased}
+.sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
+/* The grid fills the box exactly: the script picks columns and rows so every card fits whole (see layout). */
+.grid{display:grid;grid-template-columns:repeat(var(--c,2),minmax(0,1fr));grid-template-rows:repeat(var(--r,1),minmax(0,1fr));gap:var(--g,16px);height:100%;padding:var(--p,20px);list-style:none}
+.card{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0}
+.card[hidden]{display:none}
+/* Loading: still gray shapes, one for the picture, one for the avatar and one bar each for the title and the channel.
+ They sit exactly where the real content will be, so the content only has to be switched on. */
+.pic{position:relative;flex:1 1 0;min-height:0;border-radius:8px;overflow:hidden;background:var(--sk)}
+.art{position:absolute;inset:0;opacity:0;transition:opacity 0s}
+.meta{display:flex;gap:10px;height:36px;flex:none}
+.av{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--sk2);font-weight:700;font-size:14px;color:#0b0b0f}
+.tx{flex:1;min-width:0}
+.t,.c{position:relative;white-space:nowrap}
+.t span,.c span{display:block;overflow:hidden;text-overflow:ellipsis}
+.t{margin-bottom:2px;font-weight:600;font-size:13px;line-height:18px}
+.c{font-size:12px;line-height:16px;color:#a9aec1}
+.t::before,.c::before{content:"";position:absolute;left:0;top:0;bottom:0;width:90%;border-radius:3px;background:var(--sk2)}
+.c::before{width:60%}
+.av b,.t span,.c span{visibility:hidden}
+.sm .meta{gap:8px;height:30px}
+.sm .av{width:28px;height:28px;font-size:12px}
+.sm .t{margin-bottom:1px;font-size:11.5px;line-height:15px}
+.sm .c{font-size:11px;line-height:14px}
+/* Arrived: the text and avatars swap in at once, then each picture swaps in a moment later, one after another (a delayed switch, no fade). */
+.ready .av{background:var(--a)}
+.ready .av b,.ready .t span,.ready .c span{visibility:visible}
+.ready .t::before,.ready .c::before{display:none}
+.ready .art{opacity:1;transition-delay:calc(160ms + var(--i) * 70ms)}
+.snap *{transition:none!important}
+/* The pictures: a sky gradient and a few flat shapes, all drawn with gradients. Lite drops the small details (--h). */
+.art{background:var(--h,none),var(--g),linear-gradient(155deg,var(--a),var(--b))}
+.lite .art{background:var(--g),linear-gradient(155deg,var(--a),var(--b))}
+.s0{--g:radial-gradient(circle at 74% 28%,var(--c7) 0 8%,#0000 8.6%),radial-gradient(ellipse 72% 40% at 20% 112%,#0b1530 0 97%,#0000 100%),radial-gradient(ellipse 80% 34% at 88% 118%,#0b153099 0 97%,#0000 100%)}
+.s1{--g:radial-gradient(circle at 30% 68%,#ffe2b0 0 17%,#0000 17.6%),radial-gradient(circle at 62% 72%,#ffd08a 0 19%,#0000 19.6%),radial-gradient(ellipse 100% 26% at 50% 112%,#0b0b0f66 0 97%,#0000 100%);--h:radial-gradient(circle at 80% 28%,#ffffff55 0 10%,#0000 10.6%)}
+.s2{--g:radial-gradient(circle at 26% 30%,#f4f1ff 0 6.5%,#0000 7.1%),radial-gradient(ellipse 85% 36% at 30% 120%,#0d0b2a 0 97%,#0000 100%),radial-gradient(ellipse 70% 30% at 92% 116%,#0d0b2aaa 0 97%,#0000 100%);--h:radial-gradient(circle at 62% 20%,#fff 0 1.1%,#0000 1.7%),radial-gradient(circle at 80% 36%,#fff 0 1%,#0000 1.6%),radial-gradient(circle at 50% 42%,#fff 0 .9%,#0000 1.5%),radial-gradient(circle at 88% 14%,#fff 0 .9%,#0000 1.5%)}
+.s3{--g:radial-gradient(ellipse 62% 36% at 18% 112%,#ffffff55 0 97%,#0000 100%),radial-gradient(ellipse 66% 32% at 78% 104%,#ffffff3d 0 97%,#0000 100%),radial-gradient(ellipse 90% 30% at 46% 126%,#0b153066 0 97%,#0000 100%);--h:radial-gradient(circle at 72% 26%,#fff9 0 7%,#0000 7.6%)}
+.s4{--g:radial-gradient(circle at 50% 138%,#0000 0 41%,#0b0b0fb3 41.6% 49%,#0000 49.6%),linear-gradient(#0b0b0fcc,#0b0b0fcc) 0 74%/100% 5% no-repeat;--h:radial-gradient(circle at 24% 30%,var(--c7) 0 7%,#0000 7.6%)}
+.s5{--g:radial-gradient(circle at 26% 28%,var(--c7) 0 7%,#0000 7.6%),radial-gradient(ellipse 100% 26% at 50% 112%,#0b2a22 0 97%,#0000 100%);--h:radial-gradient(ellipse 9% 19% at 42% 70%,#0e3b2c 0 97%,#0000 100%),radial-gradient(ellipse 9% 19% at 58% 66%,#115a3f 0 97%,#0000 100%),radial-gradient(ellipse 8% 16% at 74% 72%,#0e3b2c 0 97%,#0000 100%)}
+.s6{--g:radial-gradient(circle at 28% 66%,#0000 0 12%,#0b0b0fb3 12.6% 16%,#0000 16.6%),radial-gradient(circle at 70% 66%,#0000 0 12%,#0b0b0fb3 12.6% 16%,#0000 16.6%),linear-gradient(#0b0b0f99,#0b0b0f99) 0 88%/100% 12% no-repeat}
+.s7{--g:radial-gradient(circle at 30% 50%,#fff 0 11%,#0000 11.6%),linear-gradient(#0b0b0fb3,#0b0b0fb3) 56% 40%/22% 36% no-repeat,radial-gradient(circle at 82% 66%,#ffffff88 0 7%,#0000 7.6%)}
+@media (prefers-reduced-motion: reduce){.art{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>
+<main>
+ <ul class="grid" id="grid" role="list" aria-label="Videos" aria-busy="true"></ul>
+ <p class="sr" id="st" role="status">Loading videos</p>
+</main>
+<script>
+const root = document.documentElement, grid = document.getElementById('grid'), status = document.getElementById('st');
+const reduce = matchMedia('(prefers-reduced-motion: reduce)');
+let rm = reduce.matches, timer = 0, started = false;
+const P = n => typeof n === 'number' ? `var(--c${n})` : n;
+// title, channel, picture, and the two colors of its sky
+const CARDS = [['A walk by the river', 'Daybreak Walks', 0, 1, 6], ['Bread from scratch', 'Maple Kitchen', 1, 4, 5], ['Stars over the hills', 'Blue Hour', 2, 3, '#2b2a72'],
+ ['A small garden', 'Garden Hours', 5, 2, 6], ['How bridges work', 'Pebble Lab', 4, 5, 3], ['Calm focus music', 'Paper Moon', 3, 6, 1], ['Fixing a bicycle', 'Workshop 12', 6, 7, 4],
+ ['Sketching shapes', 'Studio North', 7, 1, 3], ['A quiet morning', 'Early Trains', 0, 3, 5], ['Rice, three ways', 'Maple Kitchen', 1, 7, 4], ['A calm sea day', 'Sea Notes', 3, 1, 6],
+ ['Learning to knit', 'Wool Hours', 5, 5, 7]];
+grid.innerHTML = CARDS.map(([t, ch, s, a, b], i) => `<li class="card" style="--i:${i};--a:${P(a)};--b:${P(b)}"><div class="pic"><i class="art s${s}"></i></div><div class="meta"><span class="av"><b>${ch[0]}</b></span><div class="tx"><p class="t"><span>${t}</span></p><p class="c"><span>${ch}</span></p></div></div></li>`).join('');
+const cards = [...grid.children];
+// Only as many cards as fit whole: try every grid of up to 4 columns, keep the ones whose pictures stay close to 16 to 9, take the one with the most cards
+// (fewer on a phone), then the one nearest 16 to 9. A card is 46px taller than its picture (40px when it is narrow and its avatar is smaller).
+function layout() {
+ const W = innerWidth, H = innerHeight, p = W <= 480 ? 12 : 20, g = W <= 480 ? 10 : 16, max = root.classList.contains('lite') ? 8 : 12;
+ let best = { s: -1, c: 1, r: 1, w: W - 2 * p };
+ for (let c = 1; c <= 4; c++) for (let r = 1; r <= 6; r++) {
+ const w = (W - 2 * p - (c - 1) * g) / c, h = (H - 2 * p - (r - 1) * g) / r - (w < 190 ? 40 : 46), k = w / h;
+ if (c * r > max || w < 144 || h < 40 || k < 1.3 || k > 2.35) continue;
+ const s = c * r - Math.abs(k - 1.78) / 3;
+ if (s > best.s) best = { s, c, r, w };
+ }
+ grid.style.cssText = `--c:${best.c};--r:${best.r};--g:${g}px;--p:${p}px`;
+ grid.classList.toggle('sm', best.w < 190);
+ cards.forEach((el, i) => { el.hidden = i >= best.c * best.r; });
+}
+// The shapes come back at once (no fade), then the wait for the content starts again.
+function loading() {
+ root.classList.add('snap'); root.classList.remove('ready'); void root.offsetWidth; root.classList.remove('snap');
+ grid.setAttribute('aria-busy', 'true'); status.textContent = 'Loading videos';
+}
+function arrived() {
+ root.classList.add('ready'); grid.setAttribute('aria-busy', 'false'); status.textContent = 'Videos loaded';
+}
+function wait(ms) { started = true; clearTimeout(timer); timer = setTimeout(arrived, ms); }
+// The shapes are on screen from the first paint; the content arrives a moment after the page and its font are ready (a shorter wait on Replay).
+// Under reduced motion the content is simply there at once, and Replay still shows the shapes first.
+function arrive() {
+ if (started) return;
+ if (document.hidden) { document.addEventListener('visibilitychange', arrive, { once: true }); return; }
+ if (rm) arrived(); else wait(2000);
+}
+addEventListener('message', e => {
+ if (e.source !== parent || !e.data) return;
+ if (e.data.fx === 'replay') { loading(); wait(1500); }
+});
+reduce.addEventListener('change', () => { rm = reduce.matches; });
+addEventListener('resize', layout);
+layout();
+if (rm) arrived();
+addEventListener('load', () => Promise.race([document.fonts && document.fonts.ready, new Promise(r => setTimeout(r, 1000))]).then(arrive));
+</script>
+</body>
+</html>
diff --git a/tests/famous.test.js b/tests/famous.test.js
index d730daed..41c534c1 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', 'apple-sweep': '2026-10-22', 'landonorris-reveal': '2026-10-22', 'linear-intro': '2026-10-22', 'spotify-cards': '2026-10-22', 'stripe-ribbon': '2026-10-22', 'wikipedia-previews': '2026-10-22' };
+const RECHECKED = { 'apple-menu': '2026-10-22', 'apple-scroll': '2026-10-22', 'apple-sweep': '2026-10-22', 'landonorris-reveal': '2026-10-22', 'linear-intro': '2026-10-22', 'spotify-cards': '2026-10-22', 'stripe-ribbon': '2026-10-22', 'wikipedia-previews': '2026-10-22', 'youtube-loading': '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).