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: keep single words off the last line of Background Color's chapter text
matinc93d3fd3ebf8
diff --git a/animations/01-scroll-based/scroll-background-color/index.html b/animations/01-scroll-based/scroll-background-color/index.htmlindex 9834c051..6c578e4d 100644--- a/animations/01-scroll-based/scroll-background-color/index.html+++ b/animations/01-scroll-based/scroll-background-color/index.html@@ -28,7 +28,8 @@.stage section{min-height:90cqh;display:flex;flex-direction:column;justify-content:center;padding:clamp(20px,4vw,48px)}.num{font-size:13px;font-weight:600;letter-spacing:2px}.stage h3{font-weight:800;font-size:clamp(24px,4.5vw,44px);letter-spacing:-.02em;margin:10px 0 14px}- .stage p{font-size:14px;line-height:1.7;max-width:44ch}+ /* pretty keeps a chapter's last line from being a single word; a browser without it wraps as usual */+ .stage p{font-size:14px;line-height:1.7;max-width:44ch;text-wrap:pretty}/* White text on the dark colors, black on the light ones: the script sets .light once the background is light enough */.num,.stage h3,.stage p{color:#fff}.stage.light .num,.stage.light h3,.stage.light p{color:#000}diff --git a/docs/superpowers/plans/2026-09-29-scroll-content-part2.md b/docs/superpowers/plans/2026-09-29-scroll-content-part2.mdindex c2a3b102..9449e2b0 100644--- a/docs/superpowers/plans/2026-09-29-scroll-content-part2.md+++ b/docs/superpowers/plans/2026-09-29-scroll-content-part2.md@@ -1154,4 +1154,4 @@ None: leave out the `details.hb-options` block.- **README Production notes:** unchanged- **Category line:** `01.26 · Scroll-Based`- **Pager:** Previous: Scrollspy Navigation (`../scrollspy-nav/`) · Next: none-- **Final fix wave:** each chapter's text is one paragraph, `<p>${c[1]} ${c[2]}</p>`, with no `<br>`, so it wraps on its own (the table lists the text, not where it breaks). At 375px no chapter has a one-word line (the forced break left "background" and "text." alone); on laptops and tablets chapters 1 to 4 still take two lines and chapter 5 now takes one, and the section heights and the scroll length are unchanged. At 320-344px and 352-373px (360px, for example) a last line can still be one word.+- **Final fix wave:** each chapter's text is one paragraph, `<p>${c[1]} ${c[2]}</p>`, with no `<br>`, so it wraps on its own (the table lists the text, not where it breaks). The forced break had left "background" and "text." alone on a line at 375px. Without it a chapter could still end on one word at 320-344px and 352-373px (360px, for example), so `.stage p` also has `text-wrap:pretty`. Measured at every width from 320 to 1600px: no chapter has a one-word line (47 widths had one without `text-wrap:pretty`), and the wraps from 374px up (375, 390 and 414px, tablets, laptops) are the same as without it. On laptops and tablets chapters 1 to 4 take two lines and chapter 5 one, and the section heights and the scroll length are unchanged. A browser that ignores `text-wrap:pretty` wraps as before and can still end a chapter on one word at those narrow widths.