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: Famous effects in the home page's top bar (from 740px; How it works from 1000px, the GitHub word from 880px)

matin6a73a4465fee
diff --git a/index.html b/index.html
index 817102f6..47db5c61 100644
--- a/index.html
+++ b/index.html
@@ -326,8 +326,9 @@ button,input{font:inherit;color:inherit}
}
/* beyond the design: widths and places it does not show */
-@media(max-width:760px){.gh{position:relative;width:44px;padding:0;justify-content:center;gap:0}.gh-t{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.gh-c{display:none}} /* from 760px down the GitHub button is a round star beside the dark-mode button: the word is still read out, the count goes */
-@media(min-width:601px) and (max-width:620px){.top .nav .lnk{padding:0 11px}} /* at 601px "Finder" and "Browse all" are there too: a little less padding leaves more room beside the brand (the star fits either way) */
+@media(max-width:879px){.gh{position:relative;width:44px;padding:0;justify-content:center;gap:0}.gh-t{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.gh-c{display:none}} /* from 879px down the GitHub button is a round star (with Famous effects in the bar, the word and the count fit from 880px) beside the dark-mode button: the word is still read out, the count goes */
+@media(min-width:601px) and (max-width:620px){.top .nav .lnk{padding:0 11px}}
+@media(min-width:601px) and (max-width:739px){.top .nav #nav-famous{display:none}} /* below 740px Famous effects leaves the bar (it is in the footer): Finder and Browse all keep their room beside the brand */ /* at 601px "Finder" and "Browse all" are there too: a little less padding leaves more room beside the brand (the star fits either way) */
@media(max-width:359px){.gh{display:none}} /* below 360px it is left out: it would still fit down to about 330px, not at 320px, so 360px keeps a margin */
@media(max-width:1238px){.fl2,.fl5{display:none}} /* the two shapes that would crowd the 720px search box below 1239px */
.acts{flex-wrap:wrap} /* a narrow card puts Try it under Copy prompt */
@@ -386,7 +387,7 @@ button,input{font:inherit;color:inherit}
.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:999px){.top .nav .lnk[href="#how"]{display:none}}
@media(max-width:600px){.find-cta{display:flex;align-self:stretch;margin-top:8px}}
/* Not here?, under the finder's cards whenever an answer is picked */
.fd-not{display:flex;flex-direction:column;align-items:center;gap:12px;margin-top:40px;padding:clamp(28px,4vw,44px) 24px;border-radius:20px;background:var(--surface);box-shadow:var(--shadow);text-align:center}
@@ -1664,6 +1665,7 @@ button,input{font:inherit;color:inherit}
<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" id="nav-famous" href="famous/">Famous effects</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">
<svg class="i moon" viewBox="0 0 24 24" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
diff --git a/og-image.png b/og-image.png
index b21f417a..b99a1cb5 100644
Binary files a/og-image.png and b/og-image.png differ
diff --git a/tests/finder.test.js b/tests/finder.test.js
index 9515a1b5..148a5508 100644
--- a/tests/finder.test.js
+++ b/tests/finder.test.js
@@ -281,7 +281,7 @@ test('the ways into the finder: the Find button under the Popular line, Finder r
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(css.includes('@media(max-width:999px){.top .nav .lnk[href="#how"]{display:none}}'), 'How it works leaves the bar where the four 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');
});
diff --git a/tests/pages.test.js b/tests/pages.test.js
index 7cd7eed1..96263126 100644
--- a/tests/pages.test.js
+++ b/tests/pages.test.js
@@ -1127,10 +1127,10 @@ test('the home page keeps its GitHub button on phones as a round star, and leave
/(^|;)\s*display:\s*none/.test(rule.body));
assert.equal(hiding.length, 1, 'one rule hides the GitHub button');
assert.equal(count(HOME, '@media(max-width:359px){.gh{display:none}}'), 1, 'and it is for screens under 360px');
- const round = cssRules(between(css, '@media(max-width:760px){', '}}') + '}');
+ const round = cssRules(between(css, '@media(max-width:879px){', '}}') + '}');
const has = (selector, declarations) => round.some(rule => rule.selector === selector &&
declarations.every(want => rule.body.split(';').some(d => d.replace(/\s+/g, '') === want)));
- assert.ok(has('.gh', ['width:44px', 'padding:0']), 'from 760px down the GitHub button is a 44px round star');
+ assert.ok(has('.gh', ['width:44px', 'padding:0']), 'from 879px down the GitHub button is a 44px round star');
assert.ok(has('.gh-t', ['position:absolute', 'width:1px', 'height:1px', 'overflow:hidden']), 'its word is hidden from sight and still read out');
assert.ok(has('.gh-c', ['display:none']), 'and the star count goes');
assert.ok(cssRules(between(css, '@media(min-width:601px) and (max-width:620px){', '}}') + '}').some(rule => rule.selector === '.top .nav .lnk'),