StealThis .dev

Delivery — Map Route

A mobile-first live tracking component that draws a stylized CSS-grid map with roads, an SVG route polyline from pickup to drop-off, and an animated driver marker that glides along the path. A play, pause, and restart control plus 1x, 2x, and 4x speeds drive the trip, while a big countdown ETA, distance-remaining, arrival clock, and a progress bar update in real time. Pickup and drop pins, a recenter button, and a status step tracker round out the screen with delivered and pending pills.

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

Code

Map Route

A self-contained live-tracking card for a delivery in progress. The map is drawn entirely in CSS — a faint coordinate grid with lighter road bands underneath an SVG route polyline that curves from the pickup pin at Ember & Oak to the drop-off pin on Larkspur Ave. A traveled-overlay stroke fills the route in delivery orange as the driver marker, with its pulsing halo, animates smoothly along the path using getPointAtLength.

The big ETA block counts down minutes-to-arrival and keeps the distance-remaining, a recalculated arrival clock, and a slim progress bar in sync on every frame. Playback controls let you start, pause, resume, and restart the trip, and the 1x / 2x / 4x speed group rescales the animation in place. A floating recenter button nudges the view back onto the driver with a spin of feedback, and every action raises a small toast.

Below the map, a vertical step tracker shows the order picked up, the en-route leg, and the final hand-off, swapping its in-transit and pending pills to a delivered state the moment the marker reaches the door. It is vanilla JavaScript with no dependencies and holds its layout from desktop down to a 360px phone.

Illustrative UI only — fictional brand, not a real delivery service.