Read the road by the kilometre

A full height photo stage where dragging a route chart, or moving a time slider, rewrites one live reading.

Product tourFreeFrom Dabab, UAE experienceTwo scriptsAbout 7k tokens saved
The whole page

Links in the preview stay on the block.

Open on its own

The prompt

One prompt, written to stand on its own: goal, structure, type, colour, spacing, behaviour and the words in square brackets to replace. Paste it into any tool that writes HTML. The Code tab has this block as one file.

795 words
Download .zip
# Read the road by the kilometre

One product tour section, not a whole page: build it to drop into a page that already exists. Works in Claude, v0, Lovable, Bolt, Cursor or any tool that writes HTML.

## Goal
A product tour section for a weather or driving safety product: one reading at a chosen point along a route, over a photograph that fills the screen.

## Structure
1. Tall section, sticky full height stage
2. Photo, haze canvas over it, scrim into the page colour
3. Stage content, bottom aligned: an h2
4. Reading line: distance, visibility with unit, time
5. Chart strip: filled curve, ticked baseline, draggable head, end names
6. Time row: label, range input, mono output

## Type
Outfit 300/400/500 and Atkinson Hyperlegible Mono 400 (Google Fonts). Body 18px/1.5. h2 300 clamp(36px,5.6vw,72px)/1.04, -.035em, measure 11em. Reading line clamp(18px,2.3vw,28px)/1.4, values mono 1em tabular, labels mono .78em. Tag mono 12px. End names 500 14px. Time label 15px, output mono 18px. Second script Zain 400/700: body 20px/1.8, headings 700 at 1.12 of the Latin size, 1.38.

## Colour
Fog #E9EDF0 page, ink #0F1B24, muted #5E6B75 labels and tag, hairline #C9D1D7. Teal #076F76 for values, curve, head line, dot and thumb, over a rgba(7,111,118,.12) fill; dot and thumb take a 3px fog ring. Scrim: clear at 22%, rgba(233,237,240,.8) at 54%, solid at 78%. All three text colours on fog pass AA.

## Spacing and lines
Section 260svh, stage sticky 100svh. Content in a 1280px container, gutters clamp(20px,5vw,72px), rows clamp(16px,2.4vh,28px) apart, 76px above and 100px below. Strip 138px tall, inset 12px: curve 56px, baseline at 74px, end names at 108px, ticks every 10 units, labels every 20. Head dot 16px. Range 44px tall, 2px track, 24px thumb. Reading gaps 6px by 28px.

## Behaviour
A small script is needed. It draws the curve for the chosen hour and reads the value under the head: 70 segments on a 1000 by 60 box, running high where sight is clear. At rest one sampled point shows. Role slider on the strip: pointerdown captures the pointer and sets position from the x in the track, pointermove drags, the head moves on a 0.12s linear transition. Left and Right step 2 units, Up, Down and Page keys 10, Home and End the ends; each change rewrites aria-valuenow and aria-valuetext. The range sets the hour, redrawing curve, readings and output. The canvas drifts eleven blobs at 30fps while on screen. The h2 rises 20px once, 0.7s cubic-bezier(.2,.7,.2,1). Reduced motion: one frame.

## Responsive
Under 760px the strip is 128px, reading gaps 4px by 20px, time gap 10px, bottom padding 96px. From 761px, under 640px tall, the h2 is a flat 44px.

## Accessibility
aria-valuemin 0, aria-valuemax 140, aria-valuenow, and an aria-valuetext giving distance, visibility and time. The reading line is aria-live polite. The range has a visible label and bound output; canvas and scrim aria-hidden. Focus ring 2px teal.

## Built values (from code.html)
- Fonts: Outfit 300, 400, 500 (Google Fonts); Atkinson Hyperlegible Mono 400 (Google Fonts); Zain 400, 700 (Google Fonts).
- Colour variables: --fog #E9EDF0, --ink #0F1B24, --muted #5E6B75, --line #C9D1D7, --teal #076F76.
- Font variables: --sans "Outfit", system-ui, sans-serif; --mono "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, monospace; --arab "Zain", "Noto Naskh Arabic", system-ui, sans-serif.
- Size variables: --bar 56px, --ruler 76px, --gut clamp(20px, 5vw, 72px), --h1 clamp(44px, 8vw, 96px), --h2 clamp(36px, 5.6vw, 72px).
- Media queries: max-width 760px, min-width 761px.
- Media: assets/city.webp (2000x1333).
- Script: yes, a small inline script.

## Script
Carry two languages in one layout: every string has both versions in the markup and the root lang attribute decides which one shows, so switching is one attribute and no reload. Set the second script a step larger than the Latin so the two read at the same weight, and give it its own line height.

## Content to replace
- [Photo]: a road in low visibility, 3:2
- [Headline]: six to eight words on the chart
- [Reading labels]: two short words, distance and measure
- [End names]: the two ends of the route
- [Time label]: one word, plus the hours covered

## Rules
Plain, specific copy that reads as a live product; never the word sample. No shadows, glow, glass, blur, gradient text, emoji or italics. Motion moves transform and opacity, with colour, border, height and stroke transitions on state changes, and holds its end state under prefers-reduced-motion. Text passes WCAG AA.

## Output
Return the block in one piece: the markup, one style block with the web fonts imported on its first line, and a small script only if the behaviour needs one. No page wrapper, no framework, no build step. Prefix every class with `blk-` and put the colours and sizes in CSS variables at the top.

Media to supply

The photos and video on the live page are licensed for this showcase, so the code points at an assets folder instead. Drop your own files in with these names, or change the paths: city.webp

More like this

Product tour

Every product tour block

Same page

More from Dabab

See the page