Curved word band
A thick orange arc that sweeps across the page carrying a line of uppercase cream words that roll along the curve without end.
Part of the style
Tangerine Pill Parade
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/tangerine-pill-parade/band/figma.html?palette=7ef8064dfd89d2ff
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/tangerine-pill-parade/band/figma.html?palette=7ef8064dfd89d2ff and pass that whole HTML document to the html_to_figma tool, so the part "Curved word band" lands as editable layers in my open Figma file. Fonts come from Google Fonts: if a face is missing in Figma, pick the closest one.
Code
<style>
/* Goes after the pack's base.css */
:root {
--blush: #322727;
--cream: #251a1a;
--sand: #352929;
--shell: #2c2121;
--ink: #fffffe;
--ink-soft: #fbf4ee;
--white: #201515;
--orange: #87645e;
--orange-deep: #765651;
--orange-faint: rgba(135, 100, 94, 0.45);
}
</style>
<section class="band" aria-label="Fair prices, honest brakes, bells included, back by Friday">
<svg class="band__svg" viewBox="0 0 1440 300" preserveAspectRatio="xMidYMid meet" aria-hidden="true">
<path id="band-arc" class="band__arc" d="M-80 290 C 320 120, 860 40, 1520 70" />
<text class="band__text"><textPath class="band__words" href="#band-arc" startOffset="0">Fair prices • Honest brakes • Bells included • Back by Friday • </textPath></text>
</svg>
</section>
<style>
.band {
position: relative;
overflow: hidden;
height: clamp(170px, 21vw, 300px);
background: var(--cream);
}
.band__svg {
position: absolute;
left: 50%;
top: 0;
width: max(100%, 920px);
height: auto;
max-width: none;
translate: -50% 0;
}
.band__arc {
fill: none;
stroke: var(--orange);
stroke-width: 92px;
}
.band__text {
fill: var(--shell);
font-family: var(--font-display);
font-stretch: var(--display-width);
font-size: 50px;
font-weight: 800;
letter-spacing: 0.01em;
text-transform: uppercase;
dominant-baseline: central;
}
@media (max-width: 600px) {
.band { height: 150px; }
.band__svg { top: -14px; }
}
</style>
<script>
(() => {
for (const root of document.querySelectorAll('.band')) {
const svg = root.querySelector('.band__svg');
const words = root.querySelector('.band__words');
const arc = root.querySelector('.band__arc');
const phrase = words.textContent;
let unit = 0;
let offset = 0;
let last = 0;
let running = false;
let frame = 0;
const still = matchMedia('(prefers-reduced-motion: reduce)');
const fill = () => {
words.textContent = phrase;
unit = words.getComputedTextLength();
if (!unit) return;
const copies = Math.ceil(arc.getTotalLength() / unit) + 1;
words.textContent = phrase.repeat(copies);
};
const tick = (now) => {
const step = last ? now - last : 0;
last = now;
offset -= (unit / 30000) * step;
if (offset <= -unit) offset += unit;
words.setAttribute('startOffset', offset.toFixed(1));
frame = requestAnimationFrame(tick);
};
const start = () => {
if (running || still.matches || !unit) return;
running = true;
last = 0;
frame = requestAnimationFrame(tick);
};
const stop = () => {
running = false;
cancelAnimationFrame(frame);
};
(document.fonts ? document.fonts.ready : Promise.resolve()).then(() => {
fill();
new IntersectionObserver(([entry]) => (entry.isIntersecting ? start() : stop())).observe(root);
});
svg.addEventListener('mouseenter', stop);
svg.addEventListener('mouseleave', start);
}
})();
</script>