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.

fix: home page warm-up on keyboard focus only, the two search forms told apart, and the spec's search words

matin0891d320a0a1
diff --git a/docs/superpowers/specs/2026-09-30-home-page-redesign-design.md b/docs/superpowers/specs/2026-09-30-home-page-redesign-design.md
index ae064bef..d4e64980 100644
--- a/docs/superpowers/specs/2026-09-30-home-page-redesign-design.md
+++ b/docs/superpowers/specs/2026-09-30-home-page-redesign-design.md
@@ -85,9 +85,10 @@ opens All animations at that category's heading.
## Search
Search looks at each animation's name, its one-line description, the names of its places and its category name. The
-query is split into words; common small words are dropped (a, an, and, the, that, this, to, for, with, when, on, in,
-of, my, it, i, want, make, some); each word is matched by its start, so "bounces", "bounce" and "bouncing" all match
-"bounce" (a typed word drops the first of the endings "ies", "ing", "ed", "es" and "s" that leaves at least three
+query is split into words; common small words are dropped from it and from each animation's own words (a, an, and,
+the, that, this, to, for, with, when, on, in, of, my, it, i, want, make, some, best: every description ends "Best for
+…", so "best" would match every card); each word is matched by its start, so "bounces", "bounce" and "bouncing" all
+match "bounce" (a typed word drops the first of the endings "ies", "ing", "ed", "es" and "s" that leaves at least three
letters with a vowel, but not the last "s" of "ss"; after "ing" or "ed", a doubled last letter other than l, s, f or z
loses one letter while three remain: "snapping" finds "snap", "ring" stays whole). An animation matches when at least
one word matches; results are ordered by how well they match (a word in the name counts 3, in a place name 2, in the
diff --git a/index.html b/index.html
index baee2fa0..e2d7eb15 100644
--- a/index.html
+++ b/index.html
@@ -1036,10 +1036,11 @@ button,input{font:inherit;color:inherit}
</section>
<section class="wrap results" id="results" aria-labelledby="results-title">
+ <!-- The phone bar's search box repeats the one at the top (they share their text), so only that one is a search landmark. -->
<div class="pinbar" id="pinbar">
<div class="pinrow">
<button type="button" class="pin-back" id="pin-back" aria-label="Back to the start"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M19 12H5M11 6l-6 6 6 6"/></svg></button>
- <form class="pin-search" id="pin-form" role="search" action="./" method="get"><label class="sr" for="q2">Describe the animation you want</label><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M20 20l-3.5-3.5"/></svg><input id="q2" name="q" type="search" enterkeyhint="search" autocomplete="off" spellcheck="false" placeholder="Search animations"></form>
+ <form class="pin-search" id="pin-form" action="./" method="get"><label class="sr" for="q2">Describe the animation you want</label><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M20 20l-3.5-3.5"/></svg><input id="q2" name="q" type="search" enterkeyhint="search" autocomplete="off" spellcheck="false" placeholder="Search animations"></form>
</div>
<div class="pchips" role="group" aria-label="Places">
<button type="button" class="pchip" data-place="btn" aria-pressed="false">Buttons</button>
@@ -2020,11 +2021,12 @@ cardsBox.addEventListener('click',e=>{
if(btn.classList.contains('fail')){location.href=(FROM_DISK?url+'index.html':url)+'#hb-prompt-title';return;}
writeClipboard(promptFor(url)).then(()=>{copyState(btn,'done');toast('Prompt copied. Paste it into your AI assistant.');},()=>copyState(btn,'fail'));
});
-// Reading the page starts when a mouse pointer rests on a card or a card gets focus, so the copy is quick. A finger does not
-// count: on a phone the touch that sends it opens the card or scrolls the page.
+// Reading the page starts when a mouse pointer rests on a card or the keyboard brings focus to it, so the copy is quick. A
+// finger does not count: on a phone the touch that sends it opens the card or scrolls the page, and the focus a tap gives the
+// card's link (Chrome for Android) is not keyboard focus: it does not match :focus-visible.
const warm=e=>{const card=e.target.closest&&e.target.closest('.card');if(!card)return;const url=urlOf(card);if(!failedPages.has(url))promptFor(url).catch(()=>{});};
cardsBox.addEventListener('pointerover',e=>{if(e.pointerType==='mouse')warm(e);});
-cardsBox.addEventListener('focusin',warm);
+cardsBox.addEventListener('focusin',e=>{if(e.target.matches(':focus-visible'))warm(e);});
</script>
</body>
</html>