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
feat: Famous effects entries 7 to 12 (ChatGPT, X, Spotify, YouTube, The Pudding, Medium), and a test that the pill counts the 10 to 12 entries
matinfaa62a741ff7
diff --git a/famous/index.html b/famous/index.htmlindex 5c540eb5..0260c4f8 100644--- a/famous/index.html+++ b/famous/index.html@@ -295,6 +295,87 @@ button{font:inherit;color:inherit}.pv-fade{background:#08090c;display:grid;place-items:center}.pv-fade .sq{width:40%;height:44%;border-radius:6px;background:color-mix(in srgb,var(--accent) 26%,#12141a);border:1px solid var(--accent);animation:e-fade 2.6s ease-in-out infinite}@keyframes e-fade{0%,100%{opacity:0}40%,60%{opacity:1}}+/* glow: Breathing / Pulsing Glow */+.pv-glow{background:radial-gradient(circle at 50% 52%,#12100a,#050609 70%)}+.pv-glow .core{position:absolute;top:50%;left:50%;width:34%;height:34%;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(circle,var(--accent),transparent 66%);filter:blur(8px);animation:breath 5s ease-in-out infinite}+.pv-glow .ring{position:absolute;top:50%;left:50%;width:34%;height:34%;transform:translate(-50%,-50%);border-radius:50%;border:1px solid color-mix(in srgb,var(--accent) 50%,transparent);animation:breathring 5s ease-in-out infinite}+@keyframes breath{0%,100%{transform:translate(-50%,-50%) scale(.8);opacity:.6}50%{transform:translate(-50%,-50%) scale(1.25);opacity:1}}+@keyframes breathring{0%,100%{transform:translate(-50%,-50%) scale(.9);opacity:.7}50%{transform:translate(-50%,-50%) scale(2);opacity:0}}+/* gtext: Text Gradient Animation */+.pv-gtext{background:#0c0608;display:grid;place-items:center}+.pv-gtext span{font-family:var(--disp);font-size:58px;font-weight:800;letter-spacing:-.03em;background:linear-gradient(100deg,var(--c5),var(--c3),var(--c1),var(--c5));background-size:280% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:gtext 4s linear infinite}+@keyframes gtext{to{background-position:280% 0}}+/* words: Word-by-Word Reveal */+.pv-words{background:#08090c;display:flex;flex-direction:column;gap:14%;justify-content:center;align-items:flex-start;padding:22% 18%}+.pv-words b{height:12px;border-radius:2px;background:var(--accent);opacity:0;transform:translateY(60%);animation:e-words 3s var(--ease) infinite}+.pv-words b:nth-child(1){width:70%}+.pv-words b:nth-child(2){width:92%;animation-delay:.2s}+.pv-words b:nth-child(3){width:54%;animation-delay:.4s}+@keyframes e-words{0%{opacity:0;transform:translateY(60%)}30%,80%{opacity:1;transform:none}100%{opacity:0}}+/* heart: Heart / Like Burst */+.pv-heart{background:#08090c;display:grid;place-items:center;position:relative}+.pv-heart .h{font-size:40px;line-height:1;color:var(--accent);animation:heartpop 2.8s var(--ease) infinite}+.pv-heart .p{position:absolute;width:5px;height:5px;border-radius:50%;background:var(--accent);opacity:0;animation:heartp 2.8s ease-out infinite}+.pv-heart .p:nth-child(2){--x:-28px;--y:-20px}+.pv-heart .p:nth-child(3){--x:26px;--y:-22px}+.pv-heart .p:nth-child(4){--x:-24px;--y:18px}+.pv-heart .p:nth-child(5){--x:24px;--y:20px}+.pv-heart .p:nth-child(6){--x:0px;--y:-30px}+.pv-heart .p:nth-child(7){--x:0px;--y:28px}+@keyframes heartpop{0%,28%{transform:scale(.72)}42%{transform:scale(1.25)}56%,100%{transform:scale(1)}}+@keyframes heartp{0%,30%{transform:translate(0,0);opacity:0}42%{opacity:1}100%{transform:translate(var(--x,0),var(--y,0));opacity:0}}+/* ripple: Click / Tap Ripple */+.pv-ripple{background:#0b0805;display:grid;place-items:center}+.pv-ripple .r{position:absolute;width:14%;height:22%;border-radius:50%;border:1.5px solid var(--accent);opacity:0;animation:rip 2.4s ease-out infinite}+.pv-ripple .r2{animation-delay:-.8s}+.pv-ripple .r3{animation-delay:-1.6s}+.pv-ripple .dot{width:8px;height:8px;border-radius:50%;background:var(--accent)}+@keyframes rip{0%{transform:scale(.4);opacity:.9}100%{transform:scale(4.5);opacity:0}}+/* hoverbtn: Hover State Animation */+.pv-hoverbtn{background:#08090c;display:grid;place-items:center}+.pv-hoverbtn .btn{padding:10px 22px;border-radius:6px;border:1px solid var(--accent);color:var(--accent);font-family:var(--text);font-size:12px;animation:m-hover 2.6s var(--ease) infinite}+@keyframes m-hover{0%,30%{transform:translateY(0);background:transparent;color:var(--accent)}55%,80%{transform:translateY(-5px);background:var(--accent);color:#0b0b0d}100%{transform:translateY(0);background:transparent;color:var(--accent)}}+/* slidein: Slide In */+.pv-slidein{background:#08090c;display:grid;place-items:center;overflow:hidden}+.pv-slidein .sq{width:40%;height:44%;border-radius:6px;background:color-mix(in srgb,var(--accent) 24%,#12141a);border:1px solid var(--accent);animation:e-slidein 2.8s var(--ease) infinite}+@keyframes e-slidein{0%{transform:translateX(-170%);opacity:0}30%,70%{transform:none;opacity:1}100%{transform:translateX(170%);opacity:0}}+/* shimmer: Skeleton Loader */+.pv-shimmer{background:#0a0c11;padding:16% 15%;display:flex;flex-direction:column;gap:9%;justify-content:center}+.pv-shimmer .ln{height:9px;border-radius:3px;position:relative;overflow:hidden;background:#181820}+.pv-shimmer .ln:nth-child(2){width:78%}+.pv-shimmer .ln:nth-child(3){width:56%}+.pv-shimmer .ln::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--accent) 55%,transparent),transparent);animation:shim 1.6s ease-in-out infinite}+@keyframes shim{100%{transform:translateX(100%)}}+/* story: Scrollytelling */+.pv-story{background:#08090c;position:relative}+.pv-story .sc{position:absolute;inset:0;display:grid;place-items:center;opacity:0}+.pv-story .sc i{width:42%;height:42%;border-radius:50%;filter:blur(6px)}+.pv-story .s1 i{background:radial-gradient(circle,var(--c1),transparent 62%)}+.pv-story .s2 i{background:radial-gradient(circle,var(--c3),transparent 62%)}+.pv-story .s3 i{background:radial-gradient(circle,var(--c6),transparent 62%)}+.pv-story .s1{animation:sty1 6s ease-in-out infinite}+.pv-story .s2{animation:sty2 6s ease-in-out infinite}+.pv-story .s3{animation:sty3 6s ease-in-out infinite}+@keyframes sty1{0%,22%{opacity:1}38%,100%{opacity:0}}+@keyframes sty2{0%,16%{opacity:0}32%,54%{opacity:1}70%,100%{opacity:0}}+@keyframes sty3{0%,54%{opacity:0}70%,92%{opacity:1}100%{opacity:0}}+/* sticky: Sticky Section */+.pv-sticky{background:#08090c;display:grid;place-items:center}+.pv-sticky .frame{width:56%;height:58%;border:1px solid var(--accent);border-radius:6px;display:grid;place-items:center;overflow:hidden}+.pv-sticky .frame i{width:48%;height:48%;background:color-mix(in srgb,var(--accent) 38%,#12141a);border-radius:4px;animation:stkm 3.6s var(--ease) infinite}+@keyframes stkm{0%,100%{border-radius:4px;transform:rotate(0) scale(1)}33%{border-radius:50%;transform:rotate(120deg) scale(.75)}66%{border-radius:4px;transform:rotate(240deg) scale(1.1)}}+/* hideheader: Hide-on-Scroll Header */+.pv-hideheader{background:#08090c}+.pv-hideheader .win{position:absolute;left:19%;right:19%;top:27%;bottom:-6%;overflow:hidden;border:1px solid #232830;border-bottom:0;border-radius:8px 8px 0 0;background:#0d0f14}+.pv-hideheader .pg{display:flex;flex-direction:column;gap:7px;padding:30% 9% 0;animation:hh-pg 4.4s cubic-bezier(.45,0,.3,1) infinite}+.pv-hideheader .pg b{flex:none;height:7px;border-radius:2px;background:#232830}+.pv-hideheader .pg .im{height:26px;border-radius:4px;background:color-mix(in srgb,var(--accent) 24%,#161a22)}+.pv-hideheader .bar{position:absolute;left:0;right:0;top:0;height:24%;display:flex;align-items:center;gap:7%;padding:0 8%;background:#1b1f28;border-bottom:1px solid #2c323e;animation:hh-bar 4.4s cubic-bezier(.3,.7,.3,1) infinite}+.pv-hideheader .bar .lg{flex:none;width:9%;aspect-ratio:1;border-radius:50%;background:var(--accent)}+.pv-hideheader .bar .nm{width:34%;height:5px;border-radius:2px;background:#5a6070}+.pv-hideheader .bar .mn{flex:none;margin-left:auto;width:9%;height:8px;background:linear-gradient(#5a6070 0 2px,transparent 2px 3px,#5a6070 3px 5px,transparent 5px 6px,#5a6070 6px)}+@keyframes hh-pg{0%,12%{transform:translateY(0)}40%,56%{transform:translateY(-34%)}86%,100%{transform:translateY(0)}}+@keyframes hh-bar{0%,16%{transform:translateY(0)}24%,58%{transform:translateY(-106%)}66%,100%{transform:translateY(0)}}/* ── end of previews ── */</style></head>@@ -327,6 +408,12 @@ button{font:inherit;color:inherit}<a href="#linear-intro">Linear · headline</a><a href="#apple-menu">Apple · menu</a><a href="#wikipedia-previews">Wikipedia · previews</a>+ <a href="#chatgpt-reply">ChatGPT · reply</a>+ <a href="#x-heart">X · heart</a>+ <a href="#spotify-cards">Spotify · cards</a>+ <a href="#youtube-loading">YouTube · loading</a>+ <a href="#pudding-chart">The Pudding · chart</a>+ <a href="#medium-top-bar">Medium · top bar</a></nav><section class="fx" id="stripe-ribbon" aria-labelledby="stripe-ribbon-t" data-fx-site="Stripe" data-fx-start="loop">@@ -417,6 +504,90 @@ button{font:inherit;color:inherit}<button type="button" class="copy" aria-label="Copy prompt for Link previews"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button></section>+ <section class="fx" id="chatgpt-reply" aria-labelledby="chatgpt-reply-t" data-fx-site="ChatGPT" data-fx-start="load">+ <p class="fx-seen">Seen on <a href="https://chatgpt.com/" target="_blank" rel="noopener">chatgpt.com<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-14">2026</time></p>+ <h2 id="chatgpt-reply-t" tabindex="-1">The answer that writes itself</h2>+ <p class="fx-what">After you send a question, a small dot pulses until the reply starts; a model that works longer shows the word “Thinking” with a band of light sweeping across its letters. Then the answer arrives a few words at a time, as if typed live.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c7" data-slug="breathing-glow"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The waiting dot</span></div><div class="meta"><h4 class="title"><a href="../animations/07-ambient-background/breathing-glow/">Breathing / Pulsing Glow</a></h4><p class="desc">A soft glow slowly grows and shrinks, like calm breathing. Best for idle states.</p></div></article>+ <article class="card c5" data-slug="text-gradient-animation"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The shimmer</span></div><div class="meta"><h4 class="title"><a href="../animations/05-text-typography/text-gradient-animation/">Text Gradient Animation</a></h4><p class="desc">Colors flow through the letters while the text stays still. Best for headlines.</p></div></article>+ <article class="card c2" data-slug="word-by-word-reveal"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Words arriving</span></div><div class="meta"><h4 class="title"><a href="../animations/02-entrance-and-exit/word-by-word-reveal/">Word-by-Word Reveal</a></h4><p class="desc">Words appear one after another at a reading pace. Best for quotes and intros.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a live reply to <mark>[the answer area of your chat or assistant]</mark>. While the reply is being prepared, show a small dot that slowly pulses; when the work takes longer, show a short status word such as Thinking, with a soft band of light sweeping across its letters. When the answer starts, let it appear a few words at a time, each new group fading in at the end of the text, as if it were being written now. Keep finished lines where they are, and follow the newest words only while the reader has not scrolled away. Let screen readers hear the finished answer once. If the visitor has reduced motion turned on, keep the dot and the word still and show the words without fading.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for The answer that writes itself"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>++ <section class="fx" id="x-heart" aria-labelledby="x-heart-t" data-fx-site="X" data-fx-start="press">+ <p class="fx-seen">Seen on <a href="https://x.com/" target="_blank" rel="noopener">x.com<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-14">2026</time></p>+ <h2 id="x-heart-t" tabindex="-1">The heart that bursts</h2>+ <p class="fx-what">Press the heart and it shrinks for an instant, pops back a little too big and settles in pink-red, while a circle of color swells into a thin ring and small colored dots burst out and fade, all within about a second.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c4" data-slug="heart-burst"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Pop and dots</span></div><div class="meta"><h4 class="title"><a href="../animations/04-micro-interactions/heart-burst/">Heart / Like Burst</a></h4><p class="desc">The heart pops and fills as small hearts burst out. Best for like buttons.</p></div></article>+ <article class="card c4" data-slug="click-ripple"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The ring</span></div><div class="meta"><h4 class="title"><a href="../animations/04-micro-interactions/click-ripple/">Click / Tap Ripple</a></h4><p class="desc">A ripple spreads out from the spot you press. Best for buttons and list items.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a like button with a burst to <mark>[the heart button on your posts]</mark>. When it is pressed, the heart shrinks for an instant, then pops back a little too big and settles as it fills with color, while a circle of color swells into a thin ring and small dots burst out from its center and fade. Unliking takes the color away with no burst. Keep it all under a second and draw it over the button, so nothing around it moves. A tap on a touch screen and Enter or Space on the keyboard work the same, and screen readers hear whether the post is liked. If the visitor has reduced motion turned on, only change the color.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for The heart that bursts"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>++ <section class="fx" id="spotify-cards" aria-labelledby="spotify-cards-t" data-fx-site="Spotify" data-fx-start="hover">+ <p class="fx-seen">Seen on <a href="https://open.spotify.com/" target="_blank" rel="noopener">open.spotify.com<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <h2 id="spotify-cards-t" tabindex="-1">The play button that rises</h2>+ <p class="fx-what">Point at an album or playlist card and the card lightens a shade while a round green play button fades in, rising a few pixels into the cover's bottom corner.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c4" data-slug="hover-state"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The card lightens</span></div><div class="meta"><h4 class="title"><a href="../animations/04-micro-interactions/hover-state/">Hover State Animation</a></h4><p class="desc">Six ways a card can react when you point at it. Best for buttons and cards.</p></div></article>+ <article class="card c2" data-slug="slide-in"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The button rises</span></div><div class="meta"><h4 class="title"><a href="../animations/02-entrance-and-exit/slide-in/">Slide In</a></h4><p class="desc">Travels into place from one edge. Best for side panels and notifications.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a hover effect to <mark>[the album or playlist cards in your grid]</mark>. When the pointer rests on a card, its background lightens a little and a round play button rises a few pixels into place at the bottom corner of the picture while it fades in; when the pointer leaves, both go back. Use only fading and transforms, and keep it quick, so moving across the grid feels light. Show the play button when a card gets keyboard focus too, and on touch screens, where there is no hover, show it all the time. Give the button a name that says what it plays. If the visitor has reduced motion turned on, show and hide the button without movement.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for The play button that rises"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>++ <section class="fx" id="youtube-loading" aria-labelledby="youtube-loading-t" data-fx-site="YouTube" data-fx-start="load">+ <p class="fx-seen">Seen on <a href="https://www.youtube.com/" target="_blank" rel="noopener">youtube.com<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <h2 id="youtube-loading-t" tabindex="-1">Gray shapes while it loads</h2>+ <p class="fx-what">Before the videos appear, gray boxes and bars in the shapes of thumbnails, round channel pictures and titles fill the page; then the real content takes their places.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c4" data-slug="skeleton-loader"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Gray shapes</span></div><div class="meta"><h4 class="title"><a href="../animations/04-micro-interactions/skeleton-loader/">Skeleton Loader</a></h4><p class="desc">Gray shapes hold the place of content while it loads. Best for feeds and cards.</p></div></article>+ <article class="card c2" data-slug="fade-in-out"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">Content arrives</span></div><div class="meta"><h4 class="title"><a href="../animations/02-entrance-and-exit/fade-in-out/">Fade In / Fade Out</a></h4><p class="desc">Fades in to appear and fades out to leave. Best for pop-ups and tooltips.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a loading state to <mark>[the grid or feed whose content loads]</mark>. While the content loads, show gray shapes in the sizes of what is coming, such as a picture box, a round avatar and two lines of text, and let them pulse gently between lighter and darker. When the content arrives, put it exactly where the shapes were and fade it in, so nothing on the page jumps. Show only as many shapes as fit the screen, fewer on phones, and stop the pulse as soon as the content is in. Tell screen readers that the content is loading. If the visitor has reduced motion turned on, keep the shapes still.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for Gray shapes while it loads"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>++ <section class="fx" id="pudding-chart" aria-labelledby="pudding-chart-t" data-fx-site="The Pudding" data-fx-start="scroll">+ <p class="fx-seen">Seen on <a href="https://pudding.cool/2025/11/democracy/" target="_blank" rel="noopener">pudding.cool/2025/11/democracy<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <h2 id="pudding-chart-t" tabindex="-1">The chart that changes as you read</h2>+ <p class="fx-what">A chart of dots stays on screen while short paragraphs scroll past. As you scroll, the years go by and each year's dots pile up into the chart, the ones the story is about in bright color, and at some paragraphs the dots slide into a new chart; scrolling back undoes each step.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c1" data-slug="scrollytelling"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The steps</span></div><div class="meta"><h4 class="title"><a href="../animations/01-scroll-based/scrollytelling/">Scrollytelling</a></h4><p class="desc">A picture beside the story changes as you read down. Best for data stories.</p></div></article>+ <article class="card c1" data-slug="sticky-section"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The chart stays</span></div><div class="meta"><h4 class="title"><a href="../animations/01-scroll-based/sticky-section/">Sticky Section</a></h4><p class="desc">A section holds still while its content changes. Best for feature tours.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a scrollytelling layout to <mark>[your story or data article]</mark>. Keep a chart or picture fixed on the screen while short blocks of text scroll past it, and change the chart each time a new block reaches the middle of the screen: light up the dots or bars the text talks about and fade the rest, so the words and the chart tell the story together. Change it smoothly, and let scrolling back undo each step. On phones, keep the chart at the top and let the text scroll over it on cards. Keep every step readable without the chart for screen readers. If the visitor has reduced motion turned on, switch between the steps without animating.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for The chart that changes as you read"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>++ <section class="fx" id="medium-top-bar" aria-labelledby="medium-top-bar-t" data-fx-site="Medium" data-fx-start="scroll">+ <p class="fx-seen">Seen on <a href="https://medium.com/" target="_blank" rel="noopener">medium.com<span class="sr"> (opens in a new tab)</span></a> in <time datetime="2026-10-13">2026</time></p>+ <h2 id="medium-top-bar-t" tabindex="-1">The top bar that hides while you read</h2>+ <p class="fx-what">On a phone, scroll down into an article and the top bar moves up out of the way with the text; scroll up a little and it comes back down.</p>+ <h3 class="fx-sub">Made with these animations</h3>+ <div class="fx-cards">+ <article class="card c1" data-slug="hide-on-scroll-header"><div class="stage"><div class="pv" aria-hidden="true"></div><span class="tag">The whole effect</span></div><div class="meta"><h4 class="title"><a href="../animations/01-scroll-based/hide-on-scroll-header/">Hide-on-Scroll Header</a></h4><p class="desc">Scrolling down hides the top bar; scrolling up shows it. Best for mobile pages.</p></div></article>+ </div>+ <h3 class="fx-sub">A prompt to build something similar</h3>+ <div class="fx-pbox"><p class="fx-prompt">Add a hide-on-scroll top bar to <mark>[the header of your article pages]</mark>. When the reader scrolls down into the text, slide the bar up out of view, so the words get the whole screen; the moment they scroll up, even a little, slide it back. Always show it near the top of the page. Tell the direction by comparing each scroll position with the last one, ignore tiny moves so the bar never flickers, and move it only with a transform. Touch scrolling works the same way, and keyboard focus moving into the bar brings it back. If the visitor has reduced motion turned on, fade the bar out and in instead of sliding it.</p></div>+ <button type="button" class="copy" aria-label="Copy prompt for The top bar that hides while you read"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span class="copy-l" aria-live="polite">Copy prompt</span></button>+ </section>+<section class="fx-more" aria-labelledby="fx-more-t"><h2 id="fx-more-t">Seen one we should add?</h2><p>Seen an effect on a well-known site that you want explained?</p>@@ -472,7 +643,18 @@ const PREVIEWS={"hamburger-menu-toggle":{"pv":"hamb","still":0.5,"markup":"<span class=\"frame\"><span class=\"bars\"><i class=\"anim\"><\/i><i class=\"anim\"><\/i><i class=\"anim\"><\/i><\/span><\/span>"},"glassmorphism-animated":{"pv":"glass","still":0.5,"markup":"<span class=\"blob g1 anim\"><\/span><span class=\"blob g2 anim\"><\/span><span class=\"gcard\"><\/span>"},"tooltip-reveal":{"pv":"tooltip","still":0.5,"markup":"<span class=\"tgt\"><\/span><span class=\"tip anim\">Info<\/span>"},-"fade-in-out":{"pv":"fade","still":0.5,"markup":"<span class=\"sq anim\"><\/span>"}+"fade-in-out":{"pv":"fade","still":0.5,"markup":"<span class=\"sq anim\"><\/span>"},+"breathing-glow":{"pv":"glow","still":0.5,"markup":"<span class=\"core anim\"><\/span><span class=\"ring anim\"><\/span>"},+"text-gradient-animation":{"pv":"gtext","still":0.5,"markup":"<span class=\"anim\">Aa<\/span>"},+"word-by-word-reveal":{"pv":"words","still":0.5,"markup":"<b class=\"anim\"><\/b><b class=\"anim\"><\/b><b class=\"anim\"><\/b>"},+"heart-burst":{"pv":"heart","still":0.5,"markup":"<span class=\"h anim\">♥<\/span><span class=\"p anim\"><\/span><span class=\"p anim\"><\/span><span class=\"p anim\"><\/span><span class=\"p anim\"><\/span><span class=\"p anim\"><\/span><span class=\"p anim\"><\/span>"},+"click-ripple":{"pv":"ripple","still":0.5,"markup":"<span class=\"r anim\"><\/span><span class=\"r r2 anim\"><\/span><span class=\"r r3 anim\"><\/span><span class=\"dot\"><\/span>"},+"hover-state":{"pv":"hoverbtn","still":0.5,"markup":"<span class=\"btn anim\">Hover<\/span>"},+"slide-in":{"pv":"slidein","still":0.5,"markup":"<span class=\"sq anim\"><\/span>"},+"skeleton-loader":{"pv":"shimmer","still":0.5,"markup":"<span class=\"ln anim\"><\/span><span class=\"ln anim\"><\/span><span class=\"ln anim\"><\/span>"},+"scrollytelling":{"pv":"story","still":0.5,"markup":"<span class=\"sc s1 anim\"><i><\/i><\/span><span class=\"sc s2 anim\"><i><\/i><\/span><span class=\"sc s3 anim\"><i><\/i><\/span>"},+"sticky-section":{"pv":"sticky","still":0.5,"markup":"<span class=\"frame\"><i class=\"anim\"><\/i><\/span>"},+"hide-on-scroll-header":{"pv":"hideheader","still":0.72,"markup":"<span class=\"win\"><span class=\"pg anim\"><b class=\"im\"><\/b><b style=\"width:100%\"><\/b><b style=\"width:86%\"><\/b><b style=\"width:100%\"><\/b><b style=\"width:70%\"><\/b><b class=\"im\"><\/b><b style=\"width:100%\"><\/b><b style=\"width:92%\"><\/b><b style=\"width:64%\"><\/b><b style=\"width:100%\"><\/b><b class=\"im\"><\/b><b style=\"width:78%\"><\/b><b style=\"width:100%\"><\/b><b style=\"width:88%\"><\/b><\/span><span class=\"bar anim\"><span class=\"lg\"><\/span><span class=\"nm\"><\/span><span class=\"mn\"><\/span><\/span><\/span>"}};// ── end of previews ──diff --git a/tests/famous.test.js b/tests/famous.test.jsindex 0cb1fb0d..b191006c 100644--- a/tests/famous.test.js+++ b/tests/famous.test.js@@ -351,3 +351,8 @@ test('no company name in the page\'s title, description or social card, and no wconst shown = textOf(MARKUP.replace(`<p class="fx-legal">${LEGAL}</p>`, ''));assert.ok(!/\b(official|officially|approved|endorsed|sponsored|partner|partners|as used by)\b/i.test(shown), 'no word that implies approval');});++test('the page holds 10 to 12 entries, and its pill counts them', () => {+ assert.ok(ENTRIES.length >= 10 && ENTRIES.length <= 12, `${ENTRIES.length} entries, not 10 to 12`);+ assert.ok(PAGE.includes(`<p class="pill">${ENTRIES.length} effects from well-known websites</p>`), 'the pill gives the number of entries');+});