Scroll Down Arrows and Animated Scroll Cues in CSS
Updated 2026-10-16. 8 effects.
A scroll down arrow is a small looping cue at the bottom of a hero that tells people there is more below. Make it a real link to the next section, loop it slowly with transform and opacity, and fade it out once the visitor scrolls. Each cue below does that in CSS with a tiny observer.
A cue earns its place on a full-height first screen, where nothing below the fold is visible. On a hero that already shows the top of the next section, it adds noise. Keep it small, near the bottom centre or the lower left, in a colour that reads on the hero image.
Treat it as navigation, not decoration. Each one here is an anchor with a short label such as Scroll to the menu, so it works with a keyboard and a screen reader, and smooth scrolling is turned on only when reduced motion is not requested.
The progress bar that fills while you read a long article is a different thing that also gets called a scroll indicator; it has its own piece in the scroll effects.
Compare them
| Effect | Built with | Size (gzipped) | Running cost | Browser support |
|---|---|---|---|---|
| Cascading Chevron Pair Scroll Cue on Split Hero | CSS only | 3.5 KB | Two short SVG paths fade and shift a couple of pixels; the loop stops when the cue is faded or off screen. | All current browsers |
| Mouse Outline Scroll Cue With Rolling Wheel Dot | CSS only | 3.6 KB | One small circle moves with transform and opacity, and the loop pauses once the cue has faded or the piece is off screen. | All current browsers |
| Numbered Chapter Scroll Cue With Next Section Name | CSS only | 3.8 KB | A short SVG line and a small arrow move with transform and opacity; both pause when the cue fades or the piece scrolls away. | All current browsers |
| Pill Scroll Button With Arrow Sliding Through Chip | CSS only | 3.5 KB | One small arrow moves with transform inside a clipped chip; the loop pauses once the pill fades or the hero is off screen. | All current browsers |
| Scroll Cue That Turns Into Back to Top Link | CSS and a small script | 4 KB | Two IntersectionObservers flip a few attributes; the only loop is a tiny arrow nod that pauses while the cue is hidden. | All current browsers |
| Thin Arrow Sliding Down a Vertical Rule on Photo Hero | CSS only | 3.6 KB | A single arrow group moves with transform and opacity, and stops once the cue has faded or the frame is off screen. | All current browsers |
| Turning Circle Text Scroll Badge Around Arrow | CSS only | 3.7 KB | One SVG group rotates and one arrow shifts by transform; both loops are paused once the badge fades or the hero is off screen. | All current browsers |
| Vertical Ink Line Scroll Cue That Draws Down | CSS only | 3.3 KB | One short line repaints as its dash offset changes; the loop pauses when the cue fades or the piece leaves the screen. | All current browsers |
Cascading Chevron Pair Scroll Cue on Split Hero
A pottery studio's split first screen, words on warm sand at the left and a wheel photo at the right. Under the copy sits a dark round chip holding two chevrons that brighten and dip one after the other, next to the words See the classes. On phones the photo moves above the text and the cue stays at the foot of the screen.
<section class="m5chv" data-m5chv tabindex="0" aria-label="Ashby Clay Studio first screen, scrollable">
<div class="m5chv-hint" aria-hidden="true"><span>Scroll inside</span></div>
<header class="m5chv-hero">
<div class="m5chv-text">
<p class="m5chv-brand">Ashby Clay Studio</p>
<div class="m5chv-copy">
<p class="m5chv-eyebrow">Wheel and hand-building, Tuesday to Saturday</p>
<h1 class="m5chv-h">Learn to throw a pot that holds water.</h1>
<p class="m5chv-lede">Small evening groups of six at a wheel each, in a converted dairy on Kiln Lane. Glazes, firing and tea are part of every course.</p>
</div>
<a class="m5chv-cue" href="#m5chv-next">
<svg class="m5chv-chev" viewBox="0 0 24 30" aria-hidden="true" focusable="false">
<path class="m5chv-c1" d="M5 6l7 7 7-7" />
<path class="m5chv-c2" d="M5 16l7 7 7-7" />
</svg>
<span class="m5chv-label">See the classes</span>
</a>
</div>
<figure class="m5chv-fig">
<img class="m5chv-photo" src="https://images.pexels.com/photos/31875677/pexels-photo-31875677.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="Clay-covered hands opening up a small pot on a spinning potter's wheel" width="1200" height="801" />
</figure>
</header>
<div class="m5chv-mark" aria-hidden="true"></div>
<section class="m5chv-next" id="m5chv-next" tabindex="-1" aria-labelledby="m5chv-classes">
<h2 class="m5chv-h2" id="m5chv-classes">Classes this term</h2>
<ul class="m5chv-list">
<li><span class="m5chv-day">Tue</span><div><h3>First clay</h3><p>Centring, opening and pulling up a cylinder over six weeks.</p></div></li>
<li><span class="m5chv-day">Thu</span><div><h3>Bowls and lids</h3><p>Trimming feet, fitting lids and turning a set of four.</p></div></li>
<li><span class="m5chv-day">Sat</span><div><h3>Coil and slab</h3><p>Hand-built planters and platters, no wheel needed.</p></div></li>
</ul>
</section>
</section>
<style>
/* Change these first: --m5chv-loop (length of one pulse), --m5chv-ink (the round chip behind the chevrons), --m5chv-clay (accent), --m5chv-box (frame height). */
.m5chv { position: relative; box-sizing: border-box; height: var(--m5chv-box); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
/* To use on a real page: delete height and overflow above, make the hero 100vh, and set BOX = null in the script. */
.m5chv *, .m5chv *::before, .m5chv *::after { box-sizing: border-box; }
.m5chv:focus-visible { outline: 3px solid var(--m5chv-focus); outline-offset: -3px; }
.m5chv [tabindex="-1"]:focus { outline: none; }
.m5chv-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.m5chv-hint { position: sticky; top: 0; height: 0; z-index: 6; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.m5chv-hint span { margin: 10px 0 0; padding: 4px 11px; border-radius: 999px; background: var(--m5chv-hintbg); color: var(--m5chv-hintfg); font-size: 11.5px; letter-spacing: .04em; transition: opacity .5s ease; }
.m5chv[data-touched] .m5chv-hint span { opacity: 0; }
@media (max-width: 600px) { .m5chv-hint { justify-content: flex-end; } .m5chv-hint span { margin-right: 10px; } }
.m5chv-hero { position: relative; min-height: var(--m5chv-box); }
.m5chv-cue { -webkit-tap-highlight-color: transparent; transition: opacity .45s ease, transform .45s ease, visibility 0s linear 0s; }
.m5chv-cue:focus-visible { outline: 2px solid var(--m5chv-focus); outline-offset: 4px; }
/* Faded once the marker below the hero is in view; the loop is paused while hidden or off screen. */
.m5chv[data-gone] .m5chv-cue { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; }
.m5chv[data-gone] .m5chv-cue *, .m5chv[data-off] .m5chv-cue * { animation-play-state: paused !important; }
.m5chv-mark { height: 1px; margin-bottom: -1px; }
/* Reduced motion: the cue stands still at full strength and the link jumps instead of gliding. */
@media (prefers-reduced-motion: reduce) {
.m5chv *, .m5chv *::before, .m5chv *::after { animation: none !important; transition: none !important; }
}
.m5chv { --m5chv-box: 620px; --m5chv-bg: #efe4d4; --m5chv-ink: #2e1d14; --m5chv-quiet: #6a4f3f; --m5chv-clay: #a5492a; --m5chv-focus: #a5492a; --m5chv-hintbg: rgba(46,29,20,.8); --m5chv-hintfg: #f6eee2; --m5chv-loop: 1.8s;
background: var(--m5chv-bg); color: var(--m5chv-ink); }
.m5chv-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.m5chv-text { position: relative; display: flex; flex-direction: column; padding: 28px clamp(20px, 4.5vw, 60px) 30px; }
.m5chv-brand { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-style: italic; }
.m5chv-copy { margin: auto 0; padding: 24px 0; }
.m5chv-eyebrow { margin: 0 0 14px; color: var(--m5chv-clay); font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.m5chv-h { margin: 0; font-family: Georgia, "Iowan Old Style", serif; font-weight: 400; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.04; letter-spacing: -.02em; max-width: 12em; }
.m5chv-lede { margin: 18px 0 0; max-width: 28em; color: var(--m5chv-quiet); font-size: 16px; line-height: 1.6; }
.m5chv-cue { align-self: flex-start; display: inline-flex; align-items: center; gap: 14px; min-height: 48px; padding: 4px 18px 4px 4px; border-radius: 999px; color: var(--m5chv-ink); text-decoration: none; font-size: 15px; font-weight: 600; }
.m5chv-chev { width: 40px; height: 40px; padding: 6px 9px; border-radius: 50%; background: var(--m5chv-ink); color: #f6eee2; overflow: visible; }
.m5chv-chev path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; animation: m5chv-fall var(--m5chv-loop) ease-in-out infinite; }
.m5chv-chev .m5chv-c2 { animation-delay: calc(var(--m5chv-loop) * .18); }
.m5chv-cue:hover .m5chv-label { text-decoration: underline; text-underline-offset: 5px; }
/* Each chevron brightens and drops a little in turn, so the pair reads as one downward pulse. */
@keyframes m5chv-fall {
0%, 100% { opacity: .35; transform: translateY(-2px); }
45% { opacity: 1; transform: translateY(1.5px); }
}
.m5chv-fig { margin: 0; position: relative; overflow: hidden; }
.m5chv-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.m5chv-next { padding: 60px clamp(20px, 4.5vw, 60px) 76px; background: #f7f0e6; }
.m5chv-h2 { margin: 0 0 22px; font-family: Georgia, serif; font-weight: 400; font-size: 32px; }
.m5chv-list { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.m5chv-list li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid #dccbb5; }
.m5chv-day { color: var(--m5chv-clay); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; padding-top: 3px; }
.m5chv-list h3 { margin: 0; font-size: 17px; }
.m5chv-list p { margin: 4px 0 0; color: var(--m5chv-quiet); font-size: 15px; line-height: 1.55; }
@media (max-width: 760px) {
.m5chv-hero { grid-template-columns: 1fr; grid-template-rows: 190px 1fr; }
.m5chv-fig { grid-row: 1; }
.m5chv-text { padding-top: 22px; }
.m5chv-copy { padding: 18px 0 20px; }
.m5chv-h { font-size: 32px; }
.m5chv-lede { font-size: 15px; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .m5chv-chev path { opacity: 1; transform: none; } }
</style>
<script>
(function () {
var root = document.querySelector("[data-m5chv]");
if (!root) return;
//BODY-START
var off = [];
var BOX = root; // the scrolling box; set to null when the hero is on the page itself
var cue = root.querySelector(".m5chv-cue"), mark = root.querySelector(".m5chv-mark");
var reduce = matchMedia("(prefers-reduced-motion: reduce)");
function on(el, n, f, o) { el.addEventListener(n, f, o); off.push(function () { el.removeEventListener(n, f, o); }); }
function watch(cb, opts, el) { var o = new IntersectionObserver(cb, opts); o.observe(el); off.push(function () { o.disconnect(); }); }
// Fade the cue once the marker just below the hero comes into view (or has gone past the top).
watch(function (es) {
var e = es[0], top = e.rootBounds ? e.rootBounds.top : 0;
root.toggleAttribute("data-gone", e.isIntersecting || e.boundingClientRect.top < top);
}, { root: BOX, rootMargin: "0px 0px -12% 0px" }, mark);
// Pause the loop while the whole piece is off screen.
watch(function (es) { root.toggleAttribute("data-off", !es[0].isIntersecting); }, {}, root);
on(BOX || window, "scroll", function () { root.setAttribute("data-touched", ""); }, { passive: true, once: true });
function go(ev) {
var t = root.querySelector(cue.getAttribute("href"));
if (!t) return;
ev.preventDefault();
var y = BOX ? t.getBoundingClientRect().top - BOX.getBoundingClientRect().top + BOX.scrollTop : t.getBoundingClientRect().top + scrollY;
(BOX || window).scrollTo({ top: y, behavior: reduce.matches ? "auto" : "smooth" });
t.focus({ preventScroll: true });
}
on(cue, "click", go);
//BODY-END
})();
</script>
With reduced motion: Both chevrons stay at full strength in the chip and the link goes straight to the class list.
Running cost: Two short SVG paths fade and shift a couple of pixels; the loop stops when the cue is faded or off screen.
- Change the gap between the two chevrons' pulses with the `.18` multiplier on `.m5chv-c2`.
- Recolour the chip with `--m5chv-ink` and the chevrons with the `color` on `.m5chv-chev`.
Mouse Outline Scroll Cue With Rolling Wheel Dot
A cabin rental's full-height photo hero with a small mouse outline at the bottom centre. A dot inside it rolls down like a scroll wheel and fades, every couple of seconds, above the words Scroll to the cabins. The whole cue is one link to the cabin list, and it fades away as soon as that list starts to come up.
<section class="m5mse" data-m5mse tabindex="0" aria-label="Larchwood Cabins first screen, scrollable">
<div class="m5mse-hint" aria-hidden="true"><span>Scroll inside</span></div>
<header class="m5mse-hero">
<img class="m5mse-photo" src="https://images.pexels.com/photos/19367250/pexels-photo-19367250.jpeg?auto=compress&cs=tinysrgb&w=1600" alt="A weathered wooden cabin on a grassy slope below a misty pine forest" width="1600" height="1067" />
<div class="m5mse-shade" aria-hidden="true"></div>
<div class="m5mse-bar">
<span class="m5mse-brand">Larchwood Cabins</span>
<span class="m5mse-where">Glen Ardle, open all year</span>
</div>
<div class="m5mse-copy">
<p class="m5mse-eyebrow">Four cabins, one hillside</p>
<h1 class="m5mse-h">Wake up above the fog line.</h1>
<p class="m5mse-lede">Timber cabins with wood stoves and no signal, a short walk up from the lane. Bring boots; we bring the kindling.</p>
</div>
<a class="m5mse-cue" href="#m5mse-next">
<svg class="m5mse-mouse" viewBox="0 0 28 44" aria-hidden="true" focusable="false">
<rect class="m5mse-body" x="1.5" y="1.5" width="25" height="41" rx="12.5" />
<circle class="m5mse-dot" cx="14" cy="12" r="2.6" />
</svg>
<span class="m5mse-label">Scroll to the cabins</span>
</a>
</header>
<div class="m5mse-mark" aria-hidden="true"></div>
<section class="m5mse-next" id="m5mse-next" tabindex="-1" aria-labelledby="m5mse-cabins">
<h2 class="m5mse-h2" id="m5mse-cabins">The cabins</h2>
<ul class="m5mse-list">
<li><h3>Rowan</h3><p>Sleeps two. A box bed under the window that faces down the glen.</p></li>
<li><h3>Alder</h3><p>Sleeps four. Bunk room for children and a porch with a bench.</p></li>
<li><h3>Birch</h3><p>Sleeps two. The highest cabin, with a cast iron bath on the deck.</p></li>
<li><h3>Holly</h3><p>Sleeps three. Step-free from the track, closest to the wood store.</p></li>
</ul>
</section>
</section>
<style>
/* Change these first: --m5mse-loop (how long one roll of the wheel dot takes), --m5mse-ink (cue and heading colour), --m5mse-box (height of the scrolling frame), and the photo in .m5mse-photo. */
.m5mse { position: relative; box-sizing: border-box; height: var(--m5mse-box); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
/* To use on a real page: delete height and overflow above, make the hero 100vh, and set BOX = null in the script. */
.m5mse *, .m5mse *::before, .m5mse *::after { box-sizing: border-box; }
.m5mse:focus-visible { outline: 3px solid var(--m5mse-focus); outline-offset: -3px; }
.m5mse [tabindex="-1"]:focus { outline: none; }
.m5mse-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.m5mse-hint { position: sticky; top: 0; height: 0; z-index: 6; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.m5mse-hint span { margin: 10px 0 0; padding: 4px 11px; border-radius: 999px; background: var(--m5mse-hintbg); color: var(--m5mse-hintfg); font-size: 11.5px; letter-spacing: .04em; transition: opacity .5s ease; }
.m5mse[data-touched] .m5mse-hint span { opacity: 0; }
@media (max-width: 600px) { .m5mse-hint { justify-content: flex-end; } .m5mse-hint span { margin-right: 10px; } }
.m5mse-hero { position: relative; min-height: var(--m5mse-box); }
.m5mse-cue { -webkit-tap-highlight-color: transparent; transition: opacity .45s ease, transform .45s ease, visibility 0s linear 0s; }
.m5mse-cue:focus-visible { outline: 2px solid var(--m5mse-focus); outline-offset: 4px; }
/* Faded once the marker below the hero is in view; the loop is paused while hidden or off screen. */
.m5mse[data-gone] .m5mse-cue { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; }
.m5mse[data-gone] .m5mse-cue *, .m5mse[data-off] .m5mse-cue * { animation-play-state: paused !important; }
.m5mse-mark { height: 1px; margin-bottom: -1px; }
/* Reduced motion: the cue stands still at full strength and the link jumps instead of gliding. */
@media (prefers-reduced-motion: reduce) {
.m5mse *, .m5mse *::before, .m5mse *::after { animation: none !important; transition: none !important; }
}
.m5mse { --m5mse-box: 620px; --m5mse-bg: #141a15; --m5mse-ink: #f3f1ea; --m5mse-quiet: #c9cdc3; --m5mse-moss: #a9c49a; --m5mse-focus: #f3f1ea; --m5mse-hintbg: rgba(20,26,21,.7); --m5mse-hintfg: #f3f1ea; --m5mse-loop: 2.2s;
background: var(--m5mse-bg); color: var(--m5mse-ink); }
.m5mse-hero { overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 26px clamp(20px, 5vw, 56px) 34px; }
.m5mse-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; transform: scaleX(-1); }
.m5mse-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,19,15,.55) 0%, rgba(14,19,15,.1) 34%, rgba(14,19,15,.25) 58%, rgba(14,19,15,.86) 100%); }
.m5mse-bar, .m5mse-copy, .m5mse-cue { position: relative; }
.m5mse-bar { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; letter-spacing: .02em; }
.m5mse-brand { font-weight: 650; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; }
.m5mse-where { color: var(--m5mse-quiet); }
.m5mse-copy { max-width: 560px; margin-top: auto; padding-bottom: 92px; }
.m5mse-eyebrow { margin: 0 0 12px; color: var(--m5mse-moss); font-size: 12.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.m5mse-h { margin: 0; font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-weight: 400; font-size: clamp(36px, 5.4vw, 60px); line-height: 1.02; letter-spacing: -.02em; }
.m5mse-lede { margin: 16px 0 0; max-width: 30em; color: #e2e4dc; font-size: 16px; line-height: 1.6; }
.m5mse-cue { position: absolute; left: 0; right: 0; bottom: 26px; margin: 0 auto; width: max-content; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0; color: var(--m5mse-ink); text-decoration: none; }
.m5mse-mouse { width: 26px; height: 41px; display: block; overflow: visible; }
.m5mse-body { fill: rgba(243,241,234,.06); stroke: currentColor; stroke-width: 1.6; }
.m5mse-dot { fill: currentColor; transform-box: fill-box; transform-origin: center; animation: m5mse-wheel var(--m5mse-loop) cubic-bezier(.45,0,.3,1) infinite; }
.m5mse-label { white-space: nowrap; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--m5mse-quiet); }
.m5mse-cue:hover .m5mse-label { color: var(--m5mse-ink); }
/* The wheel dot rolls down the mouse and fades, then reappears at the top. */
@keyframes m5mse-wheel {
0%, 30% { transform: translateY(0) scale(1); opacity: 1; }
72% { transform: translateY(11px) scale(.8); opacity: 0; }
73% { transform: translateY(0) scale(.8); opacity: 0; }
92%, 100% { transform: translateY(0) scale(1); opacity: 1; }
}
.m5mse-next { padding: 64px clamp(20px, 5vw, 56px) 80px; background: #f3f1ea; color: #1c241d; }
.m5mse-h2 { margin: 0 0 28px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 34px; letter-spacing: -.01em; }
.m5mse-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 28px; }
.m5mse-list li { padding: 18px 0; border-top: 1px solid #cfd2c6; }
.m5mse-list h3 { margin: 0; font-size: 17px; font-weight: 650; }
.m5mse-list p { margin: 6px 0 0; font-size: 15px; line-height: 1.55; color: #4a5248; }
@media (max-width: 600px) { .m5mse-where { display: none; } .m5mse-copy { padding-bottom: 104px; } }
@media (prefers-reduced-motion: reduce) { .m5mse-dot { opacity: 1; transform: none; } }
</style>
<script>
(function () {
var root = document.querySelector("[data-m5mse]");
if (!root) return;
//BODY-START
var off = [];
var BOX = root; // the scrolling box; set to null when the hero is on the page itself
var cue = root.querySelector(".m5mse-cue"), mark = root.querySelector(".m5mse-mark");
var reduce = matchMedia("(prefers-reduced-motion: reduce)");
function on(el, n, f, o) { el.addEventListener(n, f, o); off.push(function () { el.removeEventListener(n, f, o); }); }
function watch(cb, opts, el) { var o = new IntersectionObserver(cb, opts); o.observe(el); off.push(function () { o.disconnect(); }); }
// Fade the cue once the marker just below the hero comes into view (or has gone past the top).
watch(function (es) {
var e = es[0], top = e.rootBounds ? e.rootBounds.top : 0;
root.toggleAttribute("data-gone", e.isIntersecting || e.boundingClientRect.top < top);
}, { root: BOX, rootMargin: "0px 0px -12% 0px" }, mark);
// Pause the loop while the whole piece is off screen.
watch(function (es) { root.toggleAttribute("data-off", !es[0].isIntersecting); }, {}, root);
on(BOX || window, "scroll", function () { root.setAttribute("data-touched", ""); }, { passive: true, once: true });
function go(ev) {
var t = root.querySelector(cue.getAttribute("href"));
if (!t) return;
ev.preventDefault();
var y = BOX ? t.getBoundingClientRect().top - BOX.getBoundingClientRect().top + BOX.scrollTop : t.getBoundingClientRect().top + scrollY;
(BOX || window).scrollTo({ top: y, behavior: reduce.matches ? "auto" : "smooth" });
t.focus({ preventScroll: true });
}
on(cue, "click", go);
//BODY-END
})();
</script>
With reduced motion: The mouse outline shows with its wheel dot resting at the top, and the link jumps straight to the cabins.
Running cost: One small circle moves with transform and opacity, and the loop pauses once the cue has faded or the piece is off screen.
- Slow the roll by raising `--m5mse-loop`, for example to 3s for a calmer hero.
- Change the link text in `.m5mse-label` and the `href` to point at your own section id.
- Swap the photo in `.m5mse-photo` and adjust the gradient stops in `.m5mse-shade` until the heading reads clearly.
Numbered Chapter Scroll Cue With Next Section Name
A furniture workshop's catalogue opens on a graphite first screen with a framed chair photo. The cue in the lower left reads 01 / 04 in large figures, with four ticks and the name of the next chapter, Chairs. A small oak mark slides from the first tick toward the second while the arrow nods, so the cue says both where you are and what comes next.
<section class="m5num" data-m5num tabindex="0" aria-label="Wren and Ash Furniture first screen, scrollable">
<div class="m5num-hint" aria-hidden="true"><span>Scroll inside</span></div>
<header class="m5num-hero">
<div class="m5num-text">
<p class="m5num-brand">Wren & Ash <span>Furniture workshop</span></p>
<div class="m5num-copy">
<p class="m5num-eyebrow">Catalogue, in four chapters</p>
<h1 class="m5num-h">Made slowly in ash, oak and woven cane.</h1>
<p class="m5num-lede">Chairs, tables, shelving and small things for the hall, built to order in a two-bench workshop and finished by hand with oil and wax.</p>
</div>
<a class="m5num-cue" href="#m5num-next">
<span class="m5num-count" aria-hidden="true"><b>01</b><span>/ 04</span></span>
<span class="m5num-side">
<svg class="m5num-ticks" viewBox="0 0 96 6" aria-hidden="true" focusable="false">
<path class="m5num-t-on" d="M3 3H21" />
<path class="m5num-t-off" d="M27 3H45M51 3H69M75 3H93" />
<path class="m5num-t-run" d="M3 3H21" />
</svg>
<span class="m5num-label"><span class="m5num-sr">Chapter 1 of 4. </span>Next: Chairs
<svg class="m5num-arrow" viewBox="0 0 12 14" aria-hidden="true" focusable="false"><path d="M6 1.5V12M2 8l4 4 4-4" /></svg>
</span>
</span>
</a>
</div>
<figure class="m5num-fig">
<img class="m5num-photo" src="https://images.pexels.com/photos/20316942/pexels-photo-20316942.jpeg?auto=compress&cs=tinysrgb&w=1000" alt="Two wooden chairs with woven cane backs throwing patterned shadows on a pale wall" width="1000" height="1333" />
<figcaption>Cane back chair, oiled ash</figcaption>
</figure>
</header>
<div class="m5num-mark" aria-hidden="true"></div>
<section class="m5num-next" id="m5num-next" tabindex="-1" aria-labelledby="m5num-chairs">
<p class="m5num-chap">02 / 04</p>
<h2 class="m5num-h2" id="m5num-chairs">Chairs</h2>
<ul class="m5num-list">
<li><h3>Cane back side chair</h3><p>Steam-bent back rail, hand-woven cane, ash or oak frame.</p></li>
<li><h3>Low reading chair</h3><p>A wide seat close to the floor, with a loose wool cushion.</p></li>
<li><h3>Stacking stool</h3><p>Three legs, a dished seat, and stacks five high in a corner.</p></li>
</ul>
</section>
</section>
<style>
/* Change these first: --m5num-loop (one pass of the tick mark), --m5num-oak (accent), the chapter numbers and Next label, --m5num-box (frame height). */
.m5num { position: relative; box-sizing: border-box; height: var(--m5num-box); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
/* To use on a real page: delete height and overflow above, make the hero 100vh, and set BOX = null in the script. */
.m5num *, .m5num *::before, .m5num *::after { box-sizing: border-box; }
.m5num:focus-visible { outline: 3px solid var(--m5num-focus); outline-offset: -3px; }
.m5num [tabindex="-1"]:focus { outline: none; }
.m5num-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.m5num-hint { position: sticky; top: 0; height: 0; z-index: 6; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.m5num-hint span { margin: 10px 0 0; padding: 4px 11px; border-radius: 999px; background: var(--m5num-hintbg); color: var(--m5num-hintfg); font-size: 11.5px; letter-spacing: .04em; transition: opacity .5s ease; }
.m5num[data-touched] .m5num-hint span { opacity: 0; }
@media (max-width: 600px) { .m5num-hint { justify-content: flex-end; } .m5num-hint span { margin-right: 10px; } }
.m5num-hero { position: relative; min-height: var(--m5num-box); }
.m5num-cue { -webkit-tap-highlight-color: transparent; transition: opacity .45s ease, transform .45s ease, visibility 0s linear 0s; }
.m5num-cue:focus-visible { outline: 2px solid var(--m5num-focus); outline-offset: 4px; }
/* Faded once the marker below the hero is in view; the loop is paused while hidden or off screen. */
.m5num[data-gone] .m5num-cue { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; }
.m5num[data-gone] .m5num-cue *, .m5num[data-off] .m5num-cue * { animation-play-state: paused !important; }
.m5num-mark { height: 1px; margin-bottom: -1px; }
/* Reduced motion: the cue stands still at full strength and the link jumps instead of gliding. */
@media (prefers-reduced-motion: reduce) {
.m5num *, .m5num *::before, .m5num *::after { animation: none !important; transition: none !important; }
}
.m5num { --m5num-box: 620px; --m5num-bg: #26272a; --m5num-ink: #f1eee8; --m5num-quiet: #b9b5ad; --m5num-oak: #d6a96f; --m5num-focus: #f1eee8; --m5num-hintbg: rgba(241,238,232,.12); --m5num-hintfg: #f1eee8; --m5num-loop: 2.6s;
background: var(--m5num-bg); color: var(--m5num-ink); }
.m5num-hero { height: var(--m5num-box); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); padding: 28px clamp(20px, 5vw, 60px) 34px; }
.m5num-text { display: flex; flex-direction: column; }
.m5num-brand { margin: 0; font-size: 15px; font-weight: 700; }
.m5num-brand span { margin-left: 8px; font-weight: 400; color: var(--m5num-quiet); }
.m5num-copy { margin: auto 0; padding: 24px 0; }
.m5num-eyebrow { margin: 0 0 14px; color: var(--m5num-oak); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.m5num-h { margin: 0; max-width: 12em; font-size: clamp(34px, 4.6vw, 56px); font-weight: 600; line-height: 1.02; letter-spacing: -.035em; }
.m5num-lede { margin: 18px 0 0; max-width: 30em; color: var(--m5num-quiet); font-size: 16px; line-height: 1.6; }
.m5num-cue { align-self: flex-start; display: flex; align-items: flex-end; gap: 18px; padding: 4px 8px 4px 0; color: var(--m5num-ink); text-decoration: none; }
.m5num-count { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.m5num-count b { font-size: 46px; font-weight: 600; line-height: .9; letter-spacing: -.04em; }
.m5num-count span { color: var(--m5num-quiet); font-size: 15px; }
.m5num-side { display: flex; flex-direction: column; gap: 10px; padding-bottom: 3px; }
.m5num-ticks { width: 96px; height: 6px; display: block; overflow: visible; }
.m5num-ticks path { fill: none; stroke-width: 2.4; stroke-linecap: round; }
.m5num-t-on { stroke: var(--m5num-ink); }
.m5num-t-off { stroke: rgba(241,238,232,.24); }
.m5num-t-run { stroke: var(--m5num-oak); animation: m5num-run var(--m5num-loop) cubic-bezier(.6,0,.3,1) infinite; }
.m5num-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.m5num-arrow { width: 12px; height: 14px; fill: none; stroke: var(--m5num-oak); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; animation: m5num-nod var(--m5num-loop) ease-in-out infinite; }
.m5num-cue:hover .m5num-label { text-decoration: underline; text-underline-offset: 4px; }
/* A short oak mark leaves the first tick and travels toward the second, hinting at the next chapter. */
@keyframes m5num-run {
0%, 20% { transform: translateX(0); opacity: 0; }
30% { opacity: 1; }
70% { transform: translateX(24px); opacity: 1; }
88%, 100% { transform: translateX(24px); opacity: 0; }
}
@keyframes m5num-nod { 0%, 30%, 100% { transform: translateY(0); } 60% { transform: translateY(3px); } }
.m5num-fig { margin: 0; position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.m5num-fig > .m5num-photo { position: absolute; inset: 0 0 28px; height: calc(100% - 28px); width: 100%; object-fit: cover; border-radius: 2px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.7); }
.m5num-fig figcaption { margin-top: auto; color: var(--m5num-quiet); font-size: 12.5px; }
.m5num-next { padding: 60px clamp(20px, 5vw, 60px) 76px; background: #ece8e1; color: #222326; }
.m5num-chap { margin: 0 0 6px; color: #77706a; font-size: 13px; font-variant-numeric: tabular-nums; }
.m5num-h2 { margin: 0 0 22px; font-size: 34px; letter-spacing: -.03em; }
.m5num-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 28px; }
.m5num-list li { padding: 18px 0; border-top: 1px solid #c9c3ba; }
.m5num-list h3 { margin: 0; font-size: 17px; }
.m5num-list p { margin: 6px 0 0; color: #55524d; font-size: 15px; line-height: 1.55; }
@media (max-width: 760px) {
.m5num-hero { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 0; padding-top: 22px; }
.m5num-fig { display: none; }
.m5num-hero { grid-template-rows: 1fr; }
.m5num-brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .m5num-t-run { opacity: 0; } }
</style>
<script>
(function () {
var root = document.querySelector("[data-m5num]");
if (!root) return;
//BODY-START
var off = [];
var BOX = root; // the scrolling box; set to null when the hero is on the page itself
var cue = root.querySelector(".m5num-cue"), mark = root.querySelector(".m5num-mark");
var reduce = matchMedia("(prefers-reduced-motion: reduce)");
function on(el, n, f, o) { el.addEventListener(n, f, o); off.push(function () { el.removeEventListener(n, f, o); }); }
function watch(cb, opts, el) { var o = new IntersectionObserver(cb, opts); o.observe(el); off.push(function () { o.disconnect(); }); }
// Fade the cue once the marker just below the hero comes into view (or has gone past the top).
watch(function (es) {
var e = es[0], top = e.rootBounds ? e.rootBounds.top : 0;
root.toggleAttribute("data-gone", e.isIntersecting || e.boundingClientRect.top < top);
}, { root: BOX, rootMargin: "0px 0px -12% 0px" }, mark);
// Pause the loop while the whole piece is off screen.
watch(function (es) { root.toggleAttribute("data-off", !es[0].isIntersecting); }, {}, root);
on(BOX || window, "scroll", function () { root.setAttribute("data-touched", ""); }, { passive: true, once: true });
function go(ev) {
var t = root.querySelector(cue.getAttribute("href"));
if (!t) return;
ev.preventDefault();
var y = BOX ? t.getBoundingClientRect().top - BOX.getBoundingClientRect().top + BOX.scrollTop : t.getBoundingClientRect().top + scrollY;
(BOX || window).scrollTo({ top: y, behavior: reduce.matches ? "auto" : "smooth" });
t.focus({ preventScroll: true });
}
on(cue, "click", go);
//BODY-END
})();
</script>
With reduced motion: The figures, the four ticks and the arrow stand still, with the first tick marked, and the link jumps to Chairs.
Running cost: A short SVG line and a small arrow move with transform and opacity; both pause when the cue fades or the piece scrolls away.
- Change `01`, `/ 04` and the Next label to match your own chapter count and the id of the section that follows.
- Add or remove ticks in the `.m5num-t-off` path; each tick is 18 units long with a 6 unit gap.
Pill Scroll Button With Arrow Sliding Through Chip
A bakery's photo hero with a cream sign card in the middle and a cream pill at the foot of the screen that says See today's loaves. Inside the pill's dark round chip, the arrow drops out of the bottom and a fresh one slides in from the top, so it reads like a button that wants pressing. The pill stays centred on phones.
<section class="m5pil" data-m5pil tabindex="0" aria-label="Mill Lane Bakery first screen, scrollable">
<div class="m5pil-hint" aria-hidden="true"><span>Scroll inside</span></div>
<header class="m5pil-hero">
<img class="m5pil-photo" src="https://images.pexels.com/photos/1383908/pexels-photo-1383908.jpeg?auto=compress&cs=tinysrgb&w=1600" alt="A stack of floury rustic loaves piled on wooden shelves" width="1600" height="1067" />
<div class="m5pil-shade" aria-hidden="true"></div>
<div class="m5pil-card">
<p class="m5pil-brand">Mill Lane Bakery</p>
<h1 class="m5pil-h">Bread from the wood oven, out at seven.</h1>
<p class="m5pil-lede">Sourdough, rye and a few sweet buns, baked overnight on Mill Lane and sold from the hatch until the shelves are empty.</p>
</div>
<a class="m5pil-cue" href="#m5pil-next">
<span class="m5pil-label">See today's loaves</span>
<span class="m5pil-chip" aria-hidden="true">
<svg class="m5pil-arrow" viewBox="0 0 16 18" focusable="false"><path d="M8 2V15M3 10.5L8 15.5l5-5" /></svg>
<svg class="m5pil-arrow m5pil-arrow2" viewBox="0 0 16 18" focusable="false"><path d="M8 2V15M3 10.5L8 15.5l5-5" /></svg>
</span>
</a>
</header>
<div class="m5pil-mark" aria-hidden="true"></div>
<section class="m5pil-next" id="m5pil-next" tabindex="-1" aria-labelledby="m5pil-loaves">
<h2 class="m5pil-h2" id="m5pil-loaves">Today's loaves</h2>
<ul class="m5pil-list">
<li><h3>Country white</h3><p>A long, cool rise and a dark, crackling crust.</p></li>
<li><h3>Seeded rye</h3><p>Dense and sour, with sunflower and linseed.</p></li>
<li><h3>Spelt and honey</h3><p>Soft crumb, a little sweet, good for toast.</p></li>
<li><h3>Cardamom buns</h3><p>Knotted by hand, from ten in the morning.</p></li>
</ul>
</section>
</section>
<style>
/* Change these first: --m5pil-loop (one drop of the arrow), --m5pil-cream (pill and card colour), --m5pil-wheat (hover colour of the chip), --m5pil-box (frame height). */
.m5pil { position: relative; box-sizing: border-box; height: var(--m5pil-box); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
/* To use on a real page: delete height and overflow above, make the hero 100vh, and set BOX = null in the script. */
.m5pil *, .m5pil *::before, .m5pil *::after { box-sizing: border-box; }
.m5pil:focus-visible { outline: 3px solid var(--m5pil-focus); outline-offset: -3px; }
.m5pil [tabindex="-1"]:focus { outline: none; }
.m5pil-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.m5pil-hint { position: sticky; top: 0; height: 0; z-index: 6; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.m5pil-hint span { margin: 10px 0 0; padding: 4px 11px; border-radius: 999px; background: var(--m5pil-hintbg); color: var(--m5pil-hintfg); font-size: 11.5px; letter-spacing: .04em; transition: opacity .5s ease; }
.m5pil[data-touched] .m5pil-hint span { opacity: 0; }
@media (max-width: 600px) { .m5pil-hint { justify-content: flex-end; } .m5pil-hint span { margin-right: 10px; } }
.m5pil-hero { position: relative; min-height: var(--m5pil-box); }
.m5pil-cue { -webkit-tap-highlight-color: transparent; transition: opacity .45s ease, transform .45s ease, visibility 0s linear 0s; }
.m5pil-cue:focus-visible { outline: 2px solid var(--m5pil-focus); outline-offset: 4px; }
/* Faded once the marker below the hero is in view; the loop is paused while hidden or off screen. */
.m5pil[data-gone] .m5pil-cue { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; }
.m5pil[data-gone] .m5pil-cue *, .m5pil[data-off] .m5pil-cue * { animation-play-state: paused !important; }
.m5pil-mark { height: 1px; margin-bottom: -1px; }
/* Reduced motion: the cue stands still at full strength and the link jumps instead of gliding. */
@media (prefers-reduced-motion: reduce) {
.m5pil *, .m5pil *::before, .m5pil *::after { animation: none !important; transition: none !important; }
}
.m5pil { --m5pil-box: 620px; --m5pil-bg: #2b2017; --m5pil-cream: #f7efe1; --m5pil-ink: #2b2017; --m5pil-quiet: #6b5644; --m5pil-wheat: #b9832f; --m5pil-focus: #f7efe1; --m5pil-hintbg: rgba(43,32,23,.78); --m5pil-hintfg: #f7efe1; --m5pil-loop: 2.4s;
background: var(--m5pil-bg); color: var(--m5pil-ink); }
.m5pil-hero { overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px 110px; }
.m5pil-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m5pil-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(30,22,15,.2), rgba(30,22,15,.6) 80%); }
.m5pil-card { position: relative; max-width: 520px; padding: 34px clamp(22px, 4vw, 40px) 30px; background: var(--m5pil-cream); border-radius: 4px; text-align: center; box-shadow: 0 30px 60px -28px rgba(20,12,6,.75); }
.m5pil-brand { margin: 0 0 14px; color: var(--m5pil-wheat); font-size: 12.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.m5pil-h { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(30px, 4vw, 42px); line-height: 1.08; letter-spacing: -.015em; }
.m5pil-lede { margin: 14px 0 0; color: var(--m5pil-quiet); font-size: 15.5px; line-height: 1.6; }
.m5pil-cue { position: absolute; left: 0; right: 0; bottom: 32px; margin: 0 auto; width: max-content; display: inline-flex; align-items: center; gap: 14px; min-height: 52px; padding: 6px 6px 6px 22px; border-radius: 999px; background: var(--m5pil-cream); color: var(--m5pil-ink); text-decoration: none; font-size: 15px; font-weight: 600; box-shadow: 0 16px 30px -16px rgba(20,12,6,.8); }
.m5pil-cue:hover .m5pil-chip { background: var(--m5pil-wheat); }
.m5pil-cue:focus-visible { outline-color: var(--m5pil-cream); }
.m5pil-chip { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--m5pil-ink); overflow: hidden; display: grid; place-items: center; transition: background-color .2s ease; }
.m5pil-arrow { width: 16px; height: 18px; fill: none; stroke: var(--m5pil-cream); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; animation: m5pil-slide var(--m5pil-loop) cubic-bezier(.6,0,.3,1) infinite; }
/* One arrow drops out of the bottom of the round chip while an identical one slides in from the top; the loop restarts on a matching frame. */
@keyframes m5pil-slide {
0%, 50% { transform: translateY(0); }
78%, 100% { transform: translateY(30px); }
}
@keyframes m5pil-slide-in {
0%, 50% { transform: translateY(-30px); }
78%, 100% { transform: translateY(0); }
}
.m5pil-arrow { grid-area: 1 / 1; }
.m5pil-arrow2 { animation-name: m5pil-slide-in; }
@media (prefers-reduced-motion: reduce) { .m5pil-arrow2 { display: none; } }
.m5pil-next { padding: 60px clamp(20px, 5vw, 60px) 76px; background: var(--m5pil-cream); }
.m5pil-h2 { margin: 0 0 22px; font-family: Georgia, serif; font-weight: 400; font-size: 32px; }
.m5pil-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 28px; }
.m5pil-list li { padding: 18px 0; border-top: 1px solid #ddcdb4; }
.m5pil-list h3 { margin: 0; font-size: 17px; }
.m5pil-list p { margin: 6px 0 0; color: var(--m5pil-quiet); font-size: 15px; line-height: 1.55; }
@media (max-width: 600px) { .m5pil-hero { padding: 40px 16px 104px; } .m5pil-lede { font-size: 15px; } }
</style>
<script>
(function () {
var root = document.querySelector("[data-m5pil]");
if (!root) return;
//BODY-START
var off = [];
var BOX = root; // the scrolling box; set to null when the hero is on the page itself
var cue = root.querySelector(".m5pil-cue"), mark = root.querySelector(".m5pil-mark");
var reduce = matchMedia("(prefers-reduced-motion: reduce)");
function on(el, n, f, o) { el.addEventListener(n, f, o); off.push(function () { el.removeEventListener(n, f, o); }); }
function watch(cb, opts, el) { var o = new IntersectionObserver(cb, opts); o.observe(el); off.push(function () { o.disconnect(); }); }
// Fade the cue once the marker just below the hero comes into view (or has gone past the top).
watch(function (es) {
var e = es[0], top = e.rootBounds ? e.rootBounds.top : 0;
root.toggleAttribute("data-gone", e.isIntersecting || e.boundingClientRect.top < top);
}, { root: BOX, rootMargin: "0px 0px -12% 0px" }, mark);
// Pause the loop while the whole piece is off screen.
watch(function (es) { root.toggleAttribute("data-off", !es[0].isIntersecting); }, {}, root);
on(BOX || window, "scroll", function () { root.setAttribute("data-touched", ""); }, { passive: true, once: true });
function go(ev) {
var t = root.querySelector(cue.getAttribute("href"));
if (!t) return;
ev.preventDefault();
var y = BOX ? t.getBoundingClientRect().top - BOX.getBoundingClientRect().top + BOX.scrollTop : t.getBoundingClientRect().top + scrollY;
(BOX || window).scrollTo({ top: y, behavior: reduce.matches ? "auto" : "smooth" });
t.focus({ preventScroll: true });
}
on(cue, "click", go);
//BODY-END
})();
</script>
With reduced motion: The pill shows its arrow resting in the middle of the chip, and following it jumps to the loaves.
Running cost: One small arrow moves with transform inside a clipped chip; the loop pauses once the pill fades or the hero is off screen.
- Change the wording in `.m5pil-label` and point the `href` at your own section.
- Shorten the still pause before each drop by lowering the `45%` stop in `m5pil-slide`.
Scroll Cue That Turns Into Back to Top Link
A community garden page whose scroll cue rides along at the bottom right instead of staying in the hero. It invites you down to the beds, fades away while you read, and returns at the foot of the page as Back to top: the arrow turns to point up, the words cross-fade and the link now leads to the top. One control does both jobs.
<section class="m5flp" data-m5flp tabindex="0" aria-label="Fernhouse Kitchen Garden page, scrollable">
<div class="m5flp-hint" aria-hidden="true"><span>Scroll inside</span></div>
<header class="m5flp-hero" id="m5flp-top" tabindex="-1">
<div class="m5flp-text">
<p class="m5flp-brand">Fernhouse <span>Kitchen Garden</span></p>
<div class="m5flp-copy">
<p class="m5flp-eyebrow">A walled garden you can pick from</p>
<h1 class="m5flp-h">Rent a raised bed and grow your own salad.</h1>
<p class="m5flp-lede">Twenty-four timber beds inside an old orchard wall, with water on tap, shared tools in the shed and a gardener on site at weekends.</p>
</div>
</div>
<figure class="m5flp-fig">
<img class="m5flp-photo" src="https://images.pexels.com/photos/37487180/pexels-photo-37487180.jpeg?auto=compress&cs=tinysrgb&w=1400" alt="Rows of wooden raised beds planted with vegetables on gravel paths, trees behind" width="1400" height="1050" />
</figure>
</header>
<div class="m5flp-mark" aria-hidden="true"></div>
<section class="m5flp-next" id="m5flp-next" tabindex="-1" aria-labelledby="m5flp-beds">
<h2 class="m5flp-h2" id="m5flp-beds">The beds</h2>
<ul class="m5flp-list">
<li><h3>Half bed</h3><p>One by two metres, enough for salad leaves and herbs.</p></li>
<li><h3>Full bed</h3><p>One by four metres, room for beans, courgettes and roots.</p></li>
<li><h3>Shared bed</h3><p>Split with a neighbour, planned together at the start of spring.</p></li>
</ul>
</section>
<section class="m5flp-more" aria-labelledby="m5flp-season">
<h2 class="m5flp-h2" id="m5flp-season">Through the season</h2>
<p>Spring starts with a seed swap in the shed. In summer, the water butts are filled from the roof and the gate stays open until dusk. Autumn ends with a bonfire for the prunings and a long table of soup from the beds.</p>
</section>
<footer class="m5flp-end">
<p>Fernhouse Kitchen Garden, Orchard Walk</p>
<div class="m5flp-endmark" aria-hidden="true"></div>
</footer>
<div class="m5flp-dock">
<a class="m5flp-cue" href="#m5flp-next">
<span class="m5flp-labels">
<span class="m5flp-l1">Scroll for the beds</span>
<span class="m5flp-l2" aria-hidden="true">Back to top</span>
</span>
<span class="m5flp-chip" aria-hidden="true">
<svg class="m5flp-flip" viewBox="0 0 16 18" focusable="false"><g class="m5flp-nudge"><path d="M8 2V15M3 10.5L8 15.5l5-5" /></g></svg>
</span>
</a>
</div>
</section>
<style>
/* Change these first: --m5flp-leaf (chip colour), --m5flp-loop (arrow nod), the two labels .m5flp-l1 and .m5flp-l2, --m5flp-box (frame height). */
.m5flp { position: relative; box-sizing: border-box; height: var(--m5flp-box); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
/* To use on a real page: delete height and overflow above, make the hero 100vh, and set BOX = null in the script. */
.m5flp *, .m5flp *::before, .m5flp *::after { box-sizing: border-box; }
.m5flp:focus-visible { outline: 3px solid var(--m5flp-focus); outline-offset: -3px; }
.m5flp [tabindex="-1"]:focus { outline: none; }
.m5flp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.m5flp-hint { position: sticky; top: 0; height: 0; z-index: 6; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.m5flp-hint span { margin: 10px 0 0; padding: 4px 11px; border-radius: 999px; background: var(--m5flp-hintbg); color: var(--m5flp-hintfg); font-size: 11.5px; letter-spacing: .04em; transition: opacity .5s ease; }
.m5flp[data-touched] .m5flp-hint span { opacity: 0; }
@media (max-width: 600px) { .m5flp-hint { justify-content: flex-end; } .m5flp-hint span { margin-right: 10px; } }
.m5flp-hero { position: relative; min-height: var(--m5flp-box); }
.m5flp-cue { -webkit-tap-highlight-color: transparent; transition: opacity .45s ease, transform .45s ease, visibility 0s linear 0s; }
.m5flp-cue:focus-visible { outline: 2px solid var(--m5flp-focus); outline-offset: 4px; }
/* Faded once the marker below the hero is in view; the loop is paused while hidden or off screen. */
.m5flp[data-gone] .m5flp-cue { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; }
.m5flp[data-gone] .m5flp-cue *, .m5flp[data-off] .m5flp-cue * { animation-play-state: paused !important; }
.m5flp-mark { height: 1px; margin-bottom: -1px; }
/* Reduced motion: the cue stands still at full strength and the link jumps instead of gliding. */
@media (prefers-reduced-motion: reduce) {
.m5flp *, .m5flp *::before, .m5flp *::after { animation: none !important; transition: none !important; }
}
.m5flp { --m5flp-box: 620px; --m5flp-bg: #fbfaf7; --m5flp-ink: #1f2a2e; --m5flp-quiet: #56636a; --m5flp-leaf: #2f6b4f; --m5flp-rule: #dfe3e0; --m5flp-focus: #2f6b4f; --m5flp-hintbg: rgba(31,42,46,.85); --m5flp-hintfg: #fff; --m5flp-loop: 2.2s;
background: var(--m5flp-bg); color: var(--m5flp-ink); }
.m5flp-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding: 28px clamp(20px, 5vw, 60px) 104px; }
.m5flp-text { display: flex; flex-direction: column; }
.m5flp-brand { margin: 0; font-size: 16px; font-weight: 700; color: var(--m5flp-leaf); }
.m5flp-brand span { color: var(--m5flp-ink); font-weight: 400; }
.m5flp-copy { margin: auto 0; }
.m5flp-eyebrow { margin: 0 0 14px; color: var(--m5flp-quiet); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.m5flp-h { margin: 0; font-size: clamp(34px, 4.4vw, 54px); font-weight: 650; line-height: 1.03; letter-spacing: -.035em; }
.m5flp-lede { margin: 18px 0 0; max-width: 30em; color: var(--m5flp-quiet); font-size: 16px; line-height: 1.6; }
.m5flp-fig { margin: 0; position: relative; border-radius: 14px; overflow: hidden; min-height: 0; }
.m5flp-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m5flp-next, .m5flp-more { padding: 56px clamp(20px, 5vw, 60px); border-top: 1px solid var(--m5flp-rule); }
.m5flp-h2 { margin: 0 0 20px; font-size: 30px; letter-spacing: -.03em; }
.m5flp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 28px; }
.m5flp-list li { padding: 16px 0; border-top: 2px solid var(--m5flp-leaf); }
.m5flp-list h3 { margin: 0; font-size: 17px; }
.m5flp-list p, .m5flp-more p { margin: 6px 0 0; color: var(--m5flp-quiet); font-size: 15.5px; line-height: 1.6; max-width: 40em; }
.m5flp-end { position: relative; padding: 40px clamp(20px, 5vw, 60px) 120px; background: var(--m5flp-ink); color: #dfe6e3; font-size: 14px; }
.m5flp-end p { margin: 0; }
.m5flp-endmark { position: absolute; left: 0; bottom: 0; width: 1px; height: 60px; }
.m5flp-dock { position: sticky; bottom: 0; height: 0; z-index: 5; }
.m5flp-cue { position: absolute; right: clamp(16px, 4vw, 40px); bottom: 26px; display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 4px 4px 18px; border-radius: 999px; background: #fff; color: var(--m5flp-ink); text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: 0 1px 0 rgba(31,42,46,.06), 0 14px 30px -14px rgba(31,42,46,.45); }
.m5flp-labels { display: grid; }
.m5flp-labels > span { grid-area: 1 / 1; white-space: nowrap; transition: opacity .35s ease, transform .35s ease; }
.m5flp-l2 { opacity: 0; transform: translateY(6px); text-align: right; }
.m5flp-chip { width: 40px; height: 40px; border-radius: 50%; background: var(--m5flp-leaf); display: grid; place-items: center; }
.m5flp-flip { width: 16px; height: 18px; overflow: visible; transition: transform .5s cubic-bezier(.3,.7,.2,1); }
.m5flp-flip path { fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.m5flp-nudge { animation: m5flp-nudge var(--m5flp-loop) ease-in-out infinite; }
.m5flp-cue:hover .m5flp-chip { background: var(--m5flp-ink); }
/* A small nod along the arrow's own direction; at the end the arrow turns to point up. */
@keyframes m5flp-nudge { 0%, 100% { transform: translateY(-1.5px); } 50% { transform: translateY(2.5px); } }
.m5flp[data-end][data-gone] .m5flp-cue { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .45s ease, transform .45s ease; }
.m5flp[data-end]:not([data-off]) .m5flp-cue * { animation-play-state: running !important; }
.m5flp[data-end] .m5flp-l1 { opacity: 0; transform: translateY(-6px); }
.m5flp[data-end] .m5flp-l2 { opacity: 1; transform: none; }
.m5flp[data-end] .m5flp-flip { transform: rotate(180deg); }
@media (max-width: 760px) {
.m5flp-hero { grid-template-columns: 1fr; grid-template-rows: auto 170px; gap: 22px; padding-top: 22px; }
.m5flp-copy { margin: 26px 0 0; }
.m5flp-h { font-size: 32px; }
.m5flp-lede { font-size: 15px; }
.m5flp-cue { right: 0; left: 0; margin: 0 auto; width: max-content; }
}
</style>
<script>
(function () {
var root = document.querySelector("[data-m5flp]");
if (!root) return;
//BODY-START
var off = [];
var BOX = root; // the scrolling box; set to null when the hero is on the page itself
var cue = root.querySelector(".m5flp-cue"), mark = root.querySelector(".m5flp-mark");
var reduce = matchMedia("(prefers-reduced-motion: reduce)");
function on(el, n, f, o) { el.addEventListener(n, f, o); off.push(function () { el.removeEventListener(n, f, o); }); }
function watch(cb, opts, el) { var o = new IntersectionObserver(cb, opts); o.observe(el); off.push(function () { o.disconnect(); }); }
// Fade the cue once the marker just below the hero comes into view (or has gone past the top).
watch(function (es) {
var e = es[0], top = e.rootBounds ? e.rootBounds.top : 0;
root.toggleAttribute("data-gone", e.isIntersecting || e.boundingClientRect.top < top);
}, { root: BOX, rootMargin: "0px 0px -12% 0px" }, mark);
// Pause the loop while the whole piece is off screen.
watch(function (es) { root.toggleAttribute("data-off", !es[0].isIntersecting); }, {}, root);
on(BOX || window, "scroll", function () { root.setAttribute("data-touched", ""); }, { passive: true, once: true });
function go(ev) {
var t = root.querySelector(cue.getAttribute("href"));
if (!t) return;
ev.preventDefault();
var y = BOX ? t.getBoundingClientRect().top - BOX.getBoundingClientRect().top + BOX.scrollTop : t.getBoundingClientRect().top + scrollY;
(BOX || window).scrollTo({ top: y, behavior: reduce.matches ? "auto" : "smooth" });
t.focus({ preventScroll: true });
}
on(cue, "click", go);
// At the bottom of the page the cue comes back as a back-to-top link: arrow turns, label swaps, target changes.
var l1 = root.querySelector(".m5flp-l1"), l2 = root.querySelector(".m5flp-l2");
watch(function (es) {
var end = es[0].isIntersecting;
root.toggleAttribute("data-end", end);
cue.setAttribute("href", end ? "#m5flp-top" : "#m5flp-next");
l1.setAttribute("aria-hidden", String(end));
l2.setAttribute("aria-hidden", String(!end));
}, { root: BOX }, root.querySelector(".m5flp-endmark"));
//BODY-END
})();
</script>
With reduced motion: The arrow still flips and the labels still change at the bottom, but instantly, with no nodding, and the links jump.
Running cost: Two IntersectionObservers flip a few attributes; the only loop is a tiny arrow nod that pauses while the cue is hidden.
- Rewrite the two labels in `.m5flp-l1` and `.m5flp-l2`; the grid stacks them so the pill fits the longer one.
- Move the point where it flips by changing the `height` of `.m5flp-endmark` in the footer.
Thin Arrow Sliding Down a Vertical Rule on Photo Hero
A walking company's mountain photo hero with its cue in the lower left, beside the headline instead of under it. A hairline rule stands upright, and a thin gold arrow slides down it, fading before the end and coming back in at the top. A small numbered label, 01 Routes for this season, says where the link goes. On phones the rule shortens and sits under the text.
<section class="m5rul" data-m5rul tabindex="0" aria-label="Ridgeback Walking first screen, scrollable">
<div class="m5rul-hint" aria-hidden="true"><span>Scroll inside</span></div>
<header class="m5rul-hero">
<img class="m5rul-photo" src="https://images.pexels.com/photos/19273401/pexels-photo-19273401.jpeg?auto=compress&cs=tinysrgb&w=1600" alt="A grassy mountain ridge in early morning light with a narrow footpath along its crest" width="1600" height="900" />
<div class="m5rul-shade" aria-hidden="true"></div>
<p class="m5rul-brand">Ridgeback Walking</p>
<div class="m5rul-low">
<a class="m5rul-cue" href="#m5rul-next">
<svg class="m5rul-rule" viewBox="0 0 16 120" aria-hidden="true" focusable="false">
<path class="m5rul-track" d="M8 2V118" />
<g class="m5rul-head"><path d="M8 4V30" /><path d="M3.5 25.5L8 30l4.5-4.5" /></g>
</svg>
<span class="m5rul-label"><span class="m5rul-num">01</span>Routes for this season</span>
</a>
<div class="m5rul-copy">
<p class="m5rul-eyebrow">Guided hill days, small groups</p>
<h1 class="m5rul-h">Follow the ridge, not the crowd.</h1>
<p class="m5rul-lede">Full-day walks led by local guides who know where the path forks and when the weather turns. Lunch is carried; maps are ours.</p>
</div>
</div>
</header>
<div class="m5rul-mark" aria-hidden="true"></div>
<section class="m5rul-next" id="m5rul-next" tabindex="-1" aria-labelledby="m5rul-routes">
<h2 class="m5rul-h2" id="m5rul-routes">Routes for this season</h2>
<ul class="m5rul-list">
<li><h3>The long crest</h3><p>Eighteen kilometres along the main ridge, steady climbs, open views most of the way.</p></li>
<li><h3>Two tarns loop</h3><p>A shorter circuit past two mountain lakes, good for a first hill day.</p></li>
<li><h3>Dawn summit</h3><p>An early start with head torches to reach the top as the light comes up.</p></li>
</ul>
</section>
</section>
<style>
/* Change these first: --m5rul-loop (one slide of the arrow), --m5rul-sun (arrow and number colour), the 86px travel in m5rul-run (keep it under the rule height), --m5rul-box (frame height). */
.m5rul { position: relative; box-sizing: border-box; height: var(--m5rul-box); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
/* To use on a real page: delete height and overflow above, make the hero 100vh, and set BOX = null in the script. */
.m5rul *, .m5rul *::before, .m5rul *::after { box-sizing: border-box; }
.m5rul:focus-visible { outline: 3px solid var(--m5rul-focus); outline-offset: -3px; }
.m5rul [tabindex="-1"]:focus { outline: none; }
.m5rul-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.m5rul-hint { position: sticky; top: 0; height: 0; z-index: 6; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.m5rul-hint span { margin: 10px 0 0; padding: 4px 11px; border-radius: 999px; background: var(--m5rul-hintbg); color: var(--m5rul-hintfg); font-size: 11.5px; letter-spacing: .04em; transition: opacity .5s ease; }
.m5rul[data-touched] .m5rul-hint span { opacity: 0; }
@media (max-width: 600px) { .m5rul-hint { justify-content: flex-end; } .m5rul-hint span { margin-right: 10px; } }
.m5rul-hero { position: relative; min-height: var(--m5rul-box); }
.m5rul-cue { -webkit-tap-highlight-color: transparent; transition: opacity .45s ease, transform .45s ease, visibility 0s linear 0s; }
.m5rul-cue:focus-visible { outline: 2px solid var(--m5rul-focus); outline-offset: 4px; }
/* Faded once the marker below the hero is in view; the loop is paused while hidden or off screen. */
.m5rul[data-gone] .m5rul-cue { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; }
.m5rul[data-gone] .m5rul-cue *, .m5rul[data-off] .m5rul-cue * { animation-play-state: paused !important; }
.m5rul-mark { height: 1px; margin-bottom: -1px; }
/* Reduced motion: the cue stands still at full strength and the link jumps instead of gliding. */
@media (prefers-reduced-motion: reduce) {
.m5rul *, .m5rul *::before, .m5rul *::after { animation: none !important; transition: none !important; }
}
.m5rul { --m5rul-box: 620px; --m5rul-bg: #12202a; --m5rul-ink: #ffffff; --m5rul-quiet: #d8e0e3; --m5rul-sun: #f0c674; --m5rul-focus: #ffffff; --m5rul-hintbg: rgba(18,32,42,.72); --m5rul-hintfg: #fff; --m5rul-loop: 2.8s;
background: var(--m5rul-bg); color: var(--m5rul-ink); }
.m5rul-hero { overflow: hidden; display: flex; flex-direction: column; padding: 26px clamp(20px, 5vw, 60px) 40px; }
.m5rul-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.m5rul-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,20,27,.88) 0%, rgba(10,20,27,.5) 42%, rgba(10,20,27,0) 70%), linear-gradient(180deg, rgba(10,20,27,.45), rgba(10,20,27,0) 22%); }
.m5rul-brand, .m5rul-low { position: relative; }
.m5rul-brand { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.m5rul-low { margin-top: auto; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 40px; }
.m5rul-cue { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 4px 6px 4px 0; color: var(--m5rul-ink); text-decoration: none; }
.m5rul-rule { width: 16px; height: 120px; display: block; overflow: visible; }
.m5rul-rule path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.m5rul-track { stroke: rgba(255,255,255,.35); stroke-width: 1; }
.m5rul-head path { stroke: var(--m5rul-sun); stroke-width: 1.8; }
.m5rul-head { transform-box: view-box; animation: m5rul-run var(--m5rul-loop) cubic-bezier(.55,0,.3,1) infinite; }
.m5rul-label { display: flex; flex-direction: column; gap: 4px; max-width: 8em; font-size: 13px; font-weight: 600; line-height: 1.35; letter-spacing: .02em; }
.m5rul-num { color: var(--m5rul-sun); font-size: 11px; letter-spacing: .16em; }
.m5rul-cue:hover .m5rul-label { text-decoration: underline; text-underline-offset: 4px; }
/* The arrow slides down the thin rule, fades near the end, then comes back in at the top. */
@keyframes m5rul-run {
0% { transform: translateY(0); opacity: 0; }
12%, 62% { opacity: 1; }
80% { transform: translateY(86px); opacity: 0; }
100% { transform: translateY(86px); opacity: 0; }
}
.m5rul-copy { max-width: 560px; padding-bottom: 4px; }
.m5rul-eyebrow { margin: 0 0 12px; color: var(--m5rul-sun); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.m5rul-h { margin: 0; font-size: clamp(34px, 5vw, 58px); font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.m5rul-lede { margin: 16px 0 0; max-width: 30em; color: var(--m5rul-quiet); font-size: 16px; line-height: 1.6; }
.m5rul-next { padding: 60px clamp(20px, 5vw, 60px) 76px; background: #eef2f1; color: #14232c; }
.m5rul-h2 { margin: 0 0 22px; font-size: 30px; letter-spacing: -.02em; }
.m5rul-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 28px; }
.m5rul-list li { padding: 18px 0; border-top: 2px solid #14232c; }
.m5rul-list h3 { margin: 0; font-size: 17px; }
.m5rul-list p { margin: 6px 0 0; color: #455760; font-size: 15px; line-height: 1.55; }
@media (max-width: 640px) {
.m5rul-low { grid-template-columns: 1fr; gap: 26px; }
.m5rul-cue { order: 2; flex-direction: row; align-items: center; }
.m5rul-rule { height: 72px; }
.m5rul-head { animation-name: m5rul-run-short; }
.m5rul-label { max-width: none; }
}
@keyframes m5rul-run-short { 0% { transform: translateY(0); opacity: 0; } 12%, 60% { opacity: 1; } 80%, 100% { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .m5rul-head { opacity: 1; transform: translateY(40px); } }
</style>
<script>
(function () {
var root = document.querySelector("[data-m5rul]");
if (!root) return;
//BODY-START
var off = [];
var BOX = root; // the scrolling box; set to null when the hero is on the page itself
var cue = root.querySelector(".m5rul-cue"), mark = root.querySelector(".m5rul-mark");
var reduce = matchMedia("(prefers-reduced-motion: reduce)");
function on(el, n, f, o) { el.addEventListener(n, f, o); off.push(function () { el.removeEventListener(n, f, o); }); }
function watch(cb, opts, el) { var o = new IntersectionObserver(cb, opts); o.observe(el); off.push(function () { o.disconnect(); }); }
// Fade the cue once the marker just below the hero comes into view (or has gone past the top).
watch(function (es) {
var e = es[0], top = e.rootBounds ? e.rootBounds.top : 0;
root.toggleAttribute("data-gone", e.isIntersecting || e.boundingClientRect.top < top);
}, { root: BOX, rootMargin: "0px 0px -12% 0px" }, mark);
// Pause the loop while the whole piece is off screen.
watch(function (es) { root.toggleAttribute("data-off", !es[0].isIntersecting); }, {}, root);
on(BOX || window, "scroll", function () { root.setAttribute("data-touched", ""); }, { passive: true, once: true });
function go(ev) {
var t = root.querySelector(cue.getAttribute("href"));
if (!t) return;
ev.preventDefault();
var y = BOX ? t.getBoundingClientRect().top - BOX.getBoundingClientRect().top + BOX.scrollTop : t.getBoundingClientRect().top + scrollY;
(BOX || window).scrollTo({ top: y, behavior: reduce.matches ? "auto" : "smooth" });
t.focus({ preventScroll: true });
}
on(cue, "click", go);
//BODY-END
})();
</script>
With reduced motion: The arrow rests partway down the rule at full colour and the link jumps to the routes without gliding.
Running cost: A single arrow group moves with transform and opacity, and stops once the cue has faded or the frame is off screen.
- Change how far the arrow travels with the `86px` in `m5rul-run`, and the rule height with the `height` of `.m5rul-rule` and its `viewBox`.
- Recolour the arrow and label number with `--m5rul-sun`.
Turning Circle Text Scroll Badge Around Arrow
A coffee roaster's dark photo hero with a round badge in the lower right corner. The words Scroll down and This week's roasts run around the edge of the badge and turn slowly, a full circle every sixteen seconds, while a copper arrow in the middle nods downward. On phones the badge moves to the bottom centre under the text.
<section class="m5ring" data-m5ring tabindex="0" aria-label="Harbour Line Coffee first screen, scrollable">
<div class="m5ring-hint" aria-hidden="true"><span>Scroll inside</span></div>
<header class="m5ring-hero">
<img class="m5ring-photo" src="https://images.pexels.com/photos/894695/pexels-photo-894695.jpeg?auto=compress&cs=tinysrgb&w=1600" alt="Freshly roasted coffee beans turning in the cooling drum of a roaster" width="1600" height="1067" />
<div class="m5ring-shade" aria-hidden="true"></div>
<p class="m5ring-brand">Harbour Line <span>Coffee Roasters</span></p>
<div class="m5ring-copy">
<p class="m5ring-eyebrow">Roasted on Pier Road every Monday</p>
<h1 class="m5ring-h">Small batches, cooled by hand, bagged the same day.</h1>
<p class="m5ring-lede">Three single origins and one house blend at a time, roasted light enough to taste where they grew.</p>
</div>
<a class="m5ring-cue" href="#m5ring-next">
<span class="m5ring-sr">Scroll to this week's roasts</span>
<svg class="m5ring-ring" viewBox="0 0 100 100" aria-hidden="true" focusable="false">
<defs><path id="m5ring-circle" d="M50 50m-37 0a37 37 0 1 1 74 0a37 37 0 1 1 -74 0" /></defs>
<circle class="m5ring-disc" cx="50" cy="50" r="48" />
<g class="m5ring-turn">
<text class="m5ring-words"><textPath href="#m5ring-circle" textLength="228" lengthAdjust="spacing">SCROLL DOWN · THIS WEEK'S ROASTS · </textPath></text>
</g>
<g class="m5ring-arrow">
<path d="M50 38V61" />
<path d="M42.5 53.5L50 61l7.5-7.5" />
</g>
</svg>
</a>
</header>
<div class="m5ring-mark" aria-hidden="true"></div>
<section class="m5ring-next" id="m5ring-next" tabindex="-1" aria-labelledby="m5ring-roasts">
<h2 class="m5ring-h2" id="m5ring-roasts">This week's roasts</h2>
<ul class="m5ring-list">
<li><h3>Huila, Colombia</h3><p>Red apple and panela. Washed, light roast.</p></li>
<li><h3>Sidama, Ethiopia</h3><p>Bergamot and apricot. Natural, light roast.</p></li>
<li><h3>Breakwater blend</h3><p>Cocoa and toasted hazelnut, for milk and moka pots.</p></li>
</ul>
</section>
</section>
<style>
/* Change these first: --m5ring-turn (seconds per full turn of the ring of words), --m5ring-crema (arrow colour), the words inside textPath, --m5ring-box (frame height). */
.m5ring { position: relative; box-sizing: border-box; height: var(--m5ring-box); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
/* To use on a real page: delete height and overflow above, make the hero 100vh, and set BOX = null in the script. */
.m5ring *, .m5ring *::before, .m5ring *::after { box-sizing: border-box; }
.m5ring:focus-visible { outline: 3px solid var(--m5ring-focus); outline-offset: -3px; }
.m5ring [tabindex="-1"]:focus { outline: none; }
.m5ring-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.m5ring-hint { position: sticky; top: 0; height: 0; z-index: 6; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.m5ring-hint span { margin: 10px 0 0; padding: 4px 11px; border-radius: 999px; background: var(--m5ring-hintbg); color: var(--m5ring-hintfg); font-size: 11.5px; letter-spacing: .04em; transition: opacity .5s ease; }
.m5ring[data-touched] .m5ring-hint span { opacity: 0; }
@media (max-width: 600px) { .m5ring-hint { justify-content: flex-end; } .m5ring-hint span { margin-right: 10px; } }
.m5ring-hero { position: relative; min-height: var(--m5ring-box); }
.m5ring-cue { -webkit-tap-highlight-color: transparent; transition: opacity .45s ease, transform .45s ease, visibility 0s linear 0s; }
.m5ring-cue:focus-visible { outline: 2px solid var(--m5ring-focus); outline-offset: 4px; }
/* Faded once the marker below the hero is in view; the loop is paused while hidden or off screen. */
.m5ring[data-gone] .m5ring-cue { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; }
.m5ring[data-gone] .m5ring-cue *, .m5ring[data-off] .m5ring-cue * { animation-play-state: paused !important; }
.m5ring-mark { height: 1px; margin-bottom: -1px; }
/* Reduced motion: the cue stands still at full strength and the link jumps instead of gliding. */
@media (prefers-reduced-motion: reduce) {
.m5ring *, .m5ring *::before, .m5ring *::after { animation: none !important; transition: none !important; }
}
.m5ring { --m5ring-box: 620px; --m5ring-bg: #17110d; --m5ring-ink: #f4ebe0; --m5ring-quiet: #d3c4b3; --m5ring-crema: #d9a46b; --m5ring-focus: #f4ebe0; --m5ring-hintbg: rgba(23,17,13,.75); --m5ring-hintfg: #f4ebe0; --m5ring-turn: 16s;
background: var(--m5ring-bg); color: var(--m5ring-ink); }
.m5ring-hero { overflow: hidden; display: flex; flex-direction: column; padding: 26px clamp(20px, 5vw, 60px) 40px; }
.m5ring-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.m5ring-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,12,9,.9) 0%, rgba(18,12,9,.62) 46%, rgba(18,12,9,.12) 100%), linear-gradient(0deg, rgba(18,12,9,.5), rgba(18,12,9,0) 40%); }
.m5ring-brand, .m5ring-copy { position: relative; }
.m5ring-brand { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.m5ring-brand span { font-weight: 400; color: var(--m5ring-quiet); margin-left: 6px; }
.m5ring-copy { margin-top: auto; max-width: 540px; }
.m5ring-eyebrow { margin: 0 0 14px; color: var(--m5ring-crema); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.m5ring-h { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.06; letter-spacing: -.02em; }
.m5ring-lede { margin: 18px 0 0; max-width: 30em; color: var(--m5ring-quiet); font-size: 16px; line-height: 1.6; }
.m5ring-cue { position: absolute; right: clamp(20px, 5vw, 60px); bottom: 40px; display: block; width: 124px; height: 124px; border-radius: 50%; color: var(--m5ring-ink); }
.m5ring-ring { width: 100%; height: 100%; display: block; overflow: visible; }
.m5ring-disc { fill: rgba(23,17,13,.5); stroke: rgba(244,235,224,.28); stroke-width: .8; }
.m5ring-words { fill: currentColor; font-size: 8.4px; font-weight: 600; letter-spacing: .5px; }
.m5ring-turn { transform-box: view-box; transform-origin: 50% 50%; animation: m5ring-turn var(--m5ring-turn) linear infinite; }
.m5ring-arrow { transform-box: view-box; transform-origin: 50% 50%; animation: m5ring-nudge 2.4s ease-in-out infinite; }
.m5ring-arrow path { fill: none; stroke: var(--m5ring-crema); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.m5ring-cue:hover .m5ring-disc { fill: rgba(23,17,13,.75); }
/* The ring of words turns slowly; the arrow in the middle nods down on its own, shorter beat. */
@keyframes m5ring-turn { to { transform: rotate(360deg); } }
@keyframes m5ring-nudge { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
.m5ring-next { padding: 60px clamp(20px, 5vw, 60px) 76px; background: #f4ebe0; color: #2a1d15; }
.m5ring-h2 { margin: 0 0 22px; font-family: Georgia, serif; font-weight: 400; font-size: 32px; }
.m5ring-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 28px; }
.m5ring-list li { padding: 18px 0; border-top: 1px solid #d9c9b6; }
.m5ring-list h3 { margin: 0; font-size: 17px; }
.m5ring-list p { margin: 6px 0 0; color: #5d4a3c; font-size: 15px; line-height: 1.55; }
@media (max-width: 760px) {
.m5ring-copy { padding-bottom: 128px; }
.m5ring-cue { width: 104px; height: 104px; bottom: 26px; left: 0; right: 0; margin: 0 auto; }
.m5ring-shade { background: linear-gradient(0deg, rgba(18,12,9,.94) 0%, rgba(18,12,9,.7) 55%, rgba(18,12,9,.3) 100%); }
}
</style>
<script>
(function () {
var root = document.querySelector("[data-m5ring]");
if (!root) return;
//BODY-START
var off = [];
var BOX = root; // the scrolling box; set to null when the hero is on the page itself
var cue = root.querySelector(".m5ring-cue"), mark = root.querySelector(".m5ring-mark");
var reduce = matchMedia("(prefers-reduced-motion: reduce)");
function on(el, n, f, o) { el.addEventListener(n, f, o); off.push(function () { el.removeEventListener(n, f, o); }); }
function watch(cb, opts, el) { var o = new IntersectionObserver(cb, opts); o.observe(el); off.push(function () { o.disconnect(); }); }
// Fade the cue once the marker just below the hero comes into view (or has gone past the top).
watch(function (es) {
var e = es[0], top = e.rootBounds ? e.rootBounds.top : 0;
root.toggleAttribute("data-gone", e.isIntersecting || e.boundingClientRect.top < top);
}, { root: BOX, rootMargin: "0px 0px -12% 0px" }, mark);
// Pause the loop while the whole piece is off screen.
watch(function (es) { root.toggleAttribute("data-off", !es[0].isIntersecting); }, {}, root);
on(BOX || window, "scroll", function () { root.setAttribute("data-touched", ""); }, { passive: true, once: true });
function go(ev) {
var t = root.querySelector(cue.getAttribute("href"));
if (!t) return;
ev.preventDefault();
var y = BOX ? t.getBoundingClientRect().top - BOX.getBoundingClientRect().top + BOX.scrollTop : t.getBoundingClientRect().top + scrollY;
(BOX || window).scrollTo({ top: y, behavior: reduce.matches ? "auto" : "smooth" });
t.focus({ preventScroll: true });
}
on(cue, "click", go);
//BODY-END
})();
</script>
With reduced motion: The badge sits still with its words in place and the arrow centred, and clicking it jumps to the roasts.
Running cost: One SVG group rotates and one arrow shifts by transform; both loops are paused once the badge fades or the hero is off screen.
- Rewrite the ring in the `textPath`, then tune `textLength` until the words close the circle without a gap or overlap.
- Change `--m5ring-turn` for a faster or slower ring, and the `m5ring-nudge` duration for the arrow.
Vertical Ink Line Scroll Cue That Draws Down
A type-led bookshop front page on warm paper, with no photo at all. Below the headline, the words Read on sit above a thin rule, and an ink line draws down that rule from top to bottom, holds for a beat, then slides off the lower end and starts over. It suits quiet editorial pages where an arrow would look too loud.
<section class="m5lin" data-m5lin tabindex="0" aria-label="Folio and Finch Books first screen, scrollable">
<div class="m5lin-hint" aria-hidden="true"><span>Scroll inside</span></div>
<header class="m5lin-hero">
<div class="m5lin-top">
<span class="m5lin-brand">Folio & Finch</span>
<span class="m5lin-issue">Shop notes, autumn</span>
</div>
<div class="m5lin-copy">
<p class="m5lin-eyebrow">An independent bookshop on Wharf Street</p>
<h1 class="m5lin-h">Long books for <em>short</em> evenings.</h1>
<dl class="m5lin-facts">
<div><dt>Open</dt><dd>Wed to Sun, 10 till 6</dd></div>
<div><dt>Reading group</dt><dd>First Thursday, upstairs</dd></div>
<div><dt>Orders</dt><dd>Most titles in two days</dd></div>
</dl>
</div>
<a class="m5lin-cue" href="#m5lin-next">
<span class="m5lin-label">Read on</span>
<svg class="m5lin-line" viewBox="0 0 10 80" aria-hidden="true" focusable="false">
<path class="m5lin-track" d="M5 2V78" />
<path class="m5lin-draw" d="M5 2V78" pathLength="1" />
</svg>
</a>
</header>
<div class="m5lin-mark" aria-hidden="true"></div>
<section class="m5lin-next" id="m5lin-next" tabindex="-1" aria-labelledby="m5lin-picks">
<h2 class="m5lin-h2" id="m5lin-picks">On the front table</h2>
<ol class="m5lin-list">
<li><h3>A winter atlas of rivers</h3><p>Maps and field notes from one walker's year along the water.</p></li>
<li><h3>The salt orchard</h3><p>A family novel set over three generations on a coastal farm.</p></li>
<li><h3>Notes on bread</h3><p>Short essays on baking, patience and early mornings.</p></li>
</ol>
</section>
</section>
<style>
/* Change these first: --m5lin-loop (one draw and run-off), --m5lin-ink (the drawn line and text), --m5lin-rule (the faint track and rules), --m5lin-box (frame height). */
.m5lin { position: relative; box-sizing: border-box; height: var(--m5lin-box); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
/* To use on a real page: delete height and overflow above, make the hero 100vh, and set BOX = null in the script. */
.m5lin *, .m5lin *::before, .m5lin *::after { box-sizing: border-box; }
.m5lin:focus-visible { outline: 3px solid var(--m5lin-focus); outline-offset: -3px; }
.m5lin [tabindex="-1"]:focus { outline: none; }
.m5lin-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.m5lin-hint { position: sticky; top: 0; height: 0; z-index: 6; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.m5lin-hint span { margin: 10px 0 0; padding: 4px 11px; border-radius: 999px; background: var(--m5lin-hintbg); color: var(--m5lin-hintfg); font-size: 11.5px; letter-spacing: .04em; transition: opacity .5s ease; }
.m5lin[data-touched] .m5lin-hint span { opacity: 0; }
@media (max-width: 600px) { .m5lin-hint { justify-content: flex-end; } .m5lin-hint span { margin-right: 10px; } }
.m5lin-hero { position: relative; min-height: var(--m5lin-box); }
.m5lin-cue { -webkit-tap-highlight-color: transparent; transition: opacity .45s ease, transform .45s ease, visibility 0s linear 0s; }
.m5lin-cue:focus-visible { outline: 2px solid var(--m5lin-focus); outline-offset: 4px; }
/* Faded once the marker below the hero is in view; the loop is paused while hidden or off screen. */
.m5lin[data-gone] .m5lin-cue { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; }
.m5lin[data-gone] .m5lin-cue *, .m5lin[data-off] .m5lin-cue * { animation-play-state: paused !important; }
.m5lin-mark { height: 1px; margin-bottom: -1px; }
/* Reduced motion: the cue stands still at full strength and the link jumps instead of gliding. */
@media (prefers-reduced-motion: reduce) {
.m5lin *, .m5lin *::before, .m5lin *::after { animation: none !important; transition: none !important; }
}
.m5lin { --m5lin-box: 620px; --m5lin-bg: #f4eee3; --m5lin-ink: #221d18; --m5lin-quiet: #5f564b; --m5lin-rule: #d8cebd; --m5lin-focus: #221d18; --m5lin-hintbg: rgba(34,29,24,.82); --m5lin-hintfg: #f4eee3; --m5lin-loop: 2.6s;
background: var(--m5lin-bg); color: var(--m5lin-ink); }
.m5lin-hero { display: flex; flex-direction: column; padding: 26px clamp(20px, 5vw, 64px) 30px; }
.m5lin-top { display: flex; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--m5lin-rule); font-size: 13px; }
.m5lin-brand { font-family: Georgia, "Times New Roman", serif; font-size: 20px; letter-spacing: -.01em; }
.m5lin-issue { color: var(--m5lin-quiet); align-self: flex-end; }
.m5lin-copy { margin: auto 0; padding: 30px 0 24px; text-align: center; }
.m5lin-eyebrow { margin: 0 0 18px; color: var(--m5lin-quiet); font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; }
.m5lin-h { margin: 0 auto; max-width: 13em; font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-weight: 400; font-size: clamp(40px, 7vw, 84px); line-height: .98; letter-spacing: -.03em; }
.m5lin-h em { font-style: italic; color: #8a3b24; }
.m5lin-facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 36px; margin: 30px 0 0; font-size: 14px; }
.m5lin-facts div { display: flex; gap: 8px; }
.m5lin-facts dt { color: var(--m5lin-quiet); }
.m5lin-facts dd { margin: 0; font-weight: 600; }
.m5lin-cue { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 14px 0; color: var(--m5lin-ink); text-decoration: none; }
.m5lin-label { font-family: Georgia, serif; font-style: italic; font-size: 16px; }
.m5lin-cue:hover .m5lin-label { text-decoration: underline; text-underline-offset: 4px; }
.m5lin-line { width: 10px; height: 80px; display: block; }
.m5lin-line path { fill: none; stroke-linecap: round; }
.m5lin-track { stroke: var(--m5lin-rule); stroke-width: 1.4; }
.m5lin-draw { stroke: var(--m5lin-ink); stroke-width: 1.6; stroke-dasharray: 1 1; animation: m5lin-draw var(--m5lin-loop) cubic-bezier(.65,0,.35,1) infinite; }
/* The ink line draws down the faint track, then runs off the bottom and starts again from the top. */
@keyframes m5lin-draw {
0% { stroke-dashoffset: 1; }
50%, 58% { stroke-dashoffset: 0; }
100% { stroke-dashoffset: -1; }
}
.m5lin-next { padding: 56px clamp(20px, 5vw, 64px) 72px; border-top: 1px solid var(--m5lin-rule); }
.m5lin-h2 { margin: 0 0 20px; font-family: Georgia, serif; font-weight: 400; font-size: 30px; }
.m5lin-list { margin: 0; padding: 0 0 0 22px; display: grid; gap: 14px; max-width: 640px; }
.m5lin-list h3 { margin: 0; font-family: Georgia, serif; font-weight: 400; font-style: italic; font-size: 19px; }
.m5lin-list p { margin: 4px 0 0; color: var(--m5lin-quiet); font-size: 15px; line-height: 1.55; }
@media (max-width: 600px) { .m5lin-issue { display: none; } .m5lin-facts { flex-direction: column; align-items: center; } }
@media (prefers-reduced-motion: reduce) { .m5lin-draw { stroke-dashoffset: 0; } }
</style>
<script>
(function () {
var root = document.querySelector("[data-m5lin]");
if (!root) return;
//BODY-START
var off = [];
var BOX = root; // the scrolling box; set to null when the hero is on the page itself
var cue = root.querySelector(".m5lin-cue"), mark = root.querySelector(".m5lin-mark");
var reduce = matchMedia("(prefers-reduced-motion: reduce)");
function on(el, n, f, o) { el.addEventListener(n, f, o); off.push(function () { el.removeEventListener(n, f, o); }); }
function watch(cb, opts, el) { var o = new IntersectionObserver(cb, opts); o.observe(el); off.push(function () { o.disconnect(); }); }
// Fade the cue once the marker just below the hero comes into view (or has gone past the top).
watch(function (es) {
var e = es[0], top = e.rootBounds ? e.rootBounds.top : 0;
root.toggleAttribute("data-gone", e.isIntersecting || e.boundingClientRect.top < top);
}, { root: BOX, rootMargin: "0px 0px -12% 0px" }, mark);
// Pause the loop while the whole piece is off screen.
watch(function (es) { root.toggleAttribute("data-off", !es[0].isIntersecting); }, {}, root);
on(BOX || window, "scroll", function () { root.setAttribute("data-touched", ""); }, { passive: true, once: true });
function go(ev) {
var t = root.querySelector(cue.getAttribute("href"));
if (!t) return;
ev.preventDefault();
var y = BOX ? t.getBoundingClientRect().top - BOX.getBoundingClientRect().top + BOX.scrollTop : t.getBoundingClientRect().top + scrollY;
(BOX || window).scrollTo({ top: y, behavior: reduce.matches ? "auto" : "smooth" });
t.focus({ preventScroll: true });
}
on(cue, "click", go);
//BODY-END
})();
</script>
With reduced motion: The ink line is shown fully drawn over its track, with no movement, and the link jumps to the next section.
Running cost: One short line repaints as its dash offset changes; the loop pauses when the cue fades or the piece leaves the screen.
- Make the line longer by raising the `height` of `.m5lin-line` and the second number in the `viewBox` together.
- Change the pause at the bottom by moving the `50%, 58%` stop in the `m5lin-draw` keyframes.
Performance notes
A looping cue runs for as long as the hero is in view, so it must be cheap: one or two elements moving with transform and fading with opacity. Each loop is paused with animation-play-state once the cue has faded or the hero has left the screen.
The fade on scroll uses an IntersectionObserver on a marker just below the hero rather than a scroll listener, so nothing runs on every scroll event.
Questions
How do I make a bouncing scroll down arrow in CSS?
Draw the arrow as an inline SVG chevron inside a link, then add @keyframes that move it down a few pixels with translateY and back while fading it slightly. Use an ease-in-out curve over about 1.6 to 2.4 seconds so it reads as a nudge rather than a jitter.
Should the scroll arrow be a link or a button?
A link to the id of the next section. It then works without script, shows in the address bar, and screen readers announce it as navigation. Give it a text label because an arrow alone says nothing.
When should the scroll cue disappear?
As soon as the visitor has scrolled a little, because it has done its job. The pieces here watch a marker below the hero and fade the cue out when the marker comes into view, then bring it back if they return to the top.
What do people with reduced motion see?
The same cue standing still at full opacity, and the link jumps to the next section instead of scrolling smoothly.
Also in the gallery: Reading Progress Bar for a Long Article, Anchor Link Navigation With Motion Safe Smooth Scroll.
More collections: Scroll Animations Without a Library, Animated Icons in SVG: Interface, Weather and Success States, Smooth Scroll and Parallax Effects. All motion graphics. Build your site free to have a full site built around them.
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App