Gym — Digital Membership Card
A tappable digital gym membership card that flips in 3D to reveal a door check-in code. The front shows the IRONPULSE brand, member name, tier, member ID, join date and a live Active status pill, while the back renders a canvas-drawn QR matrix and barcode for scanning at the gate. A pulsing show-at-front-desk mode and a one-tap brightness boost maximize contrast for readers, and quick chips switch the membership tier and regenerate the codes live.
MCP
Código
:root {
--bg: #0d0f12;
--surface: #15181d;
--surface-2: #1d2127;
--elevated: #23282f;
--ink: #f4f6f8;
--ink-2: #c2c8d0;
--muted: #8b929c;
--neon: #c6ff3a;
--neon-d: #a6e016;
--neon-50: rgba(198, 255, 58, 0.12);
--orange: #ff6a2b;
--orange-soft: rgba(255, 106, 43, 0.14);
--line: rgba(255, 255, 255, 0.08);
--line-2: rgba(255, 255, 255, 0.16);
--ok: #34d399;
--warn: #fbbf24;
--danger: #f87171;
--r-sm: 8px;
--r-md: 14px;
--r-lg: 20px;
--shadow-1: 0 2px 8px rgba(0, 0, 0, 0.4);
--shadow-2: 0 18px 50px rgba(0, 0, 0, 0.55);
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
background:
radial-gradient(900px 600px at 80% -10%, rgba(198, 255, 58, 0.08), transparent 60%),
radial-gradient(800px 500px at 0% 110%, rgba(255, 106, 43, 0.08), transparent 55%),
var(--bg);
color: var(--ink);
font-family: "Inter", system-ui, -apple-system, sans-serif;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
.wrap {
max-width: 540px;
margin: 0 auto;
padding: 28px 20px 56px;
}
/* ---------- topbar ---------- */
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 26px;
}
.brandmark {
display: flex;
align-items: center;
gap: 9px;
}
.bolt,
.brand__bolt {
width: 16px;
height: 16px;
background: var(--neon);
clip-path: polygon(45% 0, 100% 0, 55% 45%, 100% 45%, 20% 100%, 45% 55%, 0 55%);
box-shadow: 0 0 14px var(--neon-50);
}
.brandmark__txt {
font-weight: 900;
letter-spacing: 0.14em;
font-size: 15px;
}
.eyebrow {
margin: 0;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.16em;
color: var(--muted);
}
/* ---------- stage ---------- */
.stage {
display: flex;
flex-direction: column;
align-items: center;
}
.card-scene {
width: 100%;
perspective: 1600px;
}
/* ---------- card ---------- */
.card {
position: relative;
display: block;
width: 100%;
aspect-ratio: 1.586 / 1;
border: none;
padding: 0;
margin: 0;
background: transparent;
cursor: pointer;
transform-style: preserve-3d;
transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
border-radius: var(--r-lg);
outline: none;
}
.card.is-flipped {
transform: rotateY(180deg);
}
.card:focus-visible {
box-shadow: 0 0 0 3px var(--neon), 0 0 0 6px rgba(198, 255, 58, 0.25);
}
.card__face {
position: absolute;
inset: 0;
border-radius: var(--r-lg);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
overflow: hidden;
border: 1px solid var(--line-2);
box-shadow: var(--shadow-2);
}
/* FRONT */
.card__front {
display: flex;
flex-direction: column;
padding: 22px 22px 20px;
background:
linear-gradient(135deg, var(--elevated) 0%, var(--surface-2) 55%, #0f1216 100%);
}
.card__front::before {
content: "";
position: absolute;
inset: 0;
background:
radial-gradient(420px 220px at 110% -20%, rgba(198, 255, 58, 0.16), transparent 60%),
radial-gradient(360px 200px at -10% 120%, rgba(255, 106, 43, 0.12), transparent 60%);
pointer-events: none;
}
.card__sheen {
position: absolute;
top: 0;
left: -60%;
width: 50%;
height: 100%;
background: linear-gradient(
100deg,
transparent,
rgba(255, 255, 255, 0.14),
transparent
);
transform: skewX(-18deg);
pointer-events: none;
}
.card.sheen-run .card__sheen {
animation: sheen 0.9s ease-out;
}
@keyframes sheen {
from { left: -60%; }
to { left: 130%; }
}
.card__top {
position: relative;
display: flex;
align-items: flex-start;
justify-content: space-between;
}
.brand {
display: flex;
align-items: center;
gap: 8px;
}
.brand__name {
font-weight: 900;
letter-spacing: 0.12em;
font-size: 15px;
}
.tier {
position: relative;
margin-top: auto;
display: flex;
flex-direction: column;
gap: 2px;
}
.tier__label {
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.18em;
color: var(--muted);
}
.tier__name {
font-size: clamp(22px, 6.4vw, 30px);
font-weight: 900;
letter-spacing: -0.01em;
line-height: 1.05;
background: linear-gradient(92deg, var(--ink), var(--neon));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.card__chip {
position: relative;
margin: 14px 0 16px;
width: 44px;
height: 32px;
border-radius: 7px;
background: linear-gradient(135deg, #d8c98e, #a9914f);
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2px;
padding: 5px;
}
.card__chip span {
border: 1px solid rgba(0, 0, 0, 0.25);
border-radius: 2px;
}
.card__chip span:first-child {
grid-column: 1 / -1;
}
.card__bottom {
position: relative;
}
.field {
display: flex;
flex-direction: column;
gap: 2px;
}
.field__k {
font-size: 9.5px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.16em;
color: var(--muted);
}
.field__v {
font-size: 16px;
font-weight: 700;
color: var(--ink);
}
.field--name .field__v {
font-size: 19px;
}
.meta-row {
display: flex;
justify-content: space-between;
margin-top: 12px;
gap: 16px;
}
.field--right {
text-align: right;
align-items: flex-end;
}
.mono {
font-variant-numeric: tabular-nums;
letter-spacing: 0.04em;
}
.flip-hint {
position: absolute;
right: 18px;
bottom: 14px;
font-size: 10.5px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--muted);
opacity: 0.85;
}
.card__front .flip-hint {
right: auto;
left: 22px;
bottom: 8px;
}
/* BACK */
.card__back {
transform: rotateY(180deg);
display: flex;
flex-direction: column;
align-items: center;
padding: 18px 18px 24px;
background: linear-gradient(160deg, #f6f8fa 0%, #e7ebef 100%);
color: #0d0f12;
}
.back__top {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.back__title {
font-size: 13px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.14em;
color: #1b1f25;
}
.qr-frame {
position: relative;
padding: 12px;
background: #fff;
border-radius: var(--r-md);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.qr-frame canvas {
display: block;
width: clamp(150px, 42vw, 200px);
height: clamp(150px, 42vw, 200px);
image-rendering: pixelated;
}
.qr-corner {
position: absolute;
width: 16px;
height: 16px;
border: 3px solid #0d0f12;
}
.qr-corner--tl { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.qr-corner--tr { top: 4px; right: 4px; border-left: none; border-bottom: none; }
.qr-corner--bl { bottom: 4px; left: 4px; border-right: none; border-top: none; }
.qr-corner--br { bottom: 4px; right: 4px; border-left: none; border-top: none; }
.barcode {
margin-top: 14px;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
}
.barcode canvas {
display: block;
width: clamp(220px, 70%, 300px);
height: 52px;
}
.barcode__id {
font-size: 12px;
font-weight: 700;
color: #2a2f36;
}
.card__back .flip-hint {
color: #4a525c;
opacity: 1;
}
/* ---------- pills ---------- */
.pill {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 5px 10px;
border-radius: 999px;
font-size: 11px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.08em;
white-space: nowrap;
}
.pill--ok {
background: rgba(52, 211, 153, 0.16);
color: var(--ok);
border: 1px solid rgba(52, 211, 153, 0.35);
}
.pill--ghost {
background: rgba(13, 15, 18, 0.06);
color: #3a414a;
border: 1px solid rgba(13, 15, 18, 0.12);
}
.dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--ok);
box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
animation: live 2s infinite;
}
@keyframes live {
0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
/* ---------- front-desk pulse ---------- */
.card.pulsing {
animation: deskpulse 1.1s ease-in-out infinite;
}
@keyframes deskpulse {
0%, 100% {
box-shadow: var(--shadow-2), 0 0 0 0 rgba(198, 255, 58, 0);
transform: scale(1);
}
50% {
box-shadow: var(--shadow-2), 0 0 38px 6px rgba(198, 255, 58, 0.45);
transform: scale(1.012);
}
}
.card.is-flipped.pulsing {
animation: deskpulse-back 1.1s ease-in-out infinite;
}
@keyframes deskpulse-back {
0%, 100% {
box-shadow: var(--shadow-2), 0 0 0 0 rgba(198, 255, 58, 0);
transform: rotateY(180deg) scale(1);
}
50% {
box-shadow: var(--shadow-2), 0 0 38px 6px rgba(198, 255, 58, 0.45);
transform: rotateY(180deg) scale(1.012);
}
}
/* ---------- controls ---------- */
.controls {
display: flex;
flex-wrap: wrap;
gap: 10px;
width: 100%;
margin-top: 24px;
}
.btn {
flex: 1 1 auto;
min-height: 48px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 0 18px;
border-radius: var(--r-md);
font-family: inherit;
font-size: 14px;
font-weight: 800;
letter-spacing: 0.02em;
cursor: pointer;
border: 1px solid transparent;
transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:active {
transform: translateY(1px) scale(0.99);
}
.btn:focus-visible {
outline: none;
box-shadow: 0 0 0 3px rgba(198, 255, 58, 0.4);
}
.btn--neon {
flex-basis: 100%;
background: var(--neon);
color: #10130a;
}
.btn--neon:hover {
background: var(--neon-d);
}
.btn--ghost {
background: var(--surface-2);
color: var(--ink);
border-color: var(--line-2);
}
.btn--ghost:hover {
background: var(--elevated);
border-color: var(--neon);
}
.btn--ghost[aria-pressed="true"] {
background: var(--neon-50);
border-color: var(--neon);
color: var(--neon);
}
.boost-icon {
font-size: 16px;
line-height: 1;
}
/* ---------- tier switch ---------- */
.hint-text {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
margin: 22px 0 0;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.14em;
color: var(--muted);
}
.tier-switch {
display: inline-flex;
gap: 6px;
}
.chip {
font-family: inherit;
font-size: 12px;
font-weight: 700;
letter-spacing: 0.02em;
text-transform: none;
padding: 6px 12px;
border-radius: 999px;
background: var(--surface-2);
color: var(--ink-2);
border: 1px solid var(--line);
cursor: pointer;
transition: all 0.16s ease;
}
.chip:hover {
border-color: var(--line-2);
color: var(--ink);
}
.chip[aria-pressed="true"] {
background: var(--neon-50);
border-color: var(--neon);
color: var(--neon);
}
.chip:focus-visible {
outline: none;
box-shadow: 0 0 0 3px rgba(198, 255, 58, 0.35);
}
/* ---------- brightness boost ---------- */
.boost-overlay {
position: fixed;
inset: 0;
background: #fff;
opacity: 0;
pointer-events: none;
z-index: 40;
transition: opacity 0.3s ease;
}
body.boosted .boost-overlay {
opacity: 0.96;
}
body.boosted {
--surface-2: #ffffff;
}
body.boosted .stage {
position: relative;
z-index: 60;
}
body.boosted .card__face {
border-color: rgba(0, 0, 0, 0.4);
}
body.boosted .card__back {
background: #ffffff;
filter: contrast(1.25);
}
body.boosted .qr-frame {
box-shadow: inset 0 0 0 2px #000;
}
/* ---------- toast ---------- */
.toast-host {
position: fixed;
left: 50%;
bottom: 22px;
transform: translateX(-50%);
z-index: 80;
display: flex;
flex-direction: column;
gap: 8px;
align-items: center;
width: max-content;
max-width: calc(100vw - 32px);
}
.toast {
display: flex;
align-items: center;
gap: 9px;
padding: 11px 16px;
border-radius: var(--r-md);
background: var(--elevated);
color: var(--ink);
border: 1px solid var(--line-2);
box-shadow: var(--shadow-2);
font-size: 13.5px;
font-weight: 600;
opacity: 0;
transform: translateY(12px) scale(0.97);
transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show {
opacity: 1;
transform: translateY(0) scale(1);
}
.toast::before {
content: "";
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--neon);
box-shadow: 0 0 10px var(--neon);
}
/* ---------- responsive ---------- */
@media (max-width: 520px) {
.wrap {
padding: 22px 16px 48px;
}
.controls {
gap: 8px;
}
.btn--ghost {
flex: 1 1 calc(50% - 4px);
font-size: 13px;
padding: 0 10px;
}
.flip-hint {
font-size: 9.5px;
}
}
@media (prefers-reduced-motion: reduce) {
.card,
.card.is-flipped {
transition: none;
}
.dot,
.card.pulsing,
.card.is-flipped.pulsing,
.card.sheen-run .card__sheen {
animation: none;
}
}(function () {
"use strict";
/* ---------- member data (fictional) ---------- */
var member = {
name: "Marcus Delgado",
id: "IP-4827-0193",
joined: "Mar 2022",
};
var TIERS = {
black: { name: "Black Unlimited", id: "IP-4827-0193" },
pro: { name: "Pro", id: "IP-3391-7740" },
flex: { name: "Flex", id: "IP-8052-2218" },
};
/* ---------- elements ---------- */
var card = document.getElementById("card");
var flipBtn = document.getElementById("flipBtn");
var frontDeskBtn = document.getElementById("frontDeskBtn");
var boostBtn = document.getElementById("boostBtn");
var boostLabel = document.getElementById("boostLabel");
var tierName = document.querySelector(".tier__name");
var memberIdEl = document.getElementById("memberId");
var barcodeIdEl = document.querySelector(".barcode__id");
var toastHost = document.getElementById("toastHost");
var chips = Array.prototype.slice.call(document.querySelectorAll(".chip[data-tier]"));
var flipped = false;
var boosted = false;
var pulseTimer = null;
/* ---------- toast ---------- */
function toast(msg) {
var el = document.createElement("div");
el.className = "toast";
el.textContent = msg;
toastHost.appendChild(el);
requestAnimationFrame(function () {
el.classList.add("show");
});
setTimeout(function () {
el.classList.remove("show");
setTimeout(function () {
if (el.parentNode) el.parentNode.removeChild(el);
}, 280);
}, 2200);
}
/* ---------- deterministic pseudo-random from a seed ---------- */
function seededRand(seed) {
var s = 0;
for (var i = 0; i < seed.length; i++) {
s = (s * 31 + seed.charCodeAt(i)) >>> 0;
}
return function () {
s = (s * 1664525 + 1013904223) >>> 0;
return s / 4294967296;
};
}
/* ---------- fake-but-realistic QR matrix ---------- */
function drawQR(seedStr) {
var canvas = document.getElementById("qr");
var ctx = canvas.getContext("2d");
var N = 25; // modules per side
var size = canvas.width;
var cell = Math.floor(size / N);
var pad = Math.floor((size - cell * N) / 2);
var rand = seededRand(seedStr);
ctx.fillStyle = "#ffffff";
ctx.fillRect(0, 0, size, size);
ctx.fillStyle = "#0d0f12";
// build matrix
var grid = [];
var r, c;
for (r = 0; r < N; r++) {
grid[r] = [];
for (c = 0; c < N; c++) {
grid[r][c] = rand() > 0.5 ? 1 : 0;
}
}
// finder pattern (7x7) drawn at a corner
function finder(or_, oc) {
for (var i = -1; i <= 7; i++) {
for (var j = -1; j <= 7; j++) {
var rr = or_ + i;
var cc = oc + j;
if (rr < 0 || cc < 0 || rr >= N || cc >= N) continue;
var ring = i >= 0 && i <= 6 && j >= 0 && j <= 6;
var border = i === 0 || i === 6 || j === 0 || j === 6;
var core = i >= 2 && i <= 4 && j >= 2 && j <= 4;
grid[rr][cc] = ring && (border || core) ? 1 : 0;
}
}
}
finder(0, 0);
finder(0, N - 7);
finder(N - 7, 0);
// timing patterns
for (var k = 8; k < N - 8; k++) {
grid[6][k] = k % 2 === 0 ? 1 : 0;
grid[k][6] = k % 2 === 0 ? 1 : 0;
}
// render
for (r = 0; r < N; r++) {
for (c = 0; c < N; c++) {
if (grid[r][c]) {
ctx.fillRect(pad + c * cell, pad + r * cell, cell, cell);
}
}
}
}
/* ---------- barcode (Code 128-ish look) ---------- */
function drawBarcode(seedStr) {
var canvas = document.getElementById("barcode");
var ctx = canvas.getContext("2d");
var w = canvas.width;
var h = canvas.height;
var rand = seededRand(seedStr + "::bar");
ctx.fillStyle = "#ffffff";
ctx.fillRect(0, 0, w, h);
ctx.fillStyle = "#0d0f12";
var x = 6;
while (x < w - 6) {
var barW = 1 + Math.floor(rand() * 4);
var draw = rand() > 0.42;
if (draw) ctx.fillRect(x, 4, barW, h - 8);
x += barW + (1 + Math.floor(rand() * 2));
}
}
/* ---------- flip ---------- */
function setFlipped(state) {
flipped = state;
card.classList.toggle("is-flipped", flipped);
card.setAttribute("aria-pressed", String(flipped));
card.setAttribute(
"aria-label",
flipped
? "Membership card. Showing back with door check-in QR code. Activate to flip back."
: "Membership card. Showing front. Activate to flip and reveal check-in QR code."
);
if (!flipped) {
// re-run sheen on the front when returning
card.classList.remove("sheen-run");
void card.offsetWidth;
card.classList.add("sheen-run");
}
}
function toggleFlip() {
setFlipped(!flipped);
}
card.addEventListener("click", toggleFlip);
flipBtn.addEventListener("click", function () {
toggleFlip();
});
/* ---------- front desk pulse ---------- */
frontDeskBtn.addEventListener("click", function (e) {
e.stopPropagation();
if (!flipped) setFlipped(true);
card.classList.add("pulsing");
toast("Showing check-in code at front desk");
if (pulseTimer) clearTimeout(pulseTimer);
pulseTimer = setTimeout(function () {
card.classList.remove("pulsing");
}, 6000);
});
/* ---------- brightness boost ---------- */
boostBtn.addEventListener("click", function (e) {
e.stopPropagation();
boosted = !boosted;
document.body.classList.toggle("boosted", boosted);
boostBtn.setAttribute("aria-pressed", String(boosted));
boostLabel.textContent = boosted ? "Boost on" : "Brightness boost";
if (boosted && !flipped) setFlipped(true);
toast(boosted ? "Max brightness for scanning" : "Brightness restored");
});
/* ---------- tier switch ---------- */
function applyTier(key) {
var t = TIERS[key];
if (!t) return;
tierName.textContent = t.name;
memberIdEl.textContent = t.id;
barcodeIdEl.textContent = t.id;
member.id = t.id;
chips.forEach(function (chip) {
chip.setAttribute("aria-pressed", String(chip.getAttribute("data-tier") === key));
});
renderCodes();
toast("Tier set to " + t.name);
}
chips.forEach(function (chip) {
chip.addEventListener("click", function () {
applyTier(chip.getAttribute("data-tier"));
});
});
/* ---------- render codes from current member ---------- */
function renderCodes() {
var payload = "IRONPULSE|" + member.id + "|CHECKIN";
drawQR(payload);
drawBarcode(member.id);
}
/* ---------- init ---------- */
chips.forEach(function (chip) {
chip.setAttribute("aria-pressed", String(chip.getAttribute("data-tier") === "black"));
});
renderCodes();
// entrance sheen
setTimeout(function () {
card.classList.add("sheen-run");
}, 300);
})();<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>IRONPULSE — Digital Membership Card</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;900&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<main class="wrap" id="app">
<header class="topbar">
<div class="brandmark" aria-hidden="true">
<span class="bolt"></span>
<span class="brandmark__txt">IRONPULSE</span>
</div>
<p class="eyebrow">Member Wallet</p>
</header>
<section class="stage" aria-label="Digital membership card">
<div class="card-scene">
<button
type="button"
class="card"
id="card"
aria-pressed="false"
aria-label="Membership card. Showing front. Activate to flip and reveal check-in QR code."
>
<!-- FRONT -->
<div class="card__face card__front">
<div class="card__sheen" aria-hidden="true"></div>
<div class="card__top">
<div class="brand">
<span class="brand__bolt" aria-hidden="true"></span>
<span class="brand__name">IRONPULSE</span>
</div>
<span class="pill pill--ok" id="statusPill">
<span class="dot" aria-hidden="true"></span> Active
</span>
</div>
<div class="tier" id="tierBlock">
<span class="tier__label">Membership</span>
<span class="tier__name">Black Unlimited</span>
</div>
<div class="card__chip" aria-hidden="true">
<span></span><span></span><span></span>
</div>
<div class="card__bottom">
<div class="field field--name">
<span class="field__k">Member</span>
<span class="field__v" id="memberName">Marcus Delgado</span>
</div>
<div class="meta-row">
<div class="field">
<span class="field__k">Member ID</span>
<span class="field__v mono" id="memberId">IP-4827-0193</span>
</div>
<div class="field field--right">
<span class="field__k">Joined</span>
<span class="field__v" id="joinDate">Mar 2022</span>
</div>
</div>
</div>
<span class="flip-hint" aria-hidden="true">Tap to check in →</span>
</div>
<!-- BACK -->
<div class="card__face card__back" id="cardBack">
<div class="back__top">
<span class="back__title">Door Check-In</span>
<span class="pill pill--ghost">Scan at gate</span>
</div>
<div class="qr-frame" id="qrFrame">
<canvas id="qr" width="220" height="220" aria-hidden="true"></canvas>
<span class="qr-corner qr-corner--tl" aria-hidden="true"></span>
<span class="qr-corner qr-corner--tr" aria-hidden="true"></span>
<span class="qr-corner qr-corner--bl" aria-hidden="true"></span>
<span class="qr-corner qr-corner--br" aria-hidden="true"></span>
</div>
<div class="barcode" aria-hidden="true">
<canvas id="barcode" width="320" height="56"></canvas>
<span class="barcode__id mono">IP-4827-0193</span>
</div>
<span class="flip-hint" aria-hidden="true">← Tap to flip back</span>
</div>
</button>
</div>
<div class="controls" role="group" aria-label="Card actions">
<button type="button" class="btn btn--neon" id="frontDeskBtn">
Show at front desk
</button>
<button type="button" class="btn btn--ghost" id="boostBtn" aria-pressed="false">
<span class="boost-icon" aria-hidden="true">☼</span>
<span id="boostLabel">Brightness boost</span>
</button>
<button type="button" class="btn btn--ghost" id="flipBtn">
Flip card
</button>
</div>
<p class="hint-text">
Tier
<span class="tier-switch" role="group" aria-label="Switch membership tier">
<button type="button" class="chip" data-tier="black">Black Unlimited</button>
<button type="button" class="chip" data-tier="pro">Pro</button>
<button type="button" class="chip" data-tier="flex">Flex</button>
</span>
</p>
</section>
</main>
<div class="boost-overlay" id="boostOverlay" hidden></div>
<div class="toast-host" id="toastHost" aria-live="polite" aria-atomic="true"></div>
<script src="script.js"></script>
</body>
</html>Digital Membership Card
A wallet-style membership card for the fictional IRONPULSE gym. The front carries the brand bolt, the member name (Marcus Delgado), the tier headline, member ID, join date and a pulsing Active status pill, finished with an EMV-style chip and a subtle light sheen. Tap the card — or use the Flip card button — and it rotates in 3D around the Y axis to reveal the back.
The back is built for the door reader: a crisp, finder-pattern QR matrix drawn entirely on a
<canvas> (deterministic from the member ID, so it is stable per member but clearly fictional),
plus a Code 128-style barcode and the printed ID below it. Show at front desk flips to the
code and runs a neon glow pulse so staff can spot it from a distance, and Brightness boost
slams the screen to high contrast for stubborn scanners.
Three tier chips — Black Unlimited, Pro and Flex — swap the headline and member ID and
regenerate both the QR and barcode on the fly. Everything is vanilla JS: keyboard-operable buttons,
visible focus rings, aria-pressed flip state, a small toast() helper and a
prefers-reduced-motion fallback. Responsive down to ~360px.
Illustrative UI only — the QR and barcode are decorative and not scannable.