Road band
A white stage with a giant pale word sliding behind a drawn coach that rolls over a black road band, a km/h readout and a dark headline block beneath.
Part of the style
Black Road White Page
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/black-road-white-page/road/figma.html?palette=d12d427770eca2b3
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/black-road-white-page/road/figma.html?palette=d12d427770eca2b3 and pass that whole HTML document to the html_to_figma tool, so the part "Road 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 {
--ink: #ffffff;
--ink-mid: rgba(255, 255, 255, 0.72);
--ink-soft: rgba(255, 255, 255, 0.4);
--paper: #131313;
--night: #ffffff;
--panel: #ffffff;
--on-night: #131313;
--on-night-soft: rgba(19, 19, 19, 0.6);
--on-night-faint: rgba(19, 19, 19, 0.24);
--ghost: #1f1f1f;
--lane: #222222;
--line-light: rgba(255, 255, 255, 0.14);
--line-dark: rgba(19, 19, 19, 0.14);
--signal: #b2958b;
--signal-light: #7b6a65;
--rim: #866c63;
--route: #81665c;
}
</style>
<section class="road">
<div class="road__stage">
<p class="road__readout"><span class="road__speed">00</span> km/h</p>
<p class="road__ghost" aria-hidden="true">On the road</p>
<svg class="road__coach" viewBox="0 0 600 176" role="img" aria-label="A long-distance coach seen from the side">
<path class="road__body" d="M24 10 H556 Q582 10 586 36 L592 122 Q593 146 570 146 H24 Q10 146 10 132 V24 Q10 10 24 10 Z"/>
<rect class="road__skirt" x="10" y="118" width="582" height="28" rx="6"/>
<rect class="road__glass" x="36" y="24" width="462" height="52" rx="4"/>
<g class="road__pillars">
<rect x="126" y="24" width="5" height="52"/>
<rect x="222" y="24" width="5" height="52"/>
<rect x="318" y="24" width="5" height="52"/>
<rect x="414" y="24" width="5" height="52"/>
</g>
<path class="road__glass" d="M512 22 H566 Q578 22 580 36 L585 84 H512 Z"/>
<rect class="road__stripe" x="10" y="90" width="502" height="5"/>
<rect class="road__door" x="514" y="90" width="34" height="54" rx="2"/>
<path class="road__seam" d="M200 100 V140 M330 100 V140 M60 100 V140"/>
<circle class="road__arch" cx="128" cy="146" r="31"/>
<circle class="road__arch" cx="448" cy="146" r="31"/>
<g class="road__wheel">
<circle class="road__tyre" cx="128" cy="146" r="25"/>
<circle class="road__hub" cx="128" cy="146" r="12"/>
<path class="road__spoke" d="M128 136 V156 M118 146 H138"/>
</g>
<g class="road__wheel">
<circle class="road__tyre" cx="448" cy="146" r="25"/>
<circle class="road__hub" cx="448" cy="146" r="12"/>
<path class="road__spoke" d="M448 136 V156 M438 146 H458"/>
</g>
</svg>
</div>
<div class="road__panel">
<h2 class="road__title">Everything a long trip needs. <span class="road__dim">Under one ticket.</span></h2>
<div class="road__side">
<p class="road__text">From the night coach to the border desk, from the seat you pick to the bag in the hold, one crew plans the whole way and stays on the line until you arrive.</p>
<a class="road__pill" href="#">Our services</a>
</div>
</div>
</section>
<style>
.road {
background: var(--paper);
color: var(--ink);
overflow: hidden;
}
.road__stage {
position: relative;
height: clamp(260px, 34vw, 480px);
border-bottom: clamp(28px, 4vw, 56px) solid var(--panel);
}
.road__readout {
position: absolute;
top: var(--space-l);
left: var(--edge);
margin: 0;
font-family: var(--font-mono);
font-size: 8.5px;
text-transform: uppercase;
color: var(--ink-mid);
font-variant-numeric: tabular-nums;
}
.road__ghost {
position: absolute;
bottom: -0.12em;
left: 0;
margin: 0;
font-family: var(--font-display);
font-variation-settings: "wdth" var(--display-width);
font-size: var(--ghost-size);
font-weight: 700;
line-height: 1;
text-transform: uppercase;
white-space: nowrap;
color: var(--ghost);
transform: translateX(var(--ghost-x, 10%));
will-change: transform;
}
.road__coach {
position: absolute;
bottom: -2px;
left: 0;
width: clamp(240px, 40vw, 580px);
height: auto;
transform: translateX(var(--coach-x, 30vw));
will-change: transform;
}
.road__body { fill: var(--paper); stroke: var(--ink-soft); stroke-width: 1.5; }
.road__skirt { fill: var(--lane); }
.road__glass { fill: var(--panel); }
.road__pillars { fill: var(--paper); }
.road__stripe { fill: var(--signal); }
.road__door { fill: none; stroke: var(--ink-soft); stroke-width: 1.5; }
.road__seam { fill: none; stroke: var(--ink-soft); stroke-width: 1; }
.road__arch { fill: var(--panel); }
.road__tyre { fill: var(--ink); }
.road__hub { fill: var(--lane); }
.road__spoke { stroke: var(--ink); stroke-width: 3; }
.road__wheel {
transform-box: fill-box;
transform-origin: center;
}
.road__panel {
display: grid;
gap: var(--space-l) var(--gap);
padding: var(--space-xl) var(--edge) var(--section-space);
background: var(--panel);
color: var(--on-night);
}
.road__title {
margin: 0;
font-family: var(--font-display);
font-variation-settings: "wdth" var(--display-width);
font-size: clamp(26px, 3.2vw, 46px);
font-weight: 700;
line-height: 1;
letter-spacing: -0.01em;
text-transform: uppercase;
max-width: 14em;
}
.road__dim { color: var(--on-night-faint); }
.road__side {
display: grid;
gap: var(--space-l);
justify-items: start;
max-width: 30em;
}
.road__text {
margin: 0;
font-size: var(--text-s);
line-height: 1.4;
color: var(--on-night-soft);
}
.road__pill {
display: inline-flex;
align-items: center;
min-height: var(--tap);
padding: 0 var(--space-m);
border: var(--rule) solid var(--on-night-faint);
border-radius: var(--pill);
color: var(--on-night);
font-family: var(--font-mono);
font-size: var(--text-xs);
text-transform: uppercase;
text-decoration: none;
transition: background-color var(--mid) var(--ease), color var(--mid) var(--ease);
}
.road__pill:hover,
.road__pill:focus-visible {
background: var(--on-night);
color: var(--ink);
outline: none;
}
@media (min-width: 820px) {
.road__panel {
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr);
}
.road__title { grid-column: 2; }
.road__side { grid-column: 3; align-self: start; }
}
</style>
<script>
(() => {
const still = matchMedia('(prefers-reduced-motion: reduce)');
function setup(root) {
const stage = root.querySelector('.road__stage');
const coach = root.querySelector('.road__coach');
const ghost = root.querySelector('.road__ghost');
const speed = root.querySelector('.road__speed');
const wheels = [...root.querySelectorAll('.road__wheel')];
let last = null, shown = 0, frame = 0, active = false;
const progress = () => {
const box = root.getBoundingClientRect();
return Math.min(1, Math.max(0, (innerHeight - box.top) / (innerHeight + box.height)));
};
const place = (p) => {
const width = stage.clientWidth;
const room = width - coach.clientWidth;
const x = Math.min(room + coach.clientWidth * 0.2, Math.max(-coach.clientWidth * 0.3, (p * 1.5 - 0.35) * room));
stage.style.setProperty('--coach-x', x.toFixed(1) + 'px');
stage.style.setProperty('--ghost-x', ((0.25 - p * 0.6) * width).toFixed(1) + 'px');
const turn = (x / (coach.clientWidth * 0.085)) * 57.3;
wheels.forEach((wheel) => { wheel.style.transform = `rotate(${turn.toFixed(1)}deg)`; });
return x;
};
const tick = () => {
const x = place(progress());
const moved = last === null ? 0 : Math.abs(x - last);
last = x;
shown += (Math.min(99, moved * 1.6) - shown) * 0.12;
speed.textContent = String(Math.round(shown)).padStart(2, '0');
if (active) frame = requestAnimationFrame(tick);
};
if (still.matches) { place(0.5); return; }
new IntersectionObserver(([entry]) => {
active = entry.isIntersecting;
cancelAnimationFrame(frame);
if (active) frame = requestAnimationFrame(tick);
}).observe(root);
place(progress());
}
document.querySelectorAll('.road').forEach(setup);
})();
</script>