Delivery — Live Order Tracking
A mobile-first live order tracking screen for a fictional food delivery app. A gridded map placeholder draws an animated SVG route with a pulsing driver puck that creeps toward home, a big ETA countdown ticks down minute by minute, and a four-stage status stepper advances from placed to delivered. A courier card offers call and message actions, while an itemised order summary lists food, totals, and the delivery address — all driven by a small vanilla-JS state machine.
MCP
Code
:root {
--brand: #ff5a2c;
--brand-d: #e0461d;
--ink: #16181d;
--ink-2: #3b3f4a;
--muted: #71757f;
--bg: #f4f5f7;
--surface: #ffffff;
--line: rgba(22, 24, 29, 0.1);
--ok: #1f9d62;
--warn: #e89422;
--danger: #d4493e;
--track: #5b8def;
--r-sm: 8px;
--r-md: 14px;
--r-lg: 20px;
--sh-sm: 0 1px 2px rgba(22, 24, 29, 0.06), 0 2px 8px rgba(22, 24, 29, 0.05);
--sh-md: 0 6px 22px rgba(22, 24, 29, 0.1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
margin: 0;
font-family: "Inter", system-ui, -apple-system, sans-serif;
line-height: 1.5;
color: var(--ink);
background:
radial-gradient(1200px 600px at 50% -10%, #ffe7df 0%, transparent 60%),
var(--bg);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
min-height: 100vh;
display: grid;
place-items: center;
padding: 24px 12px;
}
svg { stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
/* ---- Phone shell ---- */
.phone {
width: 100%;
max-width: 430px;
background: var(--surface);
border-radius: 28px;
box-shadow: var(--sh-md), 0 0 0 1px var(--line);
overflow: hidden;
display: flex;
flex-direction: column;
height: min(880px, calc(100vh - 48px));
}
.topbar {
display: flex;
align-items: center;
gap: 12px;
padding: 16px 14px;
background: var(--surface);
border-bottom: 1px solid var(--line);
position: sticky;
top: 0;
z-index: 5;
}
.topbar-title { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.order-no { font-weight: 700; font-size: 15px; }
.order-sub { font-size: 12px; color: var(--muted); }
.icon-btn {
width: 38px; height: 38px;
display: grid; place-items: center;
border: 1px solid var(--line);
background: var(--surface);
border-radius: 50%;
color: var(--ink-2);
cursor: pointer;
transition: background .15s, transform .1s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--bg); }
.icon-btn:active { transform: scale(.94); }
.scroll { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
/* ---- Map ---- */
.map {
position: relative;
height: 300px;
background:
linear-gradient(180deg, #eef2fb, #e8eefc);
overflow: hidden;
}
.map-grid {
position: absolute; inset: 0;
background-image:
linear-gradient(rgba(91,141,239,0.10) 1px, transparent 1px),
linear-gradient(90deg, rgba(91,141,239,0.10) 1px, transparent 1px);
background-size: 34px 34px;
mask-image: radial-gradient(120% 100% at 50% 50%, #000 60%, transparent 100%);
}
.map-route { position: absolute; inset: 0; width: 100%; height: 100%; }
#route { animation: dash 1.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -30; } }
.pin {
position: absolute;
display: flex; align-items: center; gap: 6px;
transform: translate(-50%, -100%);
font-size: 11px; font-weight: 600; color: var(--ink);
}
.pin-store { left: 13.3%; top: 85%; }
.pin-home { left: 86.7%; top: 13.8%; }
.pin-label {
background: var(--surface);
padding: 2px 7px;
border-radius: 999px;
box-shadow: var(--sh-sm);
}
.pin-dot {
width: 11px; height: 11px; border-radius: 50%;
background: var(--brand);
box-shadow: 0 0 0 4px rgba(255,90,44,.2);
}
.pin-dot.home { background: var(--ink); box-shadow: 0 0 0 4px rgba(22,24,29,.15); }
.driver {
position: absolute;
left: 13.3%; top: 85%;
transform: translate(-50%, -50%);
transition: left .9s ease, top .9s ease;
z-index: 3;
}
.driver-puck {
width: 40px; height: 40px;
border-radius: 50%;
background: var(--track);
color: #fff;
display: grid; place-items: center;
box-shadow: 0 4px 12px rgba(91,141,239,.5);
border: 3px solid #fff;
}
.driver-puck svg { width: 20px; height: 20px; }
.driver::after {
content: "";
position: absolute; inset: -10px;
border-radius: 50%;
border: 2px solid rgba(91,141,239,.5);
animation: ping 1.8s ease-out infinite;
}
@keyframes ping {
0% { transform: scale(.5); opacity: .9; }
100% { transform: scale(1.3); opacity: 0; }
}
.map-chip {
position: absolute; left: 12px; bottom: 12px;
background: rgba(255,255,255,.92);
backdrop-filter: blur(6px);
padding: 5px 10px;
border-radius: 999px;
font-size: 11px; font-weight: 600;
color: var(--ink-2);
display: flex; align-items: center; gap: 6px;
box-shadow: var(--sh-sm);
}
.live-dot {
width: 8px; height: 8px; border-radius: 50%;
background: var(--ok);
box-shadow: 0 0 0 0 rgba(31,157,98,.6);
animation: pulse 1.6s infinite;
}
@keyframes pulse {
0% { box-shadow: 0 0 0 0 rgba(31,157,98,.6); }
70% { box-shadow: 0 0 0 7px rgba(31,157,98,0); }
100% { box-shadow: 0 0 0 0 rgba(31,157,98,0); }
}
/* ---- ETA ---- */
.eta-card {
margin: -22px 14px 0;
position: relative; z-index: 4;
background: var(--surface);
border-radius: var(--r-lg);
box-shadow: var(--sh-md);
padding: 16px 18px;
display: flex; align-items: center; justify-content: space-between;
gap: 12px;
}
.eta-main { display: flex; flex-direction: column; }
.eta-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.eta-time { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.eta-time small { font-size: 16px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.eta-by { font-size: 12px; color: var(--muted); margin-top: 3px; }
.pill {
display: inline-flex; align-items: center;
font-size: 12px; font-weight: 700;
padding: 6px 12px; border-radius: 999px;
}
.pill-track { background: rgba(91,141,239,.14); color: #3267d6; }
.pill-ok { background: rgba(31,157,98,.15); color: var(--ok); }
.pill-warn { background: rgba(232,148,34,.16); color: #b5700f; }
/* ---- Cards ---- */
.card {
margin: 14px;
background: var(--surface);
border: 1px solid var(--line);
border-radius: var(--r-lg);
box-shadow: var(--sh-sm);
}
.tracker { padding: 8px 18px; }
.steps { list-style: none; margin: 0; padding: 8px 0; }
.step {
position: relative;
display: flex; gap: 14px; align-items: flex-start;
padding: 10px 0 10px 4px;
}
.step:not(:last-child)::before {
content: "";
position: absolute;
left: 9px; top: 26px; bottom: -4px;
width: 2px;
background: var(--line);
}
.step.done::before { background: var(--ok); }
.step-mark {
width: 20px; height: 20px; border-radius: 50%;
border: 2px solid var(--line);
background: var(--surface);
flex: none; margin-top: 2px;
position: relative; z-index: 1;
transition: all .25s;
}
.step.done .step-mark {
background: var(--ok); border-color: var(--ok);
}
.step.done .step-mark::after {
content: ""; position: absolute;
left: 5px; top: 2px; width: 5px; height: 9px;
border: solid #fff; border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
.step.active .step-mark {
border-color: var(--brand);
box-shadow: 0 0 0 4px rgba(255,90,44,.18);
animation: beat 1.4s ease-in-out infinite;
}
.step.active .step-mark::after {
content: ""; position: absolute; inset: 3px;
border-radius: 50%; background: var(--brand);
}
@keyframes beat {
0%,100% { box-shadow: 0 0 0 4px rgba(255,90,44,.18); }
50% { box-shadow: 0 0 0 7px rgba(255,90,44,.06); }
}
.step-body { display: flex; flex-direction: column; }
.step-name { font-weight: 600; font-size: 14px; }
.step.active .step-name { color: var(--brand-d); }
.step:not(.done):not(.active) .step-name { color: var(--muted); }
.step-time { font-size: 12px; color: var(--muted); }
/* ---- Driver card ---- */
.driver-card {
display: flex; align-items: center; gap: 12px;
padding: 14px 16px;
}
.avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; flex: none; background: var(--bg); }
.driver-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.driver-name { font-weight: 700; font-size: 15px; }
.driver-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.star { width: 13px; height: 13px; color: var(--warn); fill: var(--warn); stroke: none; }
.plate { font-weight: 600; color: var(--ink-2); }
.driver-actions { display: flex; gap: 8px; }
.circle-btn {
width: 42px; height: 42px; border-radius: 50%;
border: 1px solid var(--line);
background: var(--surface);
color: var(--ink-2);
display: grid; place-items: center; cursor: pointer;
transition: transform .1s, background .15s;
}
.circle-btn svg { width: 19px; height: 19px; }
.circle-btn:hover { background: var(--bg); }
.circle-btn:active { transform: scale(.92); }
.circle-btn.call { background: var(--ok); border-color: var(--ok); color: #fff; }
.circle-btn.call:hover { background: #1a8a56; }
/* ---- Summary ---- */
.summary { padding: 16px; }
.summary-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.summary-head h2 { font-size: 15px; margin: 0; }
.muted { color: var(--muted); font-size: 12px; font-weight: 500; }
.items { list-style: none; margin: 0 0 12px; padding: 0; }
.items li {
display: flex; align-items: center; gap: 10px;
padding: 8px 0; border-bottom: 1px dashed var(--line);
font-size: 14px;
}
.qty { font-weight: 700; color: var(--brand-d); min-width: 26px; }
.it-name { flex: 1; }
.it-price { font-weight: 600; }
.totals { border-top: 1px solid var(--line); padding-top: 10px; }
.totals .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); padding: 3px 0; }
.totals .row.total { font-weight: 800; font-size: 16px; color: var(--ink); padding-top: 6px; }
.addr {
display: flex; gap: 10px; align-items: flex-start;
margin-top: 14px; padding-top: 14px;
border-top: 1px solid var(--line);
font-size: 13px;
}
.addr svg { width: 20px; height: 20px; color: var(--brand); flex: none; margin-top: 1px; }
.addr strong { display: block; font-size: 13px; }
.addr span { color: var(--muted); }
/* ---- Footer ---- */
.foot {
display: flex; gap: 10px;
padding: 4px 14px 22px;
}
.ghost-btn, .primary-btn {
flex: 1; padding: 14px;
border-radius: var(--r-md);
font-weight: 700; font-size: 14px;
cursor: pointer; font-family: inherit;
transition: transform .1s, filter .15s, background .15s;
}
.ghost-btn { background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); }
.ghost-btn:hover { background: var(--bg); }
.primary-btn {
background: var(--brand); border: none; color: #fff;
box-shadow: 0 4px 14px rgba(255,90,44,.35);
}
.primary-btn:hover { filter: brightness(1.05); }
.primary-btn:active, .ghost-btn:active { transform: translateY(1px); }
.primary-btn:disabled { background: var(--muted); box-shadow: none; cursor: default; }
/* ---- Toast ---- */
.toast {
position: absolute;
left: 50%; bottom: 22px;
transform: translate(-50%, 20px);
background: var(--ink);
color: #fff;
font-size: 13px; font-weight: 600;
padding: 11px 16px;
border-radius: 999px;
box-shadow: var(--sh-md);
opacity: 0; pointer-events: none;
transition: opacity .25s, transform .25s;
z-index: 20;
max-width: 80%;
text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 520px) {
body { padding: 0; }
.phone { max-width: 100%; border-radius: 0; height: 100vh; box-shadow: none; }
.eta-time { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
#route, .driver::after, .live-dot, .step.active .step-mark { animation: none !important; }
.driver { transition: none; }
}(function () {
"use strict";
var $ = function (s, r) { return (r || document).querySelector(s); };
var $$ = function (s, r) { return Array.prototype.slice.call((r || document).querySelectorAll(s)); };
var reduceMotion = window.matchMedia &&
window.matchMedia("(prefers-reduced-motion: reduce)").matches;
/* ---------- Toast helper ---------- */
var toastEl = $("#toast");
var toastTimer;
function toast(msg) {
if (!toastEl) return;
toastEl.textContent = msg;
toastEl.classList.add("show");
clearTimeout(toastTimer);
toastTimer = setTimeout(function () { toastEl.classList.remove("show"); }, 2400);
}
/* ---------- Driver marker along the SVG route ---------- */
var routePath = $("#route");
var driver = $("#driver");
var mapSvg = $(".map-route");
var mapBox = $(".map");
var routeLen = routePath ? routePath.getTotalLength() : 0;
var vb = { w: 360, h: 320 }; // matches viewBox
// progress 0 -> at store (origin), 1 -> at home (destination)
function placeDriver(progress) {
if (!routePath || !driver || !mapBox) return;
progress = Math.max(0, Math.min(1, progress));
var pt = routePath.getPointAtLength(progress * routeLen);
// route is drawn store->home, so getPointAtLength(0) is store end
var leftPct = (pt.x / vb.w) * 100;
var topPct = (pt.y / vb.h) * 100;
driver.style.left = leftPct + "%";
driver.style.top = topPct + "%";
}
/* ---------- State machine ---------- */
var STEPS = ["placed", "preparing", "out", "delivered"];
var stepEls = $$("#steps .step");
// start state: out for delivery (index 2 active, 0/1 done)
var current = 2; // index of active step
var driverProgress = 0.32; // along route while out for delivery
var etaSeconds = 14 * 60; // 14 minutes
var delivered = false;
function renderSteps() {
stepEls.forEach(function (el, i) {
el.classList.remove("done", "active");
if (i < current) el.classList.add("done");
else if (i === current && !delivered) el.classList.add("active");
else if (delivered && i <= current) el.classList.add("done");
});
}
function nowClock(offsetSec) {
var d = new Date(Date.now() + (offsetSec || 0) * 1000);
var h = d.getHours();
var m = d.getMinutes();
var ap = h >= 12 ? "PM" : "AM";
h = h % 12; if (h === 0) h = 12;
return h + ":" + (m < 10 ? "0" + m : m) + " " + ap;
}
/* ---------- ETA countdown ---------- */
var etaMinEl = $("#etaMin");
var etaClockEl = $("#etaClock");
var statusBox = $("#etaStatus");
function renderEta() {
var mins = Math.max(0, Math.ceil(etaSeconds / 60));
if (delivered) {
if (etaMinEl) etaMinEl.parentNode.innerHTML = "Delivered";
if (etaClockEl) {
var by = etaClockEl.parentNode;
if (by) by.textContent = "Handed off at " + nowClock(0);
}
if (statusBox) statusBox.innerHTML = '<span class="pill pill-ok">Delivered</span>';
return;
}
if (etaMinEl) etaMinEl.textContent = String(mins);
if (etaClockEl) etaClockEl.textContent = nowClock(etaSeconds);
if (statusBox) {
if (mins <= 2) {
statusBox.innerHTML = '<span class="pill pill-warn">Almost there</span>';
} else {
statusBox.innerHTML = '<span class="pill pill-track">On the way</span>';
}
}
}
/* ---------- "Updated ago" chip ---------- */
var updatedAgoEl = $("#updatedAgo");
var lastUpdate = Date.now();
function bumpUpdate() { lastUpdate = Date.now(); if (updatedAgoEl) updatedAgoEl.textContent = "just now"; }
function renderAgo() {
if (!updatedAgoEl) return;
var s = Math.round((Date.now() - lastUpdate) / 1000);
if (s < 5) updatedAgoEl.textContent = "just now";
else if (s < 60) updatedAgoEl.textContent = s + "s ago";
else updatedAgoEl.textContent = Math.round(s / 60) + "m ago";
}
/* ---------- Ticking loop ---------- */
var tickTimer = setInterval(function () {
if (!delivered) {
etaSeconds = Math.max(0, etaSeconds - 1);
// creep driver toward home as eta shrinks while out for delivery
if (current === 2) {
var target = 1 - (etaSeconds / (14 * 60)) * (1 - 0.32);
driverProgress += (target - driverProgress) * 0.08;
if (!reduceMotion) placeDriver(driverProgress);
}
if (etaSeconds === 0 && current === 2) markDelivered();
renderEta();
}
renderAgo();
}, 1000);
function markDelivered() {
delivered = true;
current = 3;
driverProgress = 1;
placeDriver(1);
var step3time = $('.step[data-step="3"] .step-time');
if (step3time) step3time.textContent = nowClock(0);
renderSteps();
renderEta();
bumpUpdate();
toast("Order delivered — enjoy your meal!");
var adv = $("#advanceBtn");
if (adv) { adv.disabled = true; adv.textContent = "Delivered"; }
clearInterval(tickTimer);
}
/* ---------- Buttons ---------- */
$$(".circle-btn").forEach(function (btn) {
btn.addEventListener("click", function () {
var act = btn.getAttribute("data-act");
if (act === "call") toast("Calling Marcus Hale…");
else toast("Chat opened with Marcus");
});
});
var shareBtn = $("#shareBtn");
if (shareBtn) {
shareBtn.addEventListener("click", function () {
var url = "https://track.pronto.app/PD-4827";
if (navigator.share) {
navigator.share({ title: "Track my Pronto order", url: url })
.then(function () { toast("Tracking link shared"); })
.catch(function () {});
} else if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(url)
.then(function () { toast("Tracking link copied"); })
.catch(function () { toast("Tracking: " + url); });
} else {
toast("Tracking: " + url);
}
});
}
var advanceBtn = $("#advanceBtn");
if (advanceBtn) {
advanceBtn.addEventListener("click", function () {
if (delivered) return;
if (current < 2) {
current += 1;
renderSteps();
bumpUpdate();
toast(current === 2 ? "Marcus is heading your way" : "Status updated");
} else {
// out -> push delivery quickly
etaSeconds = Math.max(0, etaSeconds - 90);
if (etaSeconds <= 0) { markDelivered(); return; }
driverProgress = Math.min(0.97, driverProgress + 0.22);
placeDriver(driverProgress);
bumpUpdate();
renderEta();
toast(Math.ceil(etaSeconds / 60) + " min away — getting closer");
}
});
}
/* ---------- Init ---------- */
renderSteps();
renderEta();
placeDriver(driverProgress);
})();<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Track Order · Pronto Delivery</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="phone" role="application" aria-label="Live order tracking">
<header class="topbar">
<button class="icon-btn" aria-label="Back">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg>
</button>
<div class="topbar-title">
<span class="order-no">Order #PD-4827</span>
<span class="order-sub">Pronto Delivery</span>
</div>
<button class="icon-btn" aria-label="Help">
<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M9.5 9.2a2.5 2.5 0 0 1 4.8.9c0 1.8-2.5 2-2.5 3.4"/><circle cx="12" cy="17.2" r="0.6" fill="currentColor" stroke="none"/></svg>
</button>
</header>
<main class="scroll">
<!-- MAP -->
<section class="map" aria-label="Driver location map">
<div class="map-grid" aria-hidden="true"></div>
<svg class="map-route" viewBox="0 0 360 320" preserveAspectRatio="none" aria-hidden="true">
<path id="routeBg" d="M48,272 C92,250 70,180 132,168 C196,156 168,96 232,88 C280,82 296,56 312,44"
fill="none" stroke="rgba(91,141,239,0.22)" stroke-width="9" stroke-linecap="round"/>
<path id="route" d="M48,272 C92,250 70,180 132,168 C196,156 168,96 232,88 C280,82 296,56 312,44"
fill="none" stroke="var(--track)" stroke-width="5" stroke-linecap="round"
stroke-dasharray="6 9"/>
</svg>
<div class="pin pin-store" aria-hidden="true">
<span class="pin-dot"></span><span class="pin-label">Bella Forno</span>
</div>
<div class="pin pin-home" aria-hidden="true">
<span class="pin-dot home"></span><span class="pin-label">You</span>
</div>
<div id="driver" class="driver" aria-hidden="true">
<div class="driver-puck">
<svg viewBox="0 0 24 24"><path d="M5 11l2-5h7l3 5"/><circle cx="7.5" cy="16" r="2.2"/><circle cx="16.5" cy="16" r="2.2"/><path d="M9.7 16h4.6M3 16h2M19 11h2v5h-2"/></svg>
</div>
</div>
<div class="map-chip">
<span class="live-dot"></span> Live · updated <span id="updatedAgo">just now</span>
</div>
</section>
<!-- ETA -->
<section class="eta-card" aria-live="polite">
<div class="eta-main">
<span class="eta-label">Arriving in</span>
<strong class="eta-time"><span id="etaMin">14</span><small>min</small></strong>
<span class="eta-by">Estimated <span id="etaClock">7:42 PM</span></span>
</div>
<div class="eta-status" id="etaStatus">
<span class="pill pill-track">On the way</span>
</div>
</section>
<!-- STEPPER -->
<section class="card tracker" aria-label="Order progress">
<ol class="steps" id="steps">
<li class="step done" data-step="0">
<span class="step-mark"></span>
<div class="step-body"><span class="step-name">Order placed</span><span class="step-time">7:08 PM</span></div>
</li>
<li class="step done" data-step="1">
<span class="step-mark"></span>
<div class="step-body"><span class="step-name">Preparing your food</span><span class="step-time">7:14 PM</span></div>
</li>
<li class="step active" data-step="2">
<span class="step-mark"></span>
<div class="step-body"><span class="step-name">Out for delivery</span><span class="step-time" id="step2time">7:31 PM</span></div>
</li>
<li class="step" data-step="3">
<span class="step-mark"></span>
<div class="step-body"><span class="step-name">Delivered</span><span class="step-time">Pending</span></div>
</li>
</ol>
</section>
<!-- DRIVER CARD -->
<section class="card driver-card" aria-label="Your driver">
<img class="avatar" src="https://i.pravatar.cc/120?img=12" alt="Driver Marcus Hale" />
<div class="driver-meta">
<span class="driver-name">Marcus Hale</span>
<span class="driver-sub">
<svg class="star" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l2.6 5.6 6 .7-4.5 4 1.3 6-5.4-3-5.4 3 1.3-6-4.5-4 6-.7z"/></svg>
4.9 · Honda Civic · <span class="plate">7XKD 204</span>
</span>
</div>
<div class="driver-actions">
<button class="circle-btn" data-act="message" aria-label="Message driver">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16v11H8l-4 4z"/></svg>
</button>
<button class="circle-btn call" data-act="call" aria-label="Call driver">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 4h3l2 5-2.5 1.5a11 11 0 0 0 5 5L19 13l2 5v3a1 1 0 0 1-1 1A16 16 0 0 1 4 6a1 1 0 0 1 1-2z"/></svg>
</button>
</div>
</section>
<!-- ORDER SUMMARY -->
<section class="card summary" aria-label="Order summary">
<header class="summary-head">
<h2>Your order</h2>
<span class="muted">3 items</span>
</header>
<ul class="items">
<li><span class="qty">1×</span><span class="it-name">Margherita Pizza</span><span class="it-price">$16.00</span></li>
<li><span class="qty">2×</span><span class="it-name">Garlic Knots</span><span class="it-price">$9.00</span></li>
<li><span class="qty">1×</span><span class="it-name">San Pellegrino 750ml</span><span class="it-price">$4.50</span></li>
</ul>
<div class="totals">
<div class="row"><span>Subtotal</span><span>$29.50</span></div>
<div class="row"><span>Delivery</span><span>$2.99</span></div>
<div class="row total"><span>Total</span><span>$34.99</span></div>
</div>
<div class="addr">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 22s7-6.4 7-12a7 7 0 1 0-14 0c0 5.6 7 12 7 12z"/><circle cx="12" cy="10" r="2.4"/></svg>
<div><strong>Deliver to home</strong><span>418 Marlow Ave, Apt 6 · Gate code #2204</span></div>
</div>
</section>
<footer class="foot">
<button class="ghost-btn" id="shareBtn">Share tracking</button>
<button class="primary-btn" id="advanceBtn">Simulate next update</button>
</footer>
</main>
<div id="toast" class="toast" role="status" aria-live="polite"></div>
</div>
<script src="script.js"></script>
</body>
</html>Live Order Tracking
A phone-shaped tracking screen for a fictional food-delivery brand. The top half is a map placeholder built from a CSS grid and an SVG route: a dashed blue path runs from the restaurant pin to the “You” pin, and a driver puck rides along it with a pulsing live ring. As the ETA shrinks the puck eases toward home, and a floating “Live · updated just now” chip keeps the timestamp fresh.
Below the map, a big ETA card counts down the remaining minutes and flips its status pill from “On the way” to “Almost there” and finally “Delivered”. A vertical four-stage stepper — order placed, preparing, out for delivery, delivered — shows checks and timestamps for completed stages, a pulsing dot for the active one, and muted text for what is still pending. A courier card pairs an avatar, rating, and vehicle plate with round call and message buttons.
The order summary lists each item with quantity and price, a subtotal/delivery/total breakdown, and
the drop-off address. Everything is wired to a small vanilla-JS state machine: the countdown ticks
every second, “Simulate next update” advances the stepper and nudges the driver forward, and
reaching zero locks the flow at delivered with a toast. Call, message, and share actions each raise
their own toast, and all motion respects prefers-reduced-motion.
Illustrative UI only — fictional brand, not a real delivery service.