Run tracker app
A live run screen: the route draws itself on a night map, stats tick every second, lap bars grow, and Finish has to be held so it never ends by accident.
"use client";
import { useEffect, useId, useRef, useState, type CSSProperties } from "react";
import "./run-tracker.css";
type RunTrackerProps = {
/** Length of the planned route in km (the route line on the map). */
routeKm?: number;
/** Where the run starts, so the demo opens mid-run. */
startKm?: number;
startSeconds?: number;
/** Seconds the finish button must be held. */
holdSeconds?: number;
};
// One loop through a riverside neighbourhood, drawn in the map's 390 x 440 space.
const ROUTE =
"M60 380 C 70 330, 40 300, 80 270 S 170 250, 180 200 S 150 120, 210 100 S 320 120, 330 170 S 300 250, 330 300 S 300 380, 240 390 S 120 400, 60 380";
const pace = (secPerKm: number) =>
`${Math.floor(secPerKm / 60)}'${String(Math.round(secPerKm % 60)).padStart(2, "0")}"`;
const clock = (s: number) => {
const h = Math.floor(s / 3600);
const m = Math.floor((s % 3600) / 60);
const sec = Math.floor(s % 60);
return `${h ? `${h}:` : ""}${String(m).padStart(h ? 2 : 1, "0")}:${String(sec).padStart(2, "0")}`;
};
/**
* RunTracker: a live run screen.
* - The route draws itself on a dark map as the distance grows; a dot marks you.
* - Distance, pace, time and heart rate update every second.
* - Pause and Lap are taps. Finish must be held, so a sweaty thumb can't end the run by accident.
*/
export function RunTracker({
routeKm = 8,
startKm = 5.24,
startSeconds = 1638,
holdSeconds = 1.2,
}: RunTrackerProps) {
const [km, setKm] = useState(startKm);
const [secs, setSecs] = useState(startSeconds);
const [bpm, setBpm] = useState(152);
const [running, setRunning] = useState(true);
const [laps, setLaps] = useState<number[]>([318, 305, 311, 299, 312]);
const [done, setDone] = useState(false);
const [holding, setHolding] = useState(false);
const route = useRef<SVGPathElement>(null);
const runner = useRef<SVGGElement>(null);
const lapStart = useRef({ km: 5, secs: startSeconds - 74 });
const hold = useRef(0);
// A unique gradient id, so two trackers on one page never share a gradient.
const grad = `gu-run-line-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;
// The clock: about 3.2 m/s with a little natural wobble.
useEffect(() => {
if (!running || done) return;
const id = window.setInterval(() => {
setSecs((s) => s + 1);
setKm((d) =>
Math.min(routeKm, d + 0.0032 + (Math.random() - 0.5) * 0.0006),
);
setBpm((b) =>
Math.round(
Math.min(168, Math.max(142, b + (Math.random() - 0.48) * 3)),
),
);
}, 1000);
return () => window.clearInterval(id);
}, [running, done, routeKm]);
// Draw the route up to the distance run and move the runner dot to its tip.
useEffect(() => {
const path = route.current;
const dot = runner.current;
if (!path || !dot) return;
const len = path.getTotalLength();
const at = len * (km / routeKm);
path.style.strokeDasharray = `${len}`;
path.style.strokeDashoffset = `${len - at}`;
const pt = path.getPointAtLength(at);
dot.setAttribute("transform", `translate(${pt.x} ${pt.y})`);
}, [km, routeKm]);
const lap = () => {
const d = km - lapStart.current.km;
if (d < 0.05) return;
setLaps((l) => [...l, (secs - lapStart.current.secs) / d]);
lapStart.current = { km, secs };
};
const startHold = () => {
setHolding(true);
hold.current = window.setTimeout(() => {
setHolding(false);
setRunning(false);
setDone(true);
}, holdSeconds * 1000);
};
const endHold = () => {
window.clearTimeout(hold.current);
setHolding(false);
};
const avg = secs / km;
const recent = laps.slice(-6);
const slowest = Math.max(...recent);
const fastest = Math.min(...recent);
return (
<div
className="gu-run"
data-running={running}
style={{ "--hold": `${holdSeconds}s` } as CSSProperties}
>
{/* Map */}
<div className="gu-run__map" aria-hidden="true">
<svg viewBox="0 0 390 440" preserveAspectRatio="xMidYMid slice">
<defs>
<linearGradient id={grad} x1="0" y1="1" x2="1" y2="0">
<stop offset="0" stopColor="#ff5a1f" />
<stop offset="1" stopColor="#d7ff3a" />
</linearGradient>
</defs>
<path
className="gu-run__park"
d="M230 200 q40 -30 80 0 q20 40 -10 60 q-50 20 -70 -20 Z"
/>
<path
className="gu-run__park"
d="M20 120 q50 -20 90 10 q10 40 -40 50 q-50 0 -50 -60 Z"
/>
<path
className="gu-run__river"
d="M-10 230 C 60 210, 120 260, 200 240 S 330 200, 400 230"
/>
{Array.from({ length: 13 }, (_, i) => (
<path
key={`h${i}`}
className="gu-run__street"
d={`M-20 ${i * 36 + 6} L410 ${i * 36 - 30}`}
/>
))}
{Array.from({ length: 10 }, (_, i) => (
<path
key={`v${i}`}
className="gu-run__street"
d={`M${i * 44 - 10} -20 L${i * 44 + 26} 460`}
/>
))}
<path className="gu-run__ghost" d={ROUTE} />
<path
ref={route}
className="gu-run__route"
d={ROUTE}
stroke={`url(#${grad})`}
/>
<g ref={runner}>
<circle className="gu-run__pulse" r="16" />
<circle r="8" className="gu-run__me" />
</g>
</svg>
<div className="gu-run__shade" />
</div>
<header className="gu-run__top">
<span className="gu-run__chip">
<span className="gu-run__live" />
{running ? "Live" : "Paused"}
</span>
<span className="gu-run__chip">Riverside loop · {routeKm} km</span>
</header>
{/* Stats sheet */}
<section className="gu-run__sheet" aria-label="Run stats">
<p className="gu-run__label">Distance</p>
<p className="gu-run__km">
{km.toFixed(2)}
<span>km</span>
</p>
<dl className="gu-run__stats">
<div>
<dt>Pace</dt>
<dd>{pace(avg)}</dd>
</div>
<div>
<dt>Time</dt>
<dd>{clock(secs)}</dd>
</div>
<div>
<dt>Heart</dt>
<dd>
<span className="gu-run__heart" aria-hidden="true">
♥
</span>
{bpm}
</dd>
</div>
</dl>
<div className="gu-run__splits" aria-label="Recent laps">
{recent.map((s, i) => (
<span
key={i}
className="gu-run__split"
data-best={s === fastest}
style={
{
"--h":
0.35 +
0.65 * ((slowest - s) / Math.max(1, slowest - fastest)),
} as CSSProperties
}
title={`Lap ${laps.length - recent.length + i + 1}: ${pace(s)} per km`}
>
<span className="gu-run__split-bar" />
<span className="gu-run__split-label">{pace(s)}</span>
</span>
))}
</div>
<div className="gu-run__controls">
<button
type="button"
className="gu-run__small"
onClick={lap}
disabled={!running}
>
Lap
</button>
<button
type="button"
className="gu-run__main"
aria-label={running ? "Pause run" : "Resume run"}
onClick={() => setRunning((r) => !r)}
>
{running ? (
<svg viewBox="0 0 24 24">
<path d="M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" />
</svg>
) : (
<svg viewBox="0 0 24 24">
<path d="M8 5.5v13l11-6.5-11-6.5Z" />
</svg>
)}
</button>
<button
type="button"
className="gu-run__finish"
data-holding={holding}
aria-label={`Finish run: press and hold for ${holdSeconds} seconds`}
onPointerDown={startHold}
onPointerUp={endHold}
onPointerLeave={endHold}
onPointerCancel={endHold}
onKeyDown={(e) =>
(e.key === " " || e.key === "Enter") && !e.repeat && startHold()
}
onKeyUp={endHold}
onContextMenu={(e) => e.preventDefault()}
>
<svg
className="gu-run__ring"
viewBox="0 0 56 56"
aria-hidden="true"
>
<circle cx="28" cy="28" r="25" />
</svg>
<span className="gu-run__stop" aria-hidden="true" />
</button>
</div>
<p className="gu-run__hint" aria-live="polite">
{holding ? "Keep holding…" : "Hold the square to finish"}
</p>
</section>
{/* Summary */}
<div
className="gu-run__done"
hidden={!done}
role="dialog"
aria-modal="true"
aria-label="Run finished"
>
<p className="gu-run__label">Run complete</p>
<p className="gu-run__done-title">Nice run.</p>
<dl className="gu-run__stats gu-run__stats--big">
<div>
<dt>Distance</dt>
<dd>{km.toFixed(2)} km</dd>
</div>
<div>
<dt>Time</dt>
<dd>{clock(secs)}</dd>
</div>
<div>
<dt>Avg pace</dt>
<dd>{pace(avg)}</dd>
</div>
</dl>
<button
type="button"
className="gu-run__save"
autoFocus={done}
onClick={() => setDone(false)}
>
Save run
</button>
</div>
</div>
);
}
Paste this into ChatGPT, Claude, Cursor, v0, Lovable or Bolt. It describes the layout, motion, colors and accessibility and includes the code, so the AI can rebuild it in any framework.
# Build this UI piece: Run tracker app
You are a senior front-end engineer. Recreate the piece below in my project. If I don't say which framework I use, ask once, then build it in that framework (React, Vue, Svelte, Angular, Astro, plain HTML/CSS/JS or anything else). Keep the behavior, motion, colors, spacing and accessibility exactly as described. Keep the code clean and commented for beginners.
## What it is
A live running screen for phones: a dark map where the route draws itself as the distance grows, a stats sheet that updates every second, lap bars, and a Finish button you must hold.
## Layout and look
- Fills its parent; background #0b0c0e, sheet #141518, text #f4f3ee, muted #8f9094, lime #d7ff3a for go, orange #ff5a1f for effort. System font, tabular numbers.
- Map (top 54%): an SVG night map drawn in code: faint diagonal streets (7% white), two parks (green 16%), a blue river (25%), the planned route as a dotted ghost line, and the run so far as a 6px orange-to-lime gradient line with a soft lime glow. A lime dot with a dark rim marks the runner, with a pulsing halo. Gradients fade the map into the background at top and bottom.
- Top chips (frosted, blur 14px): "● Live" and "Riverside loop · 8 km".
- Sheet: radius 34px at the top. "Distance" label, the distance at 76px weight 800 (-0.05em) with a small "km". A 3-column row with dividers: Pace (5'12"), Time (27:18), Heart (a beating orange heart and bpm).
- Lap bars: the last 6 laps as rounded bars, taller = faster, the best one lime, pace under each.
- Controls: Lap (64px), a 86px lime Pause/Resume circle with a soft lime halo, and a 64px Finish button: an orange square inside a ring.
## Behavior and motion
1. Every second: time +1, distance +~3.2 m with a little random wobble, heart rate drifts between 142 and 168.
2. The route uses stroke-dasharray/dashoffset to show only the part run; the runner dot moves to getPointAtLength at the same distance (1s linear transitions).
3. Lap adds the current lap's pace as a new bar (it grows from 0).
4. Finish: press and hold for 1.2s; the ring fills linearly while held, letting go early cancels. Then a lime summary sheet slides up with distance, time, average pace and "Save run".
## Accessibility
- Pause/Resume and Finish have clear labels ("Finish run: press and hold for 1.2 seconds"); Space or Enter held also works.
- The hint under the controls is aria-live ("Keep holding…").
- The summary is a modal dialog with the Save button focused.
- prefers-reduced-motion: no pulse, heartbeat or growing; values jump.
## Props
routeKm?: number (8), startKm?: number (5.24), startSeconds?: number (1638), holdSeconds?: number (1.2)
## Reference implementation
The original is written in React with one plain CSS file. Dependencies: none (plain React and CSS). Translate it faithfully; do not add new libraries unless my framework needs them.
### RunTracker.tsx
```tsx
"use client";
import { useEffect, useId, useRef, useState, type CSSProperties } from "react";
import "./run-tracker.css";
type RunTrackerProps = {
/** Length of the planned route in km (the route line on the map). */
routeKm?: number;
/** Where the run starts, so the demo opens mid-run. */
startKm?: number;
startSeconds?: number;
/** Seconds the finish button must be held. */
holdSeconds?: number;
};
// One loop through a riverside neighbourhood, drawn in the map's 390 x 440 space.
const ROUTE =
"M60 380 C 70 330, 40 300, 80 270 S 170 250, 180 200 S 150 120, 210 100 S 320 120, 330 170 S 300 250, 330 300 S 300 380, 240 390 S 120 400, 60 380";
const pace = (secPerKm: number) =>
`${Math.floor(secPerKm / 60)}'${String(Math.round(secPerKm % 60)).padStart(2, "0")}"`;
const clock = (s: number) => {
const h = Math.floor(s / 3600);
const m = Math.floor((s % 3600) / 60);
const sec = Math.floor(s % 60);
return `${h ? `${h}:` : ""}${String(m).padStart(h ? 2 : 1, "0")}:${String(sec).padStart(2, "0")}`;
};
/**
* RunTracker: a live run screen.
* - The route draws itself on a dark map as the distance grows; a dot marks you.
* - Distance, pace, time and heart rate update every second.
* - Pause and Lap are taps. Finish must be held, so a sweaty thumb can't end the run by accident.
*/
export function RunTracker({
routeKm = 8,
startKm = 5.24,
startSeconds = 1638,
holdSeconds = 1.2,
}: RunTrackerProps) {
const [km, setKm] = useState(startKm);
const [secs, setSecs] = useState(startSeconds);
const [bpm, setBpm] = useState(152);
const [running, setRunning] = useState(true);
const [laps, setLaps] = useState<number[]>([318, 305, 311, 299, 312]);
const [done, setDone] = useState(false);
const [holding, setHolding] = useState(false);
const route = useRef<SVGPathElement>(null);
const runner = useRef<SVGGElement>(null);
const lapStart = useRef({ km: 5, secs: startSeconds - 74 });
const hold = useRef(0);
// A unique gradient id, so two trackers on one page never share a gradient.
const grad = `gu-run-line-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;
// The clock: about 3.2 m/s with a little natural wobble.
useEffect(() => {
if (!running || done) return;
const id = window.setInterval(() => {
setSecs((s) => s + 1);
setKm((d) =>
Math.min(routeKm, d + 0.0032 + (Math.random() - 0.5) * 0.0006),
);
setBpm((b) =>
Math.round(
Math.min(168, Math.max(142, b + (Math.random() - 0.48) * 3)),
),
);
}, 1000);
return () => window.clearInterval(id);
}, [running, done, routeKm]);
// Draw the route up to the distance run and move the runner dot to its tip.
useEffect(() => {
const path = route.current;
const dot = runner.current;
if (!path || !dot) return;
const len = path.getTotalLength();
const at = len * (km / routeKm);
path.style.strokeDasharray = `${len}`;
path.style.strokeDashoffset = `${len - at}`;
const pt = path.getPointAtLength(at);
dot.setAttribute("transform", `translate(${pt.x} ${pt.y})`);
}, [km, routeKm]);
const lap = () => {
const d = km - lapStart.current.km;
if (d < 0.05) return;
setLaps((l) => [...l, (secs - lapStart.current.secs) / d]);
lapStart.current = { km, secs };
};
const startHold = () => {
setHolding(true);
hold.current = window.setTimeout(() => {
setHolding(false);
setRunning(false);
setDone(true);
}, holdSeconds * 1000);
};
const endHold = () => {
window.clearTimeout(hold.current);
setHolding(false);
};
const avg = secs / km;
const recent = laps.slice(-6);
const slowest = Math.max(...recent);
const fastest = Math.min(...recent);
return (
<div
className="gu-run"
data-running={running}
style={{ "--hold": `${holdSeconds}s` } as CSSProperties}
>
{/* Map */}
<div className="gu-run__map" aria-hidden="true">
<svg viewBox="0 0 390 440" preserveAspectRatio="xMidYMid slice">
<defs>
<linearGradient id={grad} x1="0" y1="1" x2="1" y2="0">
<stop offset="0" stopColor="#ff5a1f" />
<stop offset="1" stopColor="#d7ff3a" />
</linearGradient>
</defs>
<path
className="gu-run__park"
d="M230 200 q40 -30 80 0 q20 40 -10 60 q-50 20 -70 -20 Z"
/>
<path
className="gu-run__park"
d="M20 120 q50 -20 90 10 q10 40 -40 50 q-50 0 -50 -60 Z"
/>
<path
className="gu-run__river"
d="M-10 230 C 60 210, 120 260, 200 240 S 330 200, 400 230"
/>
{Array.from({ length: 13 }, (_, i) => (
<path
key={`h${i}`}
className="gu-run__street"
d={`M-20 ${i * 36 + 6} L410 ${i * 36 - 30}`}
/>
))}
{Array.from({ length: 10 }, (_, i) => (
<path
key={`v${i}`}
className="gu-run__street"
d={`M${i * 44 - 10} -20 L${i * 44 + 26} 460`}
/>
))}
<path className="gu-run__ghost" d={ROUTE} />
<path
ref={route}
className="gu-run__route"
d={ROUTE}
stroke={`url(#${grad})`}
/>
<g ref={runner}>
<circle className="gu-run__pulse" r="16" />
<circle r="8" className="gu-run__me" />
</g>
</svg>
<div className="gu-run__shade" />
</div>
<header className="gu-run__top">
<span className="gu-run__chip">
<span className="gu-run__live" />
{running ? "Live" : "Paused"}
</span>
<span className="gu-run__chip">Riverside loop · {routeKm} km</span>
</header>
{/* Stats sheet */}
<section className="gu-run__sheet" aria-label="Run stats">
<p className="gu-run__label">Distance</p>
<p className="gu-run__km">
{km.toFixed(2)}
<span>km</span>
</p>
<dl className="gu-run__stats">
<div>
<dt>Pace</dt>
<dd>{pace(avg)}</dd>
</div>
<div>
<dt>Time</dt>
<dd>{clock(secs)}</dd>
</div>
<div>
<dt>Heart</dt>
<dd>
<span className="gu-run__heart" aria-hidden="true">
♥
</span>
{bpm}
</dd>
</div>
</dl>
<div className="gu-run__splits" aria-label="Recent laps">
{recent.map((s, i) => (
<span
key={i}
className="gu-run__split"
data-best={s === fastest}
style={
{
"--h":
0.35 +
0.65 * ((slowest - s) / Math.max(1, slowest - fastest)),
} as CSSProperties
}
title={`Lap ${laps.length - recent.length + i + 1}: ${pace(s)} per km`}
>
<span className="gu-run__split-bar" />
<span className="gu-run__split-label">{pace(s)}</span>
</span>
))}
</div>
<div className="gu-run__controls">
<button
type="button"
className="gu-run__small"
onClick={lap}
disabled={!running}
>
Lap
</button>
<button
type="button"
className="gu-run__main"
aria-label={running ? "Pause run" : "Resume run"}
onClick={() => setRunning((r) => !r)}
>
{running ? (
<svg viewBox="0 0 24 24">
<path d="M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" />
</svg>
) : (
<svg viewBox="0 0 24 24">
<path d="M8 5.5v13l11-6.5-11-6.5Z" />
</svg>
)}
</button>
<button
type="button"
className="gu-run__finish"
data-holding={holding}
aria-label={`Finish run: press and hold for ${holdSeconds} seconds`}
onPointerDown={startHold}
onPointerUp={endHold}
onPointerLeave={endHold}
onPointerCancel={endHold}
onKeyDown={(e) =>
(e.key === " " || e.key === "Enter") && !e.repeat && startHold()
}
onKeyUp={endHold}
onContextMenu={(e) => e.preventDefault()}
>
<svg
className="gu-run__ring"
viewBox="0 0 56 56"
aria-hidden="true"
>
<circle cx="28" cy="28" r="25" />
</svg>
<span className="gu-run__stop" aria-hidden="true" />
</button>
</div>
<p className="gu-run__hint" aria-live="polite">
{holding ? "Keep holding…" : "Hold the square to finish"}
</p>
</section>
{/* Summary */}
<div
className="gu-run__done"
hidden={!done}
role="dialog"
aria-modal="true"
aria-label="Run finished"
>
<p className="gu-run__label">Run complete</p>
<p className="gu-run__done-title">Nice run.</p>
<dl className="gu-run__stats gu-run__stats--big">
<div>
<dt>Distance</dt>
<dd>{km.toFixed(2)} km</dd>
</div>
<div>
<dt>Time</dt>
<dd>{clock(secs)}</dd>
</div>
<div>
<dt>Avg pace</dt>
<dd>{pace(avg)}</dd>
</div>
</dl>
<button
type="button"
className="gu-run__save"
autoFocus={done}
onClick={() => setDone(false)}
>
Save run
</button>
</div>
</div>
);
}
```
### run-tracker.css
```css
/* RunTracker: a night map, an ink sheet, lime for "go" and orange for effort. */
.gu-run {
--bg: #0b0c0e;
--sheet: #141518;
--text: #f4f3ee;
--muted: #8f9094;
--line: rgb(255 255 255 / 0.08);
--go: #d7ff3a;
--effort: #ff5a1f;
--focus: #d7ff3a;
--ease: cubic-bezier(0.16, 1, 0.3, 1);
position: relative;
display: flex;
flex-direction: column;
height: 100%;
min-height: 640px;
overflow: hidden;
background: var(--bg);
color: var(--text);
font-family: -apple-system, "SF Pro Text", system-ui, sans-serif;
-webkit-font-smoothing: antialiased;
}
.gu-run button {
font: inherit;
color: inherit;
border: 0;
background: none;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
.gu-run :focus-visible {
outline: 2px solid var(--focus);
outline-offset: 3px;
}
/* Map */
.gu-run__map {
position: absolute;
inset: 0 0 auto;
height: 54%;
}
.gu-run__map > svg {
width: 100%;
height: 100%;
display: block;
}
.gu-run__street {
stroke: rgb(255 255 255 / 0.07);
stroke-width: 1.5;
fill: none;
}
.gu-run__park {
fill: rgb(80 140 90 / 0.16);
}
.gu-run__river {
fill: none;
stroke: rgb(70 120 255 / 0.25);
stroke-width: 18;
stroke-linecap: round;
}
.gu-run__ghost {
fill: none;
stroke: rgb(255 255 255 / 0.16);
stroke-width: 4;
stroke-dasharray: 2 8;
stroke-linecap: round;
}
.gu-run__route {
fill: none;
stroke-width: 6;
stroke-linecap: round;
stroke-linejoin: round;
filter: drop-shadow(0 0 6px rgb(215 255 58 / 0.45));
transition: stroke-dashoffset 1s linear;
}
.gu-run__me {
fill: var(--go);
stroke: var(--bg);
stroke-width: 3;
}
.gu-run__pulse {
fill: rgb(215 255 58 / 0.35);
transform-box: fill-box;
transform-origin: center;
animation: gu-run-pulse 1.6s ease-out infinite;
}
.gu-run[data-running="false"] .gu-run__pulse {
animation: none;
opacity: 0;
}
@keyframes gu-run-pulse {
from {
scale: 0.4;
opacity: 1;
}
to {
scale: 1.6;
opacity: 0;
}
}
.gu-run__shade {
position: absolute;
inset: 0;
background: linear-gradient(
rgb(11 12 14 / 0.7),
transparent 22%,
transparent 70%,
var(--bg)
);
pointer-events: none;
}
.gu-run__top {
position: relative;
display: flex;
justify-content: space-between;
gap: 8px;
padding: calc(var(--gu-safe-top, env(safe-area-inset-top, 0px)) + 8px) 18px 0;
}
.gu-run__chip {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-radius: 999px;
background: rgb(20 21 24 / 0.6);
-webkit-backdrop-filter: blur(14px);
backdrop-filter: blur(14px);
box-shadow: inset 0 0 0 1px var(--line);
font-size: 13px;
font-weight: 600;
}
.gu-run__live {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--effort);
}
.gu-run[data-running="false"] .gu-run__live {
background: var(--muted);
}
/* Sheet */
.gu-run__sheet {
position: relative;
margin-top: auto;
padding: 24px 22px
calc(var(--gu-safe-bottom, env(safe-area-inset-bottom, 0px)) + 8px);
border-radius: 34px 34px 0 0;
background: var(--sheet);
box-shadow:
0 -20px 40px rgb(0 0 0 / 0.4),
inset 0 1px 0 var(--line);
}
.gu-run__label {
margin: 0;
font-size: 13px;
font-weight: 600;
color: var(--muted);
}
.gu-run__km {
margin: 2px 0 0;
font-size: 76px;
font-weight: 800;
letter-spacing: -0.05em;
line-height: 0.95;
font-variant-numeric: tabular-nums;
}
.gu-run__km span {
margin-left: 6px;
font-size: 22px;
font-weight: 700;
letter-spacing: 0;
color: var(--muted);
}
.gu-run__stats {
display: grid;
grid-template-columns: repeat(3, 1fr);
margin: 18px 0 0;
padding: 16px 0;
border-block: 1px solid var(--line);
}
.gu-run__stats div + div {
padding-left: 14px;
border-left: 1px solid var(--line);
}
.gu-run__stats dt {
font-size: 12px;
color: var(--muted);
}
.gu-run__stats dd {
margin: 4px 0 0;
font-size: 22px;
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.gu-run__heart {
display: inline-block;
margin-right: 5px;
color: var(--effort);
font-size: 16px;
animation: gu-run-beat 0.8s ease-in-out infinite;
}
@keyframes gu-run-beat {
15% {
scale: 1.3;
}
30% {
scale: 1;
}
}
/* Lap bars: taller is faster, the best lap in lime. */
.gu-run__splits {
display: flex;
align-items: flex-end;
gap: 8px;
height: 74px;
margin-top: 16px;
}
.gu-run__split {
display: grid;
flex: 1;
height: 100%;
grid-template-rows: 1fr auto;
gap: 5px;
}
.gu-run__split-bar {
align-self: end;
height: calc(var(--h) * 100%);
border-radius: 6px;
background: rgb(255 255 255 / 0.14);
transition: height 0.6s var(--ease);
animation: gu-run-grow 0.7s var(--ease) both;
}
.gu-run__split[data-best="true"] .gu-run__split-bar {
background: var(--go);
}
@keyframes gu-run-grow {
from {
height: 0;
}
}
.gu-run__split-label {
font-size: 10px;
text-align: center;
color: var(--muted);
font-variant-numeric: tabular-nums;
}
.gu-run__controls {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 18px;
}
.gu-run__small {
width: 64px;
height: 64px;
border-radius: 50%;
background: rgb(255 255 255 / 0.08) !important;
font-size: 15px !important;
font-weight: 700 !important;
}
.gu-run__small:disabled {
opacity: 0.4;
}
.gu-run__main {
display: grid;
place-items: center;
width: 86px;
height: 86px;
border-radius: 50%;
background: var(--go) !important;
color: #0b0c0e !important;
box-shadow: 0 0 0 8px rgb(215 255 58 / 0.12);
transition: scale 0.25s var(--ease);
}
.gu-run__main:active {
scale: 0.93;
}
.gu-run__main svg {
width: 34px;
height: 34px;
fill: currentColor;
}
/* Hold to finish: the ring fills while held. */
.gu-run__finish {
position: relative;
display: grid;
place-items: center;
width: 64px;
height: 64px;
border-radius: 50%;
background: rgb(255 90 31 / 0.14) !important;
touch-action: none;
-webkit-user-select: none;
user-select: none;
}
.gu-run__ring {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
rotate: -90deg;
}
.gu-run__ring circle {
fill: none;
stroke: var(--effort);
stroke-width: 3;
stroke-linecap: round;
stroke-dasharray: 158;
stroke-dashoffset: 158;
transition: stroke-dashoffset 0.25s ease;
}
.gu-run__finish[data-holding="true"] .gu-run__ring circle {
stroke-dashoffset: 0;
transition: stroke-dashoffset var(--hold) linear;
}
.gu-run__stop {
width: 20px;
height: 20px;
border-radius: 5px;
background: var(--effort);
transition: scale 0.3s var(--ease);
}
.gu-run__finish[data-holding="true"] .gu-run__stop {
scale: 0.8;
}
.gu-run__hint {
margin: 10px 0 0;
text-align: right;
font-size: 11px;
color: var(--muted);
}
/* Summary */
.gu-run__done {
position: absolute;
inset: auto 0 0;
z-index: 30;
padding: 30px 22px
calc(var(--gu-safe-bottom, env(safe-area-inset-bottom, 0px)) + 18px);
border-radius: 34px 34px 0 0;
background: var(--go);
color: #0b0c0e;
animation: gu-run-up 0.6s var(--ease);
}
.gu-run__done[hidden] {
display: none;
}
@keyframes gu-run-up {
from {
translate: 0 100%;
}
}
.gu-run__done .gu-run__label,
.gu-run__done dt {
color: rgb(11 12 14 / 0.6);
}
.gu-run__done-title {
margin: 4px 0 0;
font-size: 48px;
font-weight: 800;
letter-spacing: -0.04em;
}
.gu-run__stats--big {
border-color: rgb(11 12 14 / 0.15);
}
.gu-run__stats--big div + div {
border-color: rgb(11 12 14 / 0.15);
}
.gu-run__save {
width: 100%;
min-height: 56px;
margin-top: 18px;
border-radius: 999px;
background: #0b0c0e !important;
color: var(--go) !important;
font-size: 17px !important;
font-weight: 700 !important;
}
@media (prefers-reduced-motion: reduce) {
.gu-run__route,
.gu-run__split-bar,
.gu-run__ring circle {
transition: none !important;
}
.gu-run__pulse,
.gu-run__heart,
.gu-run__split-bar,
.gu-run__done {
animation: none;
}
}
```
You might also want
Next piece: Skincare page with a drop-by-drop routineCook mode app
Apps, intermediate
Plant care app
Apps, intermediate
Boarding pass app
Apps, intermediate