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
fix: the mode switch's three buttons share their row equally on phones, with a 6px gap
matina9cc4b9d6353
diff --git a/assets/css/demo-page.css b/assets/css/demo-page.cssindex 90926ab4..99c649ae 100644--- a/assets/css/demo-page.css+++ b/assets/css/demo-page.css@@ -103,8 +103,9 @@ body.hb [hidden]{display:none!important}/* See inside and Compare: the mode switch (Normal · See inside · Compare) above the stage, and under the player bar the notethat says what the stage shows. Normal has no note, and the empty box then takes no room. From 761px the switch sits at the- right end of the Watch step's heading row (below), so the stage keeps its place on a laptop's first screen. */-.hb-page .hb-modes{gap:6px}+ right end of the Watch step's heading row (below), so the stage keeps its place on a laptop's first screen. The switch is a+ .seg too, and the .seg rules come later in the file: the rules here that must win name .seg.hb-modes. */+.hb-page .seg.hb-modes{gap:6px}.hb-mode-notes:not(:has(> p:not([hidden]))){display:none}.hb-mode-notes p{margin:0;max-width:72ch;font:400 15px/1.55 var(--hb-font);color:var(--hb-dim)}.hb-mode-notes a{color:var(--hb-ink);text-underline-offset:3px}@@ -268,9 +269,10 @@ textarea.hb-text{min-height:88px;padding:10px 12px;resize:vertical}.hb-watch:has(> .hb-modes) > .hb-step-head{grid-column:1}.hb-watch:has(> .hb-modes) > .hb-modes{grid-column:2;flex-wrap:nowrap}}-/* Up to 760px the switch has a row of its own above the stage, its three buttons sharing it equally */+/* Up to 760px the switch has a row of its own above the stage, its three buttons sharing it equally (.seg.hb-modes outranks the+ .seg button rule for phones further down) */@media(max-width:760px){- .hb-page .hb-modes button{flex:1 1 0;padding:0 8px}+ .hb-page .seg.hb-modes button{flex:1 1 0;padding:0 6px}}/* Short laptop screens (1366×768 leaves about 650px of page): a tighter header and a shorter stagekeep the stage and the player bar on the first screen. */diff --git a/tests/pages.test.js b/tests/pages.test.jsindex 00b5445a..2598da98 100644--- a/tests/pages.test.js+++ b/tests/pages.test.js@@ -533,10 +533,14 @@ test('the shared stylesheet draws the mode switch beside the Watch heading fromconst css = read(path.join(ROOT, 'assets', 'css', 'demo-page.css'));const rules = cssRules(css);const has = sel => rules.some(r => r.selector.split(',').map(s => s.trim()).includes(sel));- for (const sel of ['.hb-page .hb-modes', '.hb-mode-notes p', '.hb-lesson', '.hb-lesson a', '.hb-lesson-nav', '.hb-lesson-prev',+ for (const sel of ['.hb-page .seg.hb-modes', '.hb-mode-notes p', '.hb-lesson', '.hb-lesson a', '.hb-lesson-nav', '.hb-lesson-prev','.hb-lesson-next', '.hb-lesson-all', '.hb-why p', '.hb-seen']) assert.ok(has(sel), sel);assert.ok(rules.some(r => r.selector === '.hb-mode-notes:not(:has(> p:not([hidden])))' && /display:none/.test(r.body)),'an empty notes box takes no room');+ // The switch is also a .seg, and the .seg rules (the gap, and the phone rule for .seg buttons) come later in the file: the+ // switch's own rules name .seg.hb-modes so that they outrank them and the three buttons are equal on phones.+ assert.ok(rules.some(r => r.selector === '.hb-page .seg.hb-modes button' && /(^|;)\s*flex:\s*1 1 0\s*(;|$)/.test(r.body)),+ 'up to 760px the three mode buttons share their row equally, outranking the phone rule for .seg buttons');assert.match(css, /@media\(min-width:761px\)\{\s*\.hb-watch:has\(> \.hb-modes\)\{display:grid/, 'from 761px the switch shares the heading row');assert.match(css, /@media\(min-width:601px\)\{\s*\.hb-head:has\(> \.hb-lesson\)\{display:grid/, 'from 601px the lesson line shares the category row');});