Boarding pass app
A trip wallet: swipe between flight passes, watch the plane glide along its route, count down to boarding and tap the code to show it big for the gate scanner.
"use client";
import { useEffect, useRef, useState } from "react";
import "./boarding-pass.css";
export type Flight = {
from: { code: string; city: string; time: string };
to: { code: string; city: string; time: string };
date: string;
duration: string;
flight: string;
gate: string;
seat: string;
group: string;
boarding: string;
};
type BoardingPassProps = {
passenger: string;
flights: Flight[];
/** Minutes until boarding opens for the first flight. */
boardsIn?: number;
};
const STEPS = ["Checked in", "Bag drop", "Security", "Gate", "Board"];
/** A scannable-looking code, drawn from the flight number so it never changes. */
function Code({ seed }: { seed: string }) {
const n = 25;
let h = 0;
for (const ch of seed) h = (h * 31 + ch.charCodeAt(0)) >>> 0;
const rand = () => (h = (h * 1664525 + 1013904223) >>> 0) / 2 ** 32;
const finder = (x: number, y: number) =>
(x < 7 && y < 7) || (x >= n - 7 && y < 7) || (x < 7 && y >= n - 7);
const cells: [number, number][] = [];
for (let y = 0; y < n; y++)
for (let x = 0; x < n; x++)
if (!finder(x, y) && rand() > 0.52) cells.push([x, y]);
const eye = (x: number, y: number) => (
<g key={`${x}-${y}`}>
<rect x={x} y={y} width="7" height="7" rx="1.6" fill="currentColor" />
<rect x={x + 1} y={y + 1} width="5" height="5" rx="1.1" fill="#fff" />
<rect
x={x + 2}
y={y + 2}
width="3"
height="3"
rx="0.8"
fill="currentColor"
/>
</g>
);
return (
<svg viewBox={`-1 -1 ${n + 2} ${n + 2}`} aria-hidden="true">
{cells.map(([x, y]) => (
<rect
key={`${x}.${y}`}
x={x + 0.08}
y={y + 0.08}
width=".84"
height=".84"
rx=".25"
fill="currentColor"
/>
))}
{eye(0, 0)}
{eye(n - 7, 0)}
{eye(0, n - 7)}
</svg>
);
}
const clock = (s: number) =>
`${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, "0")}`;
/**
* BoardingPass: a phone wallet screen for a trip.
* - Swipe between the outbound and return passes (snap scrolling, plus dots).
* - A little plane sits on the route line, the boarding countdown ticks live.
* - Tap the code to show it big on a white screen for the gate scanner.
*/
export function BoardingPass({
passenger,
flights,
boardsIn = 24,
}: BoardingPassProps) {
const [active, setActive] = useState(0);
const [scan, setScan] = useState(false);
const [left, setLeft] = useState(boardsIn * 60 - 19);
const track = useRef<HTMLDivElement>(null);
useEffect(() => {
const id = window.setInterval(
() => setLeft((s) => Math.max(0, s - 1)),
1000,
);
return () => window.clearInterval(id);
}, []);
// Which pass is in view: the scroll position, rounded to the nearest card.
const onScroll = () => {
const el = track.current;
if (!el) return;
setActive(Math.round(el.scrollLeft / el.clientWidth));
};
const goTo = (i: number) => {
const el = track.current;
setActive(i);
el?.scrollTo({ left: i * el.clientWidth, behavior: "smooth" });
};
const f = flights[active] ?? flights[0];
const stepNow = active === 0 ? 2 : 0;
return (
<div className="gu-pass" data-scan={scan}>
<header className="gu-pass__top">
<button type="button" className="gu-pass__icon" aria-label="Back">
<svg viewBox="0 0 24 24">
<path d="m15 6-6 6 6 6" />
</svg>
</button>
<p className="gu-pass__heading">Your trip</p>
<button type="button" className="gu-pass__icon" aria-label="Share pass">
<svg viewBox="0 0 24 24">
<path d="M12 15V4M8 8l4-4 4 4M5 12v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6" />
</svg>
</button>
</header>
<p className="gu-pass__status" aria-live="polite">
<span className="gu-pass__dot" aria-hidden="true" />
{active === 0 ? (
<>
Boarding in <strong>{clock(left)}</strong>
</>
) : (
<>Checked in for {f.date}</>
)}
</p>
<div
ref={track}
className="gu-pass__track"
onScroll={onScroll}
role="region"
aria-roledescription="carousel"
aria-label="Boarding passes"
>
{flights.map((fl, i) => (
<article
key={fl.flight}
className="gu-pass__card"
aria-roledescription="slide"
aria-label={`${i + 1} of ${flights.length}: ${fl.from.city} to ${fl.to.city}`}
aria-hidden={i !== active}
>
<div className="gu-pass__head">
<div className="gu-pass__route">
<div>
<span className="gu-pass__code">{fl.from.code}</span>
<span className="gu-pass__city">{fl.from.city}</span>
</div>
<div className="gu-pass__line" aria-hidden="true">
<svg viewBox="0 0 120 40" preserveAspectRatio="none">
<path d="M4 34 Q60 -8 116 34" />
</svg>
<span className="gu-pass__plane">
<svg viewBox="0 0 24 24">
<path d="M21 15.5v-2l-8-5V3.8a1.5 1.5 0 0 0-3 0v4.7l-8 5v2l8-2.5v5.2L8 19.5V21l3.5-1 3.5 1v-1.5l-2-1.3V13l8 2.5Z" />
</svg>
</span>
<span className="gu-pass__dur">{fl.duration}</span>
</div>
<div className="gu-pass__right">
<span className="gu-pass__code">{fl.to.code}</span>
<span className="gu-pass__city">{fl.to.city}</span>
</div>
</div>
<div className="gu-pass__times">
<span>{fl.from.time}</span>
<span>{fl.date}</span>
<span>{fl.to.time}</span>
</div>
</div>
<dl className="gu-pass__grid">
<div>
<dt>Passenger</dt>
<dd>{passenger}</dd>
</div>
<div>
<dt>Flight</dt>
<dd>{fl.flight}</dd>
</div>
<div>
<dt>Gate</dt>
<dd>{fl.gate}</dd>
</div>
<div>
<dt>Seat</dt>
<dd>{fl.seat}</dd>
</div>
<div>
<dt>Group</dt>
<dd>{fl.group}</dd>
</div>
<div>
<dt>Boards</dt>
<dd>{fl.boarding}</dd>
</div>
</dl>
<div className="gu-pass__tear" aria-hidden="true" />
<button
type="button"
className="gu-pass__qr"
onClick={() => setScan(true)}
aria-label={`Show the code for ${fl.flight} full screen for scanning`}
tabIndex={i === active ? 0 : -1}
>
<Code seed={fl.flight + passenger} />
<span>Tap to scan at the gate</span>
</button>
</article>
))}
</div>
<div className="gu-pass__dots" role="group" aria-label="Choose pass">
{flights.map((fl, i) => (
<button
key={fl.flight}
type="button"
aria-label={`${fl.from.code} to ${fl.to.code}`}
aria-pressed={i === active}
onClick={() => goTo(i)}
/>
))}
</div>
<ol className="gu-pass__steps" aria-label="Airport progress">
{STEPS.map((s, i) => (
<li
key={s}
data-state={i < stepNow ? "done" : i === stepNow ? "now" : "next"}
aria-current={i === stepNow ? "step" : undefined}
>
<span className="gu-pass__step-dot" aria-hidden="true" />
{s}
</li>
))}
</ol>
{/* Scan mode: the code alone, big, on white. */}
<div
className="gu-pass__scan"
hidden={!scan}
role="dialog"
aria-modal="true"
aria-label="Boarding pass code"
>
<p className="gu-pass__scan-route">
{f.from.code} → {f.to.code} · Seat {f.seat}
</p>
<div className="gu-pass__scan-code">
<Code seed={f.flight + passenger} />
</div>
<p className="gu-pass__scan-hint">
Screen brightness is up. Hold the phone flat over the scanner.
</p>
<button
type="button"
className="gu-pass__done"
onClick={() => setScan(false)}
autoFocus={scan}
>
Done
</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: Boarding pass 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 trip wallet screen for phones: swipeable boarding passes, a live countdown to boarding, a plane on the route line, an airport progress tracker, and a full-screen code for the gate scanner.
## Layout and look
- Fills its parent; stone background #ecebe6, white passes, ink #111113, muted #74726b, orange pass head #ff5a1f, green status #1f9d55. System font.
- Safe areas: top = safe-area-inset-top + 4px; bottom = safe-area-inset-bottom + 16px.
- Top bar: back and share icon buttons (44px), "Your trip" in the middle.
- Status pill: a pulsing green dot and "Boarding in 23:41" (tabular numbers), ticking every second.
- Passes: a horizontal scroll-snap row, each pass one full width minus 20px margins, radius 28px, soft long shadow.
- Pass head (orange with a soft white glow in the top right): 46px airport codes (weight 800, -0.04em) with city names, a 120×40 dashed arc between them with a plane icon that travels along the arc (CSS offset-path, offset-rotate auto 90deg) from 0% to 50% on load, and the flight duration under it. Departure time, date, arrival time underneath.
- Details: a 3-column grid of label (12px muted) and value (17px bold): passenger, flight, gate, seat, group, boards.
- Perforation: a dashed line with 26px half circles cut from both edges (circles in the background color).
- Stub: a 92px code drawn as SVG (three finder squares and a seeded pattern) and "Tap to scan at the gate".
- Dots under the passes (active one stretches to 20px), then an airport progress card: Checked in, Bag drop, Security, Gate, Board, connected by a line; done steps are ink, the current step is an orange dot with a soft ring.
## Behavior and motion
1. Scrolling the row snaps to a pass; the active pass is the scroll position divided by the width, rounded. Dots scroll to a pass smoothly.
2. The countdown ticks every second and stops at 0:00.
3. Tapping the code opens scan mode: a white full-screen layer with the route, the code at 260px and a brightness hint; Done closes it.
## Accessibility
- The row is a labelled carousel; each pass is a slide labelled "1 of 2: Amsterdam to Lisbon", off-screen passes are aria-hidden.
- The status line is aria-live; steps use aria-current="step".
- Scan mode is role="dialog" aria-modal with the Done button focused.
- prefers-reduced-motion: no plane flight, no pulse, no zoom.
## Props
passenger: string, flights: { from, to: { code, city, time }, date, duration, flight, gate, seat, group, boarding }[], boardsIn?: number (minutes)
## 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.
### BoardingPass.tsx
```tsx
"use client";
import { useEffect, useRef, useState } from "react";
import "./boarding-pass.css";
export type Flight = {
from: { code: string; city: string; time: string };
to: { code: string; city: string; time: string };
date: string;
duration: string;
flight: string;
gate: string;
seat: string;
group: string;
boarding: string;
};
type BoardingPassProps = {
passenger: string;
flights: Flight[];
/** Minutes until boarding opens for the first flight. */
boardsIn?: number;
};
const STEPS = ["Checked in", "Bag drop", "Security", "Gate", "Board"];
/** A scannable-looking code, drawn from the flight number so it never changes. */
function Code({ seed }: { seed: string }) {
const n = 25;
let h = 0;
for (const ch of seed) h = (h * 31 + ch.charCodeAt(0)) >>> 0;
const rand = () => (h = (h * 1664525 + 1013904223) >>> 0) / 2 ** 32;
const finder = (x: number, y: number) =>
(x < 7 && y < 7) || (x >= n - 7 && y < 7) || (x < 7 && y >= n - 7);
const cells: [number, number][] = [];
for (let y = 0; y < n; y++)
for (let x = 0; x < n; x++)
if (!finder(x, y) && rand() > 0.52) cells.push([x, y]);
const eye = (x: number, y: number) => (
<g key={`${x}-${y}`}>
<rect x={x} y={y} width="7" height="7" rx="1.6" fill="currentColor" />
<rect x={x + 1} y={y + 1} width="5" height="5" rx="1.1" fill="#fff" />
<rect
x={x + 2}
y={y + 2}
width="3"
height="3"
rx="0.8"
fill="currentColor"
/>
</g>
);
return (
<svg viewBox={`-1 -1 ${n + 2} ${n + 2}`} aria-hidden="true">
{cells.map(([x, y]) => (
<rect
key={`${x}.${y}`}
x={x + 0.08}
y={y + 0.08}
width=".84"
height=".84"
rx=".25"
fill="currentColor"
/>
))}
{eye(0, 0)}
{eye(n - 7, 0)}
{eye(0, n - 7)}
</svg>
);
}
const clock = (s: number) =>
`${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, "0")}`;
/**
* BoardingPass: a phone wallet screen for a trip.
* - Swipe between the outbound and return passes (snap scrolling, plus dots).
* - A little plane sits on the route line, the boarding countdown ticks live.
* - Tap the code to show it big on a white screen for the gate scanner.
*/
export function BoardingPass({
passenger,
flights,
boardsIn = 24,
}: BoardingPassProps) {
const [active, setActive] = useState(0);
const [scan, setScan] = useState(false);
const [left, setLeft] = useState(boardsIn * 60 - 19);
const track = useRef<HTMLDivElement>(null);
useEffect(() => {
const id = window.setInterval(
() => setLeft((s) => Math.max(0, s - 1)),
1000,
);
return () => window.clearInterval(id);
}, []);
// Which pass is in view: the scroll position, rounded to the nearest card.
const onScroll = () => {
const el = track.current;
if (!el) return;
setActive(Math.round(el.scrollLeft / el.clientWidth));
};
const goTo = (i: number) => {
const el = track.current;
setActive(i);
el?.scrollTo({ left: i * el.clientWidth, behavior: "smooth" });
};
const f = flights[active] ?? flights[0];
const stepNow = active === 0 ? 2 : 0;
return (
<div className="gu-pass" data-scan={scan}>
<header className="gu-pass__top">
<button type="button" className="gu-pass__icon" aria-label="Back">
<svg viewBox="0 0 24 24">
<path d="m15 6-6 6 6 6" />
</svg>
</button>
<p className="gu-pass__heading">Your trip</p>
<button type="button" className="gu-pass__icon" aria-label="Share pass">
<svg viewBox="0 0 24 24">
<path d="M12 15V4M8 8l4-4 4 4M5 12v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6" />
</svg>
</button>
</header>
<p className="gu-pass__status" aria-live="polite">
<span className="gu-pass__dot" aria-hidden="true" />
{active === 0 ? (
<>
Boarding in <strong>{clock(left)}</strong>
</>
) : (
<>Checked in for {f.date}</>
)}
</p>
<div
ref={track}
className="gu-pass__track"
onScroll={onScroll}
role="region"
aria-roledescription="carousel"
aria-label="Boarding passes"
>
{flights.map((fl, i) => (
<article
key={fl.flight}
className="gu-pass__card"
aria-roledescription="slide"
aria-label={`${i + 1} of ${flights.length}: ${fl.from.city} to ${fl.to.city}`}
aria-hidden={i !== active}
>
<div className="gu-pass__head">
<div className="gu-pass__route">
<div>
<span className="gu-pass__code">{fl.from.code}</span>
<span className="gu-pass__city">{fl.from.city}</span>
</div>
<div className="gu-pass__line" aria-hidden="true">
<svg viewBox="0 0 120 40" preserveAspectRatio="none">
<path d="M4 34 Q60 -8 116 34" />
</svg>
<span className="gu-pass__plane">
<svg viewBox="0 0 24 24">
<path d="M21 15.5v-2l-8-5V3.8a1.5 1.5 0 0 0-3 0v4.7l-8 5v2l8-2.5v5.2L8 19.5V21l3.5-1 3.5 1v-1.5l-2-1.3V13l8 2.5Z" />
</svg>
</span>
<span className="gu-pass__dur">{fl.duration}</span>
</div>
<div className="gu-pass__right">
<span className="gu-pass__code">{fl.to.code}</span>
<span className="gu-pass__city">{fl.to.city}</span>
</div>
</div>
<div className="gu-pass__times">
<span>{fl.from.time}</span>
<span>{fl.date}</span>
<span>{fl.to.time}</span>
</div>
</div>
<dl className="gu-pass__grid">
<div>
<dt>Passenger</dt>
<dd>{passenger}</dd>
</div>
<div>
<dt>Flight</dt>
<dd>{fl.flight}</dd>
</div>
<div>
<dt>Gate</dt>
<dd>{fl.gate}</dd>
</div>
<div>
<dt>Seat</dt>
<dd>{fl.seat}</dd>
</div>
<div>
<dt>Group</dt>
<dd>{fl.group}</dd>
</div>
<div>
<dt>Boards</dt>
<dd>{fl.boarding}</dd>
</div>
</dl>
<div className="gu-pass__tear" aria-hidden="true" />
<button
type="button"
className="gu-pass__qr"
onClick={() => setScan(true)}
aria-label={`Show the code for ${fl.flight} full screen for scanning`}
tabIndex={i === active ? 0 : -1}
>
<Code seed={fl.flight + passenger} />
<span>Tap to scan at the gate</span>
</button>
</article>
))}
</div>
<div className="gu-pass__dots" role="group" aria-label="Choose pass">
{flights.map((fl, i) => (
<button
key={fl.flight}
type="button"
aria-label={`${fl.from.code} to ${fl.to.code}`}
aria-pressed={i === active}
onClick={() => goTo(i)}
/>
))}
</div>
<ol className="gu-pass__steps" aria-label="Airport progress">
{STEPS.map((s, i) => (
<li
key={s}
data-state={i < stepNow ? "done" : i === stepNow ? "now" : "next"}
aria-current={i === stepNow ? "step" : undefined}
>
<span className="gu-pass__step-dot" aria-hidden="true" />
{s}
</li>
))}
</ol>
{/* Scan mode: the code alone, big, on white. */}
<div
className="gu-pass__scan"
hidden={!scan}
role="dialog"
aria-modal="true"
aria-label="Boarding pass code"
>
<p className="gu-pass__scan-route">
{f.from.code} → {f.to.code} · Seat {f.seat}
</p>
<div className="gu-pass__scan-code">
<Code seed={f.flight + passenger} />
</div>
<p className="gu-pass__scan-hint">
Screen brightness is up. Hold the phone flat over the scanner.
</p>
<button
type="button"
className="gu-pass__done"
onClick={() => setScan(false)}
autoFocus={scan}
>
Done
</button>
</div>
</div>
);
}
```
### boarding-pass.css
```css
/* BoardingPass: stone background, white passes with an orange head, ink text. */
.gu-pass {
--bg: #ecebe6;
--card: #fff;
--ink: #111113;
--muted: #74726b;
--head: #ff5a1f;
--line: rgb(17 17 19 / 0.1);
--ok: #1f9d55;
--focus: #2b35ff;
--ease: cubic-bezier(0.16, 1, 0.3, 1);
position: relative;
display: flex;
flex-direction: column;
height: 100%;
min-height: 640px;
overflow: hidden;
padding: calc(var(--gu-safe-top, env(safe-area-inset-top, 0px)) + 4px) 0
calc(var(--gu-safe-bottom, env(safe-area-inset-bottom, 0px)) + 16px);
background: var(--bg);
color: var(--ink);
font-family: -apple-system, "SF Pro Text", system-ui, sans-serif;
-webkit-font-smoothing: antialiased;
}
.gu-pass button {
font: inherit;
color: inherit;
border: 0;
background: none;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
.gu-pass :focus-visible {
outline: 2px solid var(--focus);
outline-offset: 2px;
}
.gu-pass svg {
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
.gu-pass__top {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 12px;
}
.gu-pass__icon {
display: grid;
place-items: center;
width: 44px;
height: 44px;
border-radius: 50%;
}
.gu-pass__icon svg {
width: 22px;
height: 22px;
}
.gu-pass__heading {
margin: 0;
font-size: 17px;
font-weight: 650;
}
.gu-pass__status {
display: flex;
align-items: center;
gap: 8px;
width: fit-content;
margin: 8px auto 16px;
padding: 8px 14px;
border-radius: 999px;
background: var(--card);
font-size: 14px;
box-shadow: 0 1px 0 var(--line);
}
.gu-pass__status strong {
font-variant-numeric: tabular-nums;
}
.gu-pass__dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--ok);
box-shadow: 0 0 0 0 rgb(31 157 85 / 0.5);
animation: gu-pass-ping 1.8s infinite;
}
@keyframes gu-pass-ping {
70% {
box-shadow: 0 0 0 7px rgb(31 157 85 / 0);
}
}
/* Swipeable passes: each slide is exactly one track width. */
.gu-pass__track {
display: flex;
overflow-x: auto;
scroll-snap-type: x mandatory;
scrollbar-width: none;
overscroll-behavior-x: contain;
}
.gu-pass__card {
position: relative;
flex: 0 0 calc(100% - 40px);
margin: 0 20px;
scroll-snap-align: center;
overflow: hidden;
border-radius: 28px;
background: var(--card);
box-shadow: 0 30px 50px -30px rgb(17 17 19 / 0.45);
}
.gu-pass__head {
padding: 22px 22px 18px;
background:
radial-gradient(
120% 90% at 100% 0%,
rgb(255 255 255 / 0.22),
transparent 60%
),
var(--head);
color: var(--ink);
}
.gu-pass__route {
display: flex;
align-items: center;
justify-content: space-between;
gap: 6px;
}
.gu-pass__route > div:not(.gu-pass__line) {
display: grid;
}
.gu-pass__right {
text-align: right;
}
.gu-pass__code {
font-size: 46px;
font-weight: 800;
letter-spacing: -0.04em;
line-height: 1;
}
.gu-pass__city {
margin-top: 4px;
font-size: 13px;
font-weight: 600;
opacity: 0.75;
}
.gu-pass__line {
position: relative;
width: 120px;
height: 40px;
flex-shrink: 0;
}
.gu-pass__line > svg {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
stroke-width: 1.5;
stroke-dasharray: 3 4;
opacity: 0.7;
}
.gu-pass__plane {
position: absolute;
left: 0;
top: 0;
width: 22px;
height: 22px;
offset-path: path("M4 34 Q60 -8 116 34");
offset-rotate: auto 90deg;
offset-distance: 50%;
animation: gu-pass-fly 2.6s var(--ease) both;
}
.gu-pass__plane svg {
width: 22px;
height: 22px;
fill: currentColor;
stroke: none;
}
@keyframes gu-pass-fly {
from {
offset-distance: 0%;
}
}
.gu-pass__dur {
position: absolute;
inset: auto 0 -6px;
text-align: center;
font-size: 11px;
font-weight: 700;
opacity: 0.75;
}
.gu-pass__times {
display: flex;
justify-content: space-between;
margin-top: 14px;
font-size: 15px;
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.gu-pass__times span:nth-child(2) {
font-weight: 600;
opacity: 0.75;
}
.gu-pass__grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 14px 10px;
margin: 0;
padding: 20px 22px 18px;
}
.gu-pass__grid dt {
font-size: 12px;
color: var(--muted);
}
.gu-pass__grid dd {
margin: 3px 0 0;
font-size: 17px;
font-weight: 700;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* The perforation: a dashed line with half circles bitten out of each edge. */
.gu-pass__tear {
position: relative;
height: 1px;
margin: 0 22px;
background: repeating-linear-gradient(
90deg,
var(--line) 0 6px,
transparent 6px 11px
);
}
.gu-pass__tear::before,
.gu-pass__tear::after {
content: "";
position: absolute;
top: -13px;
width: 26px;
height: 26px;
border-radius: 50%;
background: var(--bg);
}
.gu-pass__tear::before {
left: -35px;
}
.gu-pass__tear::after {
right: -35px;
}
.gu-pass__qr {
display: flex !important;
align-items: center;
gap: 16px;
width: 100%;
padding: 18px 22px 22px !important;
text-align: left;
font-size: 14px !important;
font-weight: 600;
color: var(--muted) !important;
}
.gu-pass__qr svg {
width: 92px;
height: 92px;
flex-shrink: 0;
color: var(--ink);
transition: scale 0.3s var(--ease);
}
.gu-pass__qr:active svg {
scale: 0.95;
}
.gu-pass__dots {
display: flex;
justify-content: center;
gap: 4px;
margin-top: 12px;
}
.gu-pass__dots button {
display: grid;
place-items: center;
width: 28px;
height: 28px;
}
.gu-pass__dots button::after {
content: "";
width: 7px;
height: 7px;
border-radius: 4px;
background: rgb(17 17 19 / 0.22);
transition:
width 0.4s var(--ease),
background-color 0.3s;
}
.gu-pass__dots button[aria-pressed="true"]::after {
width: 20px;
background: var(--ink);
}
/* Airport steps: done, now, next. */
.gu-pass__steps {
display: flex;
justify-content: space-between;
margin: auto 20px 0;
padding: 16px 14px;
list-style: none;
border-radius: 22px;
background: var(--card);
box-shadow: 0 1px 0 var(--line);
}
.gu-pass__steps li {
position: relative;
display: grid;
justify-items: center;
gap: 8px;
flex: 1;
font-size: 11px;
font-weight: 600;
color: var(--muted);
}
.gu-pass__steps li + li::before {
content: "";
position: absolute;
top: 5px;
right: 50%;
width: 100%;
height: 2px;
background: var(--line);
}
.gu-pass__steps li[data-state="done"]::before,
.gu-pass__steps li[data-state="now"]::before {
background: var(--ink);
}
.gu-pass__step-dot {
position: relative;
z-index: 1;
width: 12px;
height: 12px;
border-radius: 50%;
background: var(--card);
box-shadow: inset 0 0 0 2px rgb(17 17 19 / 0.25);
}
.gu-pass__steps li[data-state="done"] {
color: var(--ink);
}
.gu-pass__steps li[data-state="done"] .gu-pass__step-dot {
background: var(--ink);
box-shadow: none;
}
.gu-pass__steps li[data-state="now"] {
color: var(--ink);
font-weight: 800;
}
.gu-pass__steps li[data-state="now"] .gu-pass__step-dot {
background: var(--head);
box-shadow: 0 0 0 4px rgb(255 90 31 / 0.25);
}
/* Scan mode */
.gu-pass__scan {
position: absolute;
inset: 0;
z-index: 40;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 22px;
padding: 80px 34px 60px;
background: #fff;
text-align: center;
animation: gu-pass-scan 0.45s var(--ease);
}
.gu-pass__scan[hidden] {
display: none;
}
@keyframes gu-pass-scan {
from {
opacity: 0;
scale: 1.04;
}
}
.gu-pass__scan-route {
margin: 0;
font-size: 20px;
font-weight: 800;
}
.gu-pass__scan-code svg {
width: 260px;
height: 260px;
}
.gu-pass__scan-hint {
margin: 0;
max-width: 26ch;
font-size: 14px;
color: var(--muted);
}
.gu-pass__done {
min-height: 50px;
padding: 0 34px !important;
border-radius: 999px;
background: var(--ink) !important;
color: #fff !important;
font-weight: 700 !important;
}
@media (prefers-reduced-motion: reduce) {
.gu-pass__plane,
.gu-pass__dot,
.gu-pass__scan {
animation: none;
}
.gu-pass__track {
scroll-behavior: auto;
}
}
/* The codes are filled shapes: no icon outline on their tiny squares. */
.gu-pass__qr svg,
.gu-pass__scan-code svg {
stroke: none;
}
```
You might also want
Next piece: Boutique hotel page with a sun-path dayCook mode app
Apps, intermediate
Music player
Apps, advanced
Plant care app
Apps, intermediate