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: two ways into the finder, a Don't know the name? button under the search and a Finder link in the top bar, both left out of the social picture

matinefe08aebf5f8
diff --git a/index.html b/index.html
index 6f060f63..97f1f5d6 100644
--- a/index.html
+++ b/index.html
@@ -373,6 +373,14 @@ button,input{font:inherit;color:inherit}
.fd-how .fd-a{padding:8px 4px 10px;font-size:13px}
.fd-go{flex-direction:column;align-self:stretch}
}
+/* The ways into the finder: a pill under the Popular line (as wide as the column on phones) and Finder in the top bar, marked as
+ the current page in the finder. Below 870px (measured) Finder, Browse all and How it works no longer all fit beside the brand,
+ so How it works leaves the bar; its band stays on the page. Phones show no top-bar links: there the pill is the way in. */
+.find-cta{display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin-top:10px;padding:0 20px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font-size:15px;font-weight:700;text-decoration:none}
+.lnk[aria-current="page"]{color:var(--ink);background:var(--line-2)}
+@media(hover:hover){.find-cta:hover{border-color:var(--ink)}}
+@media(max-width:869px){.top .nav .lnk[href="#how"]{display:none}}
+@media(max-width:600px){.find-cta{display:flex;align-self:stretch;margin-top:8px}}
/* ── preview library ── */
/* The hint names the transform only: opacity in will-change flattens CSS 3D in Chrome (a cube draws as one flat face) */
@@ -1604,6 +1612,7 @@ button,input{font:inherit;color:inherit}
<header class="wrap top" id="top">
<a class="brand" href="./"><svg class="mark" viewBox="0 0 32 32" aria-hidden="true"><circle class="ring" cx="11.16" cy="20.84" r="6.1"/><circle class="ring" cx="15.12" cy="16.88" r="6.1"/><circle class="ring" cx="18.51" cy="13.49" r="6.1"/><circle class="ball" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>
<nav class="nav" aria-label="Site">
+ <a class="lnk" id="nav-find" href="?view=find">Finder</a>
<a class="lnk" id="nav-all" href="?view=all">Browse all</a>
<a class="lnk" href="#how">How it works</a>
<button type="button" class="icon-btn theme-btn" id="theme-toggle" aria-label="Switch between light and dark">
@@ -1629,6 +1638,7 @@ button,input{font:inherit;color:inherit}
<button type="submit" class="go"><span class="go-l">Search</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button>
</form>
<p class="pop"><span>Popular:</span><button type="button" data-q="fade in">fade in</button><button type="button" data-q="typing text">typing text</button><button type="button" data-q="loading spinner">loading spinner</button><button type="button" data-q="parallax">parallax</button><button type="button" data-q="confetti">confetti</button></p>
+ <a class="find-cta" href="?view=find">Don't know the name? Find it</a>
</section>
<section class="wrap" aria-labelledby="places-title">
@@ -3026,6 +3036,7 @@ const HOME_TITLE=document.title,FIND_TITLE='Find an animation you saw — Animat
function showFinder(finding,found){
heroEl.hidden=placesSec.hidden=finding;finderEl.hidden=!finding;
document.title=finding?FIND_TITLE:HOME_TITLE;
+ if(finding)navFind.setAttribute('aria-current','page');else navFind.removeAttribute('aria-current');
FIND_Q.forEach(qu=>finderEl.querySelectorAll('.fd-r[name="fd-'+qu.key+'"]').forEach(r=>{r.checked=r.value===state[qu.key];}));
const matched=found?found.best.length+found.close.length:0;
findSee.hidden=!matched;findSee.textContent='See '+matched+(matched===1?' match':' matches');
@@ -3055,6 +3066,17 @@ finderEl.addEventListener('change',e=>{
});
findSee.addEventListener('click',()=>{toResults();toTitle();});
$('find-reset').addEventListener('click',()=>{go({view:'find'},false);scrollTo({top:0,behavior:reduce?'auto':'smooth'});findTitle.focus({preventScroll:true});});
+// The ways in: the Find button under the search and Finder in the top bar open the finder with one history step, at the top of
+// the page with keyboard focus on its heading (the Find button goes away with the hero). A click with Ctrl, Cmd, Shift or Alt,
+// or with another button, is left to the browser, as for Browse all.
+const navFind=$('nav-find');
+function enterFind(e){
+ if(e.button||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;
+ e.preventDefault();
+ if(state.view!=='find')go({view:'find'},true);
+ scrollTo({top:0,behavior:reduce?'auto':'smooth'});findTitle.focus({preventScroll:true});
+}
+document.querySelectorAll('.find-cta,#nav-find').forEach(a=>a.addEventListener('click',enterFind));
const startCat=readURL();
render();
if(startCat){const g=$('cat-'+startCat);if(g)g.scrollIntoView();}
diff --git a/tests/finder.test.js b/tests/finder.test.js
index 2094ef9b..f0b14a32 100644
--- a/tests/finder.test.js
+++ b/tests/finder.test.js
@@ -255,6 +255,17 @@ test("a step that changes only the fragment (How it works, Back to top, the skip
assert.deepEqual(calls, ['render'], 'the view is drawn again');
});
+test('the ways into the finder: the Find button under the Popular line, Finder right before Browse all, both left out of the social picture', () => {
+ assert.equal(count(HOME, `<a class="find-cta" href="?view=find">Don't know the name? Find it</a>`), 1, 'one Find button');
+ assert.match(between(HOME, '<section class="wrap home-hero"', '</section>'),
+ /<p class="pop"><span>Popular:<\/span>.*<\/p>\s*<a class="find-cta" href="\?view=find">Don't know the name\? Find it<\/a>\s*$/, 'the Find button ends the hero, right under the Popular line');
+ assert.match(between(HOME, '<nav class="nav" aria-label="Site">', '</nav>'),
+ /<a class="lnk" id="nav-find" href="\?view=find">Finder<\/a>\s*<a class="lnk" id="nav-all" href="\?view=all">Browse all<\/a>/, 'Finder right before Browse all');
+ const css = [...HOME.matchAll(/<style>([\s\S]*?)<\/style>/g)].map(m => m[1]).join('\n');
+ assert.ok(css.includes('@media(max-width:869px){.top .nav .lnk[href="#how"]{display:none}}'), 'How it works leaves the bar where the three links no longer fit');
+ assert.ok(read(path.join(ROOT, 'tools', 'make-social-image.mjs')).includes('.find-cta, #nav-find { display: none }'), 'the social picture leaves both out');
+});
+
// ── Every card's answers and the test set ──
// The reviewed answers: every answer given to some card, the rules every page of a kind shares, and the spec's 28 described effects.
diff --git a/tools/make-social-image.mjs b/tools/make-social-image.mjs
index aacd5eef..2291d3ef 100644
--- a/tools/make-social-image.mjs
+++ b/tools/make-social-image.mjs
@@ -6,10 +6,11 @@
// Usage: node tools/make-social-image.mjs [--base http://127.0.0.1:8731] [--out og-image.png]
// Run it again when the picture would change: a new animation changes the count in the pill.
// The page is laid out 1080 pixels wide and drawn at 1200/1080 of its size, so its words stay readable when a social site
-// shows the picture small. For the picture only, the line under the question, the Popular suggestions and the counts under
-// the tiles are left out (so the tiles fit with room under them), the question is drawn at its full size and the GitHub
-// button shows no star count (the request for it is blocked: a number in the picture would soon be out of date). Every
-// animation is stopped at the same moment of its loop, so every run draws the same picture.
+// shows the picture small. For the picture only, the line under the question, the Popular suggestions, the finder's Find button
+// and Finder link and the counts under the tiles are left out (so the tiles fit with room under them, as before the finder), the
+// question is drawn at its full size and the GitHub button shows no star count (the request for it is blocked: a number in the
+// picture would soon be out of date). Every animation is stopped at the same moment of its loop, so every run draws the same
+// picture.
// The temporary Chrome profile (hb-social-* in the temp folder) is removed when the run ends, trying again for up to 10 s
// while Chrome lets go of its files; one that stays is named in the output. Exit code 1 on any problem.
import { execFileSync, spawn } from 'node:child_process';
@@ -44,7 +45,7 @@ const MOMENT = 6240;
// For the picture only (see the top of this file). Two floating shapes sat beside the lines that are left out; they move
// up beside the search box.
const PICTURE_CSS = `
-.home-hero .sub, .home-hero .pop, .pl-count, .gh-c:empty { display: none }
+.home-hero .sub, .home-hero .pop, .pl-count, .gh-c:empty, .find-cta, #nav-find { display: none }
.home-hero { padding-top: 32px }
.h1 { font-size: 64px }
.fl3 { top: 206px }