feat(checkin): gym membership QR check-in (mobile-only)
Add a mobile-only gym check-in screen: saved membership codes shown as QR codes in a swipeable carousel, reached from a 'Check in' card on Home. Cards are added by typing the code, importing a photo, or scanning with the camera. Only the code value + symbology are stored — never a photo; the QR is regenerated from the value on every display. Rendering uses lean-qr (MIT); camera scan and photo decode use @capacitor-mlkit/barcode-scanning (Apache-2.0), pinned to the 7.x line for Capacitor 7. Both are documented in NOTICE.md and bundled only in the mobile build — the whole feature folds away in web/demo builds via MOBILE, so nothing new lands in the web bundle. No backend/schema change: gymCards rides the existing state sync and backup like every other field. Non-QR symbologies are readable but not reproducible, so capture refuses them rather than storing a code that would display wrong bars. Native wiring: CAMERA permission + ML Kit barcode_ui meta-data (AndroidManifest), NSCameraUsageDescription (iOS Info.plist), mlkit plugin registered via cap sync. Debug builds get an applicationIdSuffix '.test' and an 'OpenGymTest' label so a test build installs alongside the real app.
This commit is contained in:
1 parent
272bf785ee
commit
a797729dd0
19 files changed
+587
No files matched your search
@@ -1056,3 +1056,40 @@ h4.sec{
|
||||
.exmedia img{height:380px}
|
||||
.hm-wrap{display:flex;flex-direction:column;align-items:center}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------- gym check-in -- */
|
||||
/* Mobile-only feature (views/CheckIn.jsx): saved membership codes shown as QR, swiped
|
||||
through horizontally. The rail is a scroll-snap track — one card per viewport, no JS
|
||||
carousel — with a trailing "+" card to add another. */
|
||||
.ci-rail{
|
||||
display:flex;gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;
|
||||
-webkit-overflow-scrolling:touch;scrollbar-width:none;
|
||||
padding:4px 0 8px;margin:0 -16px;padding-left:16px;padding-right:16px;
|
||||
}
|
||||
.ci-rail::-webkit-scrollbar{display:none}
|
||||
.ci-card{
|
||||
scroll-snap-align:center;flex:0 0 100%;box-sizing:border-box;
|
||||
background:var(--surface);border-radius:var(--r-xl);padding:22px 18px;
|
||||
display:flex;flex-direction:column;align-items:center;gap:14px;
|
||||
}
|
||||
.ci-card .ci-label{font-size:19px;font-weight:600;letter-spacing:-.014em;text-align:center}
|
||||
.ci-card .ci-value{font-size:14px;color:var(--label-2);word-break:break-all;text-align:center;font-variant-numeric:tabular-nums}
|
||||
/* The QR itself: lean-qr paints 1 module per pixel, so scale it up with the browser's
|
||||
nearest-neighbour so every module stays a crisp square instead of a blurred blob. White
|
||||
quiet-zone padding is baked in by the renderer; the plate underneath just frames it. */
|
||||
.ci-qr-plate{background:#fff;border-radius:var(--r-lg);padding:16px}
|
||||
.qr-canvas{display:block;image-rendering:pixelated;image-rendering:crisp-edges;transition:opacity var(--fast)}
|
||||
/* the trailing add card — a big + on a dashed outline, same footprint as a real card */
|
||||
.ci-add{
|
||||
scroll-snap-align:center;flex:0 0 100%;box-sizing:border-box;
|
||||
min-height:280px;border-radius:var(--r-xl);
|
||||
border:2px dashed var(--surface-3);background:none;color:var(--label-2);
|
||||
display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;
|
||||
}
|
||||
.ci-add:active{background:var(--surface);transform:scale(.99)}
|
||||
.ci-add .icn{font-size:40px;--icon-stroke:1.8}
|
||||
.ci-add .ci-add-t{font-size:16px;font-weight:500}
|
||||
/* dots under the rail — which card you're on. Purely a hint; the rail itself is the control. */
|
||||
.ci-dots{display:flex;justify-content:center;gap:7px;margin-top:4px}
|
||||
.ci-dot{width:7px;height:7px;border-radius:50%;background:var(--surface-3);transition:background var(--fast),transform var(--fast)}
|
||||
.ci-dot.on{background:var(--acc);transform:scale(1.15)}
|
||||
Reference in new issue
Block a user