From e4118d3c0f1f5cb4e31ded8218525ea22ed5e30a Mon Sep 17 00:00:00 2001 From: Duarte Santos Date: Sun, 19 Jul 2026 15:15:02 +0200 Subject: [PATCH] =?UTF-8?q?Cross-Platform-Polish:=20plattformgerechte=20Pa?= =?UTF-8?q?sskey-Texte=20(iOS/Android),=20maskierbares=20Android-Icon,=20V?= =?UTF-8?q?iew-=C3=9Cberg=C3=A4nge,=20Touch-Feinschliff=20(user-select,=20?= =?UTF-8?q?will-change,=20decoding=3Dasync,=20reduced-motion)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/app.js | 16 +++++++++++----- app/index.html | 6 +++--- app/manifest.json | 4 ++-- app/style.css | 6 +++++- app/sw.js | 4 ++-- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/app/app.js b/app/app.js index 0049046..393f6e0 100644 --- a/app/app.js +++ b/app/app.js @@ -81,6 +81,11 @@ function beep(freq, dur, when) { let USER = null; const isGuest = () => localStorage.getItem('gym_guest') === '1'; const webauthnOK = () => !!(window.PublicKeyCredential && navigator.credentials); +/* platform-aware wording — same WebAuthn underneath, different branding on top */ +const IS_APPLE = /iPhone|iPad|iPod|Macintosh/.test(navigator.userAgent); +const IS_ANDROID = /Android/.test(navigator.userAgent); +const BIO = IS_APPLE ? 'Face ID / Touch ID' : IS_ANDROID ? 'fingerprint or face unlock' : 'your fingerprint, face or PIN'; +const VAULT = IS_APPLE ? 'iCloud Keychain' : IS_ANDROID ? 'Google Password Manager' : 'your password manager'; async function api(path, opts) { const r = await fetch(path, Object.assign({ headers: { 'Content-Type': 'application/json' } }, opts)); const data = await r.json().catch(() => ({})); @@ -241,9 +246,9 @@ function streakWeeks() { } /* ---------- media ---------- */ -const imgEl = (ex, cls) => ``; +const imgEl = (ex, cls) => ``; /* big autoplay animation for single-exercise views; tap pauses (swaps to still) */ -const mediaEl = (ex, id) => `
${esc(ex.n)}⏸ tap to pause
`; +const mediaEl = (ex, id) => `
${esc(ex.n)}⏸ tap to pause
`; function bindMediaToggle(media, ex) { if (!media) return; media.onclick = () => { @@ -511,6 +516,7 @@ function renderView() { clearInterval(elapsedInt); closeAllModals(); const app = $('#app'); + if (!sameView) { app.classList.remove('vfade'); void app.offsetWidth; app.classList.add('vfade'); } if (!USER && !isGuest()) viewLogin(app); else if (view === 'plan' && rest[0] === 'r') viewRoutineEdit(app, rest[1]); else switch (view) { @@ -560,7 +566,7 @@ function viewLogin(app) {
` : `
This browser doesn't support passkeys — you can still use GymLog locally on this device.
`} -
Passkeys use Face ID / Touch ID — no passwords.
Each profile keeps its own plan, workouts & body weight.
+
Passkeys use ${BIO} — no passwords.
Each profile keeps its own plan, workouts & body weight.
`; const bi = $('#lg-in'); if (bi) bi.onclick = async () => { @@ -579,7 +585,7 @@ function viewLogin(app) { function registerSheet(fromSettings) { const m = openModal(`

Create your profile ✨

-
Pick a name, then confirm with Face ID / Touch ID. The passkey is saved in your iCloud Keychain — no password needed.
+
Pick a name, then confirm with ${BIO}. The passkey is saved in ${VAULT} — no password needed.
`); @@ -1753,7 +1759,7 @@ function viewSettings(app) {

Tip

-
📱 In Safari: Share → Add to Home Screen to install GymLog as a full-screen app. All data stays on this device (localStorage) — export a backup now and then!
+
📱 ${IS_ANDROID ? 'In Chrome: ⋮ menu → Add to Home screen' : 'In Safari: Share → Add to Home Screen'} to install GymLog as a full-screen app. ${USER ? 'Your data syncs with your profile — sign in anywhere to see it.' : 'Guest data stays on this device — export a backup now and then!'}
GymLog · exercise data: hasaneyldrm/exercises-dataset (CC)
diff --git a/app/index.html b/app/index.html index 089216c..22a25ba 100644 --- a/app/index.html +++ b/app/index.html @@ -13,7 +13,7 @@ - +
🏋️
@@ -45,7 +45,7 @@
- - + + diff --git a/app/manifest.json b/app/manifest.json index 4fac9fc..765c36e 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -9,7 +9,7 @@ "background_color": "#0c0e12", "theme_color": "#0c0e12", "icons": [ - { "src": "icon-180.png", "sizes": "180x180", "type": "image/png" }, - { "src": "icon-512.png", "sizes": "512x512", "type": "image/png" } + { "src": "icon-180.png", "sizes": "180x180", "type": "image/png", "purpose": "any" }, + { "src": "icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable" } ] } diff --git a/app/style.css b/app/style.css index 9592586..8c10c55 100644 --- a/app/style.css +++ b/app/style.css @@ -23,6 +23,10 @@ :root{--accT:color-mix(in srgb, var(--acc) 16%, transparent)} *{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent} +button,.chip,.tile,.item,.wday,.cal-d,.ck,.swatch,.emoji-cell,.hm-c,#tabbar,.step{-webkit-user-select:none;user-select:none} +@keyframes viewfade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}} +#app.vfade{animation:viewfade .18s ease} +@media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important}} html{font-size:16px} body{ background:var(--bg); color:var(--txt); @@ -176,7 +180,7 @@ a{color:var(--acc)} .sheet{position:absolute;left:0;right:0;bottom:0;background:var(--bg2); border-radius:22px 22px 0 0;padding:10px 18px calc(22px + var(--sab)); max-height:88vh;overflow-y:auto;-webkit-overflow-scrolling:touch;animation:slideup .28s; - overscroll-behavior:contain;touch-action:pan-y} + overscroll-behavior:contain;touch-action:pan-y;will-change:transform} .sheet .grab{width:40px;height:4px;border-radius:99px;background:var(--line);margin:4px auto 14px} .sheet h3{font-size:1.15rem;font-weight:800;margin-bottom:12px} .center{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(88vw,360px); diff --git a/app/sw.js b/app/sw.js index 4c921f0..8eda0e5 100644 --- a/app/sw.js +++ b/app/sw.js @@ -1,6 +1,6 @@ /* GymLog service worker — network-first for app shell, cache-first for media */ -const CACHE = 'gymlog-v10'; -const SHELL = ['./', 'index.html', 'style.css?v=10', 'app.js?v=10', 'data.js?v=10', 'manifest.json']; +const CACHE = 'gymlog-v11'; +const SHELL = ['./', 'index.html', 'style.css?v=11', 'app.js?v=11', 'data.js?v=11', 'manifest.json']; self.addEventListener('install', e => { e.waitUntil(caches.open(CACHE).then(c => c.addAll(SHELL)).then(() => self.skipWaiting()));