StealThis .dev

Travel — Itinerary Timeline

A time-anchored itinerary primitive for a single travel day, rendered as a vertical timeline of stops along a coloured rail. Each stop pairs an emoji icon, an auto-computed clock time, a duration and a travel-time connector to the next, colour-keyed by type for sightseeing, food, transport and hotel. Drag a handle to reorder and every time recalculates instantly; add or remove stops, step durations up and down, collapse details, and watch a running total of stops, active hours, travel minutes and a wrap-up time stay in sync.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Itinerary Timeline

A reusable single-day itinerary built for trip planners. Stops sit on a vertical, time-anchored rail: each card carries a type icon, a computed start time, a duration, and a small travel-time connector that bridges it to the next stop. Four accent colours — teal for sightseeing, coral for food, violet for transport, gold for hotel and rest — make the rhythm of the day readable at a glance, and a sticky summary panel tallies the number of stops, total active hours, minutes spent moving, and the time the day wraps up.

Every interaction actually works. Drag a stop by its handle to drop it anywhere in the order and all the clock times recompute from your chosen start time. The time field at the top reshapes the whole day; the duration stepper nudges any stop in fifteen-minute increments (clamped to a sensible floor and ceiling); and each card collapses to hide or reveal its notes. Adding a stop pulls from a rotating set of on-theme ideas and scrolls it into view, while remove and reset keep the plan easy to rebuild — each change confirmed by a small toast.

The layout is a two-column planner on the desktop that collapses to a single stacked column — summary first — on narrow screens, staying legible and tappable down to about 360px. Controls are real buttons and inputs with visible focus rings, the steppers and handles are keyboard-reachable, and reduced-motion preferences are respected.

Illustrative travel UI only — fictional destinations, prices, and maps.