Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Cross-Platform-Polish: plattformgerechte Passkey-Texte (iOS/Android), maskierbares Android-Icon, View-Übergänge, Touch-Feinschliff (user-select, will-change, decoding=async, reduced-motion)

Duarte Santose4118d3c0f1f
diff --git a/app/app.js b/app/app.js
index 004904640..393f6e084 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) => `<img class="${cls||'thumb'}" loading="lazy" src="img/${ex.img}" alt="">`;
+const imgEl = (ex, cls) => `<img class="${cls||'thumb'}" loading="lazy" decoding="async" src="img/${ex.img}" alt="">`;
/* big autoplay animation for single-exercise views; tap pauses (swaps to still) */
-const mediaEl = (ex, id) => `<div class="exmedia"${id ? ` id="${id}"` : ''}><img src="gif/${ex.gif}" alt="${esc(ex.n)}"><span class="gifhint">⏸ tap to pause</span></div>`;
+const mediaEl = (ex, id) => `<div class="exmedia"${id ? ` id="${id}"` : ''}><img decoding="async" src="gif/${ex.gif}" alt="${esc(ex.n)}"><span class="gifhint">⏸ tap to pause</span></div>`;
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) {
<div style="height:10px"></div>` : `
<div class="card small muted" style="text-align:left">This browser doesn't support passkeys — you can still use GymLog locally on this device.</div>`}
<button class="btn ghost dim" id="lg-guest">Continue without account</button>
- <div class="dim small" style="margin-top:26px;line-height:1.5">Passkeys use Face ID / Touch ID — no passwords.<br>Each profile keeps its own plan, workouts & body weight.</div>
+ <div class="dim small" style="margin-top:26px;line-height:1.5">Passkeys use ${BIO} — no passwords.<br>Each profile keeps its own plan, workouts & body weight.</div>
</div>`;
const bi = $('#lg-in');
if (bi) bi.onclick = async () => {
@@ -579,7 +585,7 @@ function viewLogin(app) {
function registerSheet(fromSettings) {
const m = openModal(`
<h3>Create your profile ✨</h3>
- <div class="muted small" style="margin-bottom:14px">Pick a name, then confirm with Face ID / Touch ID. The passkey is saved in your iCloud Keychain — no password needed.</div>
+ <div class="muted small" style="margin-bottom:14px">Pick a name, then confirm with ${BIO}. The passkey is saved in ${VAULT} — no password needed.</div>
<input class="input" id="rg-name" placeholder="Your name" maxlength="40" autocomplete="name">
<div style="height:12px"></div>
<button class="btn primary" id="rg-go">Create passkey</button>`);
@@ -1753,7 +1759,7 @@ function viewSettings(app) {
<div class="card">
<h2>Tip</h2>
- <div class="small muted" style="line-height:1.5">📱 In Safari: <b>Share → Add to Home Screen</b> to install GymLog as a full-screen app. All data stays on this device (localStorage) — export a backup now and then!</div>
+ <div class="small muted" style="line-height:1.5">📱 ${IS_ANDROID ? 'In Chrome: <b>⋮ menu → Add to Home screen</b>' : 'In Safari: <b>Share → Add to Home Screen</b>'} 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!'}</div>
</div>
<div class="dim small" style="text-align:center;margin-top:8px">GymLog · exercise data: hasaneyldrm/exercises-dataset (CC)</div>
</div>
diff --git a/app/index.html b/app/index.html
index 089216cf9..22a25ba29 100644
--- a/app/index.html
+++ b/app/index.html
@@ -13,7 +13,7 @@
<link rel="manifest" href="manifest.json">
<link rel="apple-touch-icon" href="icon-180.png">
<link rel="icon" type="image/png" href="icon-180.png">
-<link rel="stylesheet" href="style.css?v=10">
+<link rel="stylesheet" href="style.css?v=11">
</head>
<body>
<div id="app"><div style="padding-top:42vh;text-align:center;font-size:2.2rem">🏋️</div></div>
@@ -45,7 +45,7 @@
<div id="modal-root"></div>
<div id="toast"></div>
-<script src="data.js?v=10"></script>
-<script src="app.js?v=10"></script>
+<script src="data.js?v=11"></script>
+<script src="app.js?v=11"></script>
</body>
</html>
diff --git a/app/manifest.json b/app/manifest.json
index 4fac9fcd5..765c36e42 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 959258654..8c10c55fc 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 4c921f07c..8eda0e5e2 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()));