Compare commits

...
11 Commits
Author SHA1 Message Date
Duarte Santos fac45f9af9 Release v1.2.1: muscle map and live demo
Consolidates everything since v1.2.0 into one version: the muscle map
(Stats balance card, routine preview, finish screen, male/female body
diagram), the browser-only GitHub Pages demo, and the fix for the blank
screen when finishing a workout from its last exercise.

api/package.json tracks the release alongside the frontend.
2026-07-23 12:56:52 +02:00
Duarte Santos cd77cfdd84 Muscle map: see which muscles your training actually reaches
A front-and-back body diagram, shaded with the same accent ramp as the
activity heatmap, in three places: Stats gets a Muscle balance card over
a week / 30d / 90d / all-time window, the routine editor previews what a
session hits while you build it, and the finish screen shows what you
just trained. Settings switches between a male and female figure.

The Stats card's real job is the list underneath: the muscles that got
nothing in the period. Load is counted in effective sets — full weight
for an exercise's target muscle, partial for its supporting ones — not
kilograms, since 100 kg of leg press and 12 kg of lateral raise say
nothing about which muscle worked harder. Shading is relative within the
window, so it always reads as a balance rather than an absolute.

The dataset spells muscles inconsistently ('delts', 'deltoids' and
'shoulders' are one muscle); all 50 spellings it uses are normalised onto
the 18 the diagram draws, verified against the full catalogue so nothing
is dropped silently. Custom exercises fall back to their body part.

Geometry is converted from MuscleMap (MIT, see NOTICE.md), which ships
its paths as Swift source rather than .svg. At ~90 kB it is imported
dynamically, so the initial bundle is unchanged.

Also fixes a crash this surfaced but did not cause: finishing a workout
from its last exercise blanked the whole app, because the per-exercise
weight sheet read the running workout without checking it was still
there and finishing clears it while that sheet is on screen.
2026-07-23 12:51:24 +02:00
Duarte Santos e9bf38f39b Publish a browser-only demo to GitHub Pages
Self-hosting is a fair ask once someone knows they want the app, but it's a lot
to ask of someone deciding whether to look at it at all. A demo build (VITE_DEMO=1)
drops the parts that need the backend — passkeys, sync, admin — and boots straight
into guest mode with a seeded example profile, so every screen has real data behind
it: twelve weeks of Push/Pull/Legs with progression and the odd missed session,
twice-weekly weigh-ins trending toward a goal, PRs, and today's session moved onto
the current day so there's always something to press Start on.

The seed generator is imported dynamically and the demo-only UI folds away at build
time, so none of it lands in the bundle self-hosters ship. Exercise media (~140 MB)
isn't committed anywhere, so the demo build points VITE_IMG_BASE / VITE_GIF_BASE at
the upstream dataset on jsDelivr, pinned to a commit; unset, both still resolve to
img/ and gif/ next to the app exactly as before.

Deployed by a Pages workflow on every push to main.
2026-07-23 12:42:40 +02:00
Duarte Santos 3c5bcd5957 Refresh README, self-hosting docs and dependencies for v1.2.0
Screenshots were still from the old design — all five regenerated from a
seeded three-month history.

The feature list had been behind since v1.1.0: push notifications and the
workout-day reminder were never listed, nor were custom exercises, the
equipment filter or the admin dashboard. ADMIN_UIDS and INVITE_ONLY were
documented in .env.example but missing from the README config table, and
docs/SELF_HOSTING.md still claimed there was no admin/invite system by
design — it now explains how to turn one on.

api/package.json version was lagging at 1.1.1; it tracks the release now.
React and @vitejs/plugin-react picked up their patch releases (lockfile
only, no manifest change); api dependencies were already current and both
trees audit clean.
2026-07-23 12:07:10 +02:00
Duarte Santos b28a58930c Release v1.2.0: complete visual redesign
Rebuilt design system (one type scale, neutral surface ramp, hairline
separators), a 77-icon hand-drawn set replacing every emoji in the UI,
grouped routine-icon picker with the old emoji mapped forward, new tab
bar with a raised Start/Resume button, and a reorganised Home.

Chart fixes that came out of it: axis labels, gridlines and the target
line were painted with colour variables the new sheet no longer defines
and fell back to black-on-black; the hover readout is now placed from
its measured size so it can't be clipped at the edges, and it clears
when the pointer leaves the chart.
2026-07-23 11:55:52 +02:00
Duarte Santos fc36476a5f Release v1.1.3: consolidate all work since v1.1.2
v1.1.2 is the last published release; v1.1.3 and v1.1.4 were tagged but
never released. Collapse those two plus the equipment filter and the rest
timer fix into a single v1.1.3 changelog section, grouped into 'Admin
dashboard' and 'Exercises & workout'. Set frontend/package.json to 1.1.3.

Covers #12, the admin dashboard (phases 1+2), #6 and #14.
2026-07-22 14:52:32 +02:00
Duarte Santos fbf125f6a2 Filter exercises by equipment (#6)
Adds an equipment filter row under the body-part chips, in both the
Exercises library and the exercise picker sheet.

The options are derived from the exercises already matching the current
body part and search, ordered most-common-first, so the row stays short
instead of listing all 28 equipment values (many with a single exercise)
and every combination on screen has results behind it. The row hides
itself when there is nothing to choose between.

Changing the body part clears the equipment filter; a search that
narrows the chosen equipment away drops it rather than showing an empty
list. All equipment terms were already localized — only the new 'Any
equipment' label needed adding across the 11 locale packs.

Closes #6
2026-07-22 14:44:27 +02:00
Duarte Santos 33317dac91 Fix rest timer freezing at 0:01 (#14)
The tick callback shadowed the imported i18n helper `t` with the timer
object, so the final tick threw a TypeError on t('Rest over — next set!')
before reaching stopRest(). The interval kept running and re-throwing, the
display stayed on the last value it wrote, and the pending server-side
'rest over' push was never cancelled.

Closes #14
2026-07-22 14:44:15 +02:00
Duarte Santos f3ba05aece Admin dashboard (phase 2): live 'training now' heartbeat + release v1.1.4
Backend: in-memory presence map + POST /api/activity heartbeat (authed);
each /api/admin/users row carries a fresh 'live' snapshot (routine,
exercise x/y, sets done/total, started-at) with a ~70s TTL. Disabling a
user clears their presence immediately.

Frontend: the workout screen pings /api/activity every 20s (signed-in
only) and sends a leave signal on unmount (fetch + sendBeacon). The
dashboard gains a 'Training now' section and live markers, auto-
refreshing every 15s.

Cuts the complete admin-dashboard feature (phases 1+2) as v1.1.4.
2026-07-22 02:06:19 +02:00
Duarte Santos 046217079c Admin dashboard (phase 1): users, disable, invite-gated signup
Adds an operator dashboard for self-hosters, gated on a passkey-
authenticated admin flag (ADMIN_UIDS env) and enforced server-side.

Backend:
- ADMIN_UIDS / INVITE_ONLY env (both off by default, OSS-friendly).
- Invite codes in db.json; /api/register gated when INVITE_ONLY, code
  burned on successful signup.
- disabled users are rejected by readSession — locked out everywhere.
- /api/admin/{users,user,user/disable,invites,invites/new,invites/revoke}
  behind an admin guard; /api/config exposes invite_only to the login UI.
- admin flag surfaced on /api/me, register/verify, login/verify.

Frontend:
- New /admin route + Settings link, shown only to admins: user list with
  workout counts and last-sync, disable/enable, invite generation, and a
  per-user workout-history drill-down.
- Registration sheet shows an invite-code field when the instance is
  invite-only.

Phase 2 (live 'training now' via a heartbeat) is separate.
2026-07-22 01:58:33 +02:00
Duarte Santos dabffdebc0 Minimize the exercise animation during a workout (#12)
Adds a persistent minimize/expand toggle to the workout animation so the
set rows are reachable without scrolling past a full-height GIF. A new
S.gifSize setting ('full' | 'mini') is flipped by the button, saved and
synced like other prefs, and applied across exercises and future
workouts. Tapping the animation still pauses/plays it.

Closes #12
2026-07-22 01:00:50 +02:00
59 changed files with 3774 additions and 1122 deletions

No files matched your search

+15
View File
@@ -19,6 +19,21 @@ RP_NAME=openGym
#
# (Point your proxy at the web container's WEB_PORT. See docs/SELF_HOSTING.md.)
# ── Admin dashboard & invite-only signup (optional) ────────────────────────
# Both off by default — a fresh instance has open signup and no admin.
#
# Make yourself an admin: register your own passkey profile first, find your
# user id in ./data/db.json ("users"[].id), then list it here (comma-separated
# for several admins). Admins get an "Admin dashboard" link in Settings to see
# users, disable accounts, generate invite codes and view workout history.
#
# ADMIN_UIDS=youruserid,anotheradmin
#
# Require an invite code to create new profiles (existing accounts keep working;
# generate the codes from the admin dashboard):
#
# INVITE_ONLY=1
# ── Notifications (optional) ───────────────────────────────────────────────
# Push works out of the box — nothing to set. VAPID keys are generated on first
# run and saved to ./data/vapid.json. Each user's browser reports its own
+60
View File
@@ -0,0 +1,60 @@
# Publishes the browser-only demo to GitHub Pages: https://duartesantos8.github.io/openGym/
#
# Pages serves static files only, so this build has no backend — VITE_DEMO=1 makes the app
# boot straight into guest mode with a seeded example history (see frontend/src/lib/demo.js).
# The exercise images/GIFs (~140 MB) are never committed here; the demo build points at the
# upstream dataset on jsDelivr instead, pinned to a commit so the CDN can cache it forever.
name: Deploy demo to GitHub Pages
on:
push:
branches: [main]
paths:
- 'frontend/**'
- '.github/workflows/pages.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
env:
DATASET: https://cdn.jsdelivr.net/gh/hasaneyldrm/exercises-dataset@7455efae41b330c265e7cd4b78dfa848e7ce5ebd
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm ci
working-directory: frontend
- run: npm run build
working-directory: frontend
env:
VITE_DEMO: '1'
VITE_IMG_BASE: ${{ env.DATASET }}/images/
VITE_GIF_BASE: ${{ env.DATASET }}/videos/
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: frontend/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- id: deploy
uses: actions/deploy-pages@v4
+108
View File
@@ -1,5 +1,113 @@
# Changelog
## v1.2.1 — 2026-07-23
A muscle map across the app, and a live demo you can try without installing anything.
- 💪 **Muscle map.** Three places now show which muscles your training actually reaches, drawn on a
front-and-back body diagram shaded like the activity heatmap — more accent means more work.
- **Stats → Muscle balance** aggregates a week, 30 days, 90 days or everything, lists your
hardest-worked muscles with their set counts, and names the ones that got *nothing* in that
period. That last list is the point of the card: the gaps are what you'd otherwise never notice.
Tap any muscle to read its name and volume.
- **Routine editor** previews what a session hits as you build it, so a hole in the plan shows up
before you train around it for a month.
- **The finish screen** shows what you just trained.
- Load is counted in *effective sets* — a set counts fully for the exercise's target muscle and
partially for its supporting ones — not in kilograms, because 100 kg of leg press and 12 kg of
lateral raise say nothing about which muscle worked harder. Shading is relative within the
period you're looking at, so the map always reads as a balance rather than an absolute.
- Settings → Appearance → **Body diagram** switches between a male and female figure.
- The exercise dataset spells muscles inconsistently ("delts", "deltoids" and "shoulders" are one
muscle); all 50 spellings it uses are normalised onto the 18 the diagram can draw. Custom
exercises, which only carry a body part, fall back to it. The geometry is ~90 kB and loads on
demand, so the initial bundle is unchanged.
- 🐛 **Fixed: finishing a workout from its last exercise could blank the whole app.** The
per-exercise weight sheet read the running workout without checking it was still there, and
finishing clears it while that sheet is still on screen.
- ▶️ **Live demo** at [duartesantos8.github.io/openGym](https://duartesantos8.github.io/openGym/) —
a browser-only build (`VITE_DEMO=1`) published to GitHub Pages on every push to `main`. It boots
into guest mode with a seeded example profile (12 weeks of Push/Pull/Legs, weigh-ins, PRs) so
every screen has something to show, and it never talks to a server. Passkeys, sync and the admin
dashboard stay exclusive to self-hosted instances, which is where the backend lives.
- 🖼️ Builds can point the exercise media elsewhere via `VITE_IMG_BASE` / `VITE_GIF_BASE` — the demo
serves the ~140 MB dataset from a CDN instead of shipping it. The default (`img/` and `gif/` next
to the app) is unchanged.
## v1.2.0 — 2026-07-23
A complete visual redesign. Same app, same data — every screen redrawn.
### A designed interface, not an assembled one
- 🎨 **Rebuilt design system.** One type scale carrying hierarchy through size instead of making
everything bold, a neutral surface ramp instead of saturated blue-greys, hairline separators
instead of outlined boxes, and motion that acknowledges a press rather than animating for
decoration. Light and dark are both first-class, and the eight accent colours now pick their
label colour by measured contrast — the default green in light mode was failing WCAG AA on
every primary button before.
- ✏️ **A hand-drawn icon set** (77 icons, single stroke weight, drawn on one 24×24 grid) replaces
every emoji in the interface. Emoji render differently on each platform, sit on their own
baseline and can't take a theme colour, which is what made the old UI feel stitched together.
Icons inherit the surrounding text colour and optical size.
- 🏋️ **Routine icons.** Picking an icon for a routine now offers a grouped set — strength,
equipment, cardio, recovery — instead of an emoji keyboard. Routines you already made keep
their look: the old emoji are mapped forward automatically, so nothing to migrate and nothing
to redo.
- ▶️ **New tab bar** with a raised Start button that turns into a pulsing orange Resume while a
workout is running.
- 🏠 **Home reads as a plan for today** — week strip, today's session as one tappable row, body
weight, and your streak.
### Charts
- 📈 **Axis labels, gridlines and the target-weight line are visible again** in dark mode. They
were painted with colour variables that no longer existed, which silently fell back to black
on black — and to no stroke at all for the lines.
- 💬 **The hover readout stays on screen.** It used to be positioned with a fixed offset that
assumed one label width, so the first and last point pushed it under the chart's clip; it's now
placed from its measured size and kept inside the frame, dropping below the point when the
point sits high enough that the label would cover the value it reports.
- 🖱️ **It also goes away again** — moving off the chart now clears the readout, crosshair and
marker, which previously stayed until you hovered somewhere else.
## v1.1.3 — 2026-07-22
Admin dashboard for self-hosters (opt-in — off by default), equipment filtering, and
workout-screen fixes.
### Admin dashboard
- 🛠️ **Admin dashboard** (Settings → Admin dashboard) for whoever runs the instance: a users
overview with workout counts and last-active times, plus a per-user drill-down into their full
workout history and body-weight log.
- 🟢 **Live "training now"** — see who's mid-workout in real time, with their current exercise and
set progress, updated by a lightweight heartbeat while a workout is on screen.
- 🚫 **Disable / enable accounts** — a disabled account is signed out and locked out everywhere
until you re-enable it.
- 🔑 **Invite-only signup** (optional) — require an invite code to create a profile; generate and
revoke codes from the dashboard. Existing accounts are unaffected.
- ⚙️ Configured via environment: `ADMIN_UIDS` (comma-separated user ids who are admins) and
`INVITE_ONLY=1`; both default off, so a fresh instance stays open with no admin. See
`.env.example`. Admin access is gated by your passkey and enforced server-side.
### Exercises & workout
- 🏋️ **Filter exercises by equipment** (#6). A second filter row under the body parts lets you
narrow the list to what you actually have — body weight, dumbbell, barbell, cable, band, and so
on — in both the Exercises library and the exercise picker. The options adapt to what you've
already selected and are ordered by how many exercises use them, so every combination on screen
has results behind it and the row stays short. Building a bodyweight-only plan is now two taps
per body part.
- 🔎 **Minimize the exercise animation during a workout** (#12). A ⤡ Minimize / ⤢ Expand button
on the animation shrinks it to a thin strip so the set rows sit right under your thumb — no more
scrolling past a big GIF to tick off a set. Your choice is remembered and applied to every
exercise and future workout until you change it, so you set it once. Tapping the animation still
pauses/plays it as before.
- ⏱️ **Fixed: the rest timer froze at 0:01** (#14) instead of counting down to the end. It also
meant the timer could only be cleared with Skip, and a redundant "rest over" push notification
could still fire.
## v1.1.2 — 2026-07-22
Custom exercises, full localization, and input fixes.
+32
View File
@@ -3,6 +3,38 @@
openGym — Copyright (C) 2026 Duarte Santos.
openGym's own code is licensed under the **GNU AGPL v3.0** (see [LICENSE](LICENSE)).
## Body diagram geometry
The muscle outlines the body maps are drawn from (`frontend/src/lib/body-paths.js`) are derived
from [**MuscleMap**](https://github.com/melihcolpan/MuscleMap) by Melih Colpan, used under the
**MIT License** and reproduced below. MuscleMap ships its path data as Swift source rather than
`.svg` files; the paths were converted to a JSON module, its sub-group shapes were dropped, and
nothing else about the artwork was changed.
```
MIT License
Copyright (c) 2026 Melih Colpan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
## Exercise data & media
The exercise names, instructions (English in `frontend/src/lib/exercises-data.js`, other
+26 -7
View File
@@ -37,6 +37,16 @@ No account on someone else's server, no subscription, no ads. Just `docker compo
</table>
</div>
<div align="center">
### [▶ Try the live demo](https://duartesantos8.github.io/openGym/)
No signup, nothing to install — it runs entirely in your browser on example data.<br>
<sub>There's no server behind the demo, so passkey sign-in, sync across devices and the
admin dashboard only exist in a self-hosted instance.</sub>
</div>
## Why
Most workout apps lock your data behind a login on their servers, nag you to upgrade, or
@@ -52,9 +62,14 @@ as a home-screen app, passkey sign-in, offline support, sync across your phone a
- ▶️ **Guided workouts** — it knows what day it is and starts today's session; asks your body weight first, pre-fills your weights from last time, rest timer, PR detection, per-exercise weight tracking
- 🔗 **Supersets** — build them, and log them back-to-back with a rest only after the pair
- 🏃 **Cardio** — log time + speed, not just weight × reps
- 🔧 **Filter by equipment** — narrow the library to what you actually own; the options adapt to what you've picked, so every combination on screen has results behind it
- ✨ **Your own exercises** — a name and a body part is enough; they behave like built-in ones everywhere, with an optional description instead of an animation
- 🟩 **Activity heatmap** — a GitHub-style year view, shaded by time spent training
- 💪 **Muscle map** — a front-and-back body diagram shaded by how much work each muscle got, over a week, a month or all time. It names the muscles you *haven't* trained in that period, previews what a routine hits while you build it, and shows what you just trained when you finish. Male or female figure, your pick
- 🔔 **Push notifications** — rest-timer alerts even with the app closed, plus an optional reminder on days you have a workout planned but haven't logged one. Opt in per profile; keys are generated on first run, nothing to configure
- 🔑 **Passkeys, not passwords** — Face ID / Touch ID / fingerprint login; each profile keeps its own data, synced across devices
- 🎨 **Themes** — light/dark + 8 accent colors, saved to your profile
- 🛠️ **Admin dashboard** (optional) — for whoever runs the instance: who's training right now, per-user history, disable accounts, and invite-only signup. Off by default, so a fresh instance stays open with no admin
- 🎨 **Designed, not assembled** — light/dark themes and 8 accent colors saved to your profile, over a hand-drawn icon set instead of emoji, so it looks the same on every phone
- 🌍 **12 languages** — full UI translation (EN, DE, ES, FR, IT, PT, PL, TR, RU, ZH, KO, HI); exercise instructions localized in 10 of them, loaded on demand so the app stays fast
- 📦 **Yours to keep** — one-tap JSON export/import, guest mode, **no telemetry**
@@ -108,12 +123,16 @@ server — they stay in your phone's secure hardware / your password manager.
All via `.env` (see `.env.example`):
| Variable | What it is | Default |
|------------|-----------------------------------|-------------------------|
| `RP_ID` | Hostname passkeys are bound to | `localhost` |
| `ORIGIN` | Full URL the app is served from | `http://localhost:8080` |
| `WEB_PORT` | Host port for the web UI | `8080` |
| `RP_NAME` | Name shown in the passkey prompt | `openGym` |
| Variable | What it is | Default |
|---------------|------------------------------------------------------|-------------------------|
| `RP_ID` | Hostname passkeys are bound to | `localhost` |
| `ORIGIN` | Full URL the app is served from | `http://localhost:8080` |
| `WEB_PORT` | Host port for the web UI | `8080` |
| `RP_NAME` | Name shown in the passkey prompt | `openGym` |
| `ADMIN_UIDS` | User ids that get the admin dashboard (comma-separated) | *(none)* |
| `INVITE_ONLY` | Require an invite code to create a profile | *(off)* |
Push notification keys are generated on first run and saved to `./data/vapid.json` — nothing to set.
## Roadmap
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gym-api",
"version": "1.1.1",
"version": "1.2.1",
"private": true,
"type": "module",
"main": "server.js",
+146 -6
View File
@@ -15,6 +15,10 @@ const DATA = process.env.DATA_DIR || '/data';
const RP_ID = process.env.RP_ID || 'localhost';
const ORIGIN = process.env.ORIGIN || 'http://localhost:8080';
const RP_NAME = process.env.RP_NAME || 'openGym';
// Admin dashboard (issue): admins are matched by uid; INVITE_ONLY gates new signups behind a
// code the admin generates. Both default off so a fresh self-hosted instance stays open.
const ADMIN_UIDS = (process.env.ADMIN_UIDS || '').split(',').map(s => s.trim()).filter(Boolean);
const INVITE_ONLY = /^(1|true|yes|on)$/i.test(process.env.INVITE_ONLY || '');
const SESSION_DAYS = 365;
const MAX_BODY = 5 * 1024 * 1024;
// Secure cookies require HTTPS; over plain http://localhost the flag would drop the cookie
@@ -28,9 +32,11 @@ if (!fs.existsSync(secretFile)) fs.writeFileSync(secretFile, crypto.randomBytes(
const SECRET = fs.readFileSync(secretFile, 'utf8').trim();
const dbFile = path.join(DATA, 'db.json');
let db = { users: [], creds: [], subs: [] };
let db = { users: [], creds: [], subs: [], invites: [] };
try { db = JSON.parse(fs.readFileSync(dbFile, 'utf8')); } catch {}
db.subs = db.subs || [];
db.invites = db.invites || [];
const isAdmin = user => !!user && (user.admin === true || ADMIN_UIDS.includes(user.id));
function saveDb() { atomicWrite(dbFile, JSON.stringify(db, null, 2)); }
function atomicWrite(file, content) {
const tmp = file + '.tmp';
@@ -163,7 +169,16 @@ function readSession(req) {
if (!payload) return null;
const [uid, exp] = payload.split(':');
if (!uid || +exp < Date.now()) return null;
return db.users.find(u => u.id === uid) || null;
const user = db.users.find(u => u.id === uid) || null;
if (user && user.disabled) return null; // disabled accounts are locked out everywhere
return user;
}
// Guard for /api/admin/* — resolves the caller and 401/403s if they aren't an admin.
function requireAdmin(req, res) {
const user = readSession(req);
if (!user) { json(res, 401, { error: 'not signed in' }); return null; }
if (!isAdmin(user)) { json(res, 403, { error: 'forbidden' }); return null; }
return user;
}
function sessionCookie(uid) {
return `gymsid=${makeSession(uid)}; Path=/; Max-Age=${SESSION_DAYS * 86400}; HttpOnly;${SECURE} SameSite=Lax`;
@@ -208,20 +223,39 @@ function readBody(req) {
}
const b64uToBuf = s => Buffer.from(s, 'base64url');
/* ---------- live presence (in-memory) ---------- */
// Clients heartbeat /api/activity while a workout is on screen; the admin dashboard reads who's
// live. Purely ephemeral — never persisted. Expires shortly after the last ping.
const presence = new Map(); // uid -> { name, exIdx, exTotal, setsDone, setsTotal, startedAt, updatedAt }
const PRESENCE_TTL = 70000; // ~3.5× the 20s client heartbeat
function livePresence(uid) {
const p = presence.get(uid);
if (!p) return null;
if (Date.now() - p.updatedAt > PRESENCE_TTL) { presence.delete(uid); return null; }
return p;
}
setInterval(() => { for (const [k, v] of presence) if (Date.now() - v.updatedAt > PRESENCE_TTL) presence.delete(k); }, 30000).unref();
/* ---------- routes ---------- */
const routes = {
'GET /api/health': async (req, res) => json(res, 200, { ok: true, users: db.users.length }),
// Public config the login screen needs before anyone is signed in.
'GET /api/config': async (req, res) => json(res, 200, { invite_only: INVITE_ONLY }),
'GET /api/me': async (req, res) => {
const user = readSession(req);
if (!user) return json(res, 401, { error: 'not signed in' });
json(res, 200, { user: { id: user.id, name: user.name } });
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } });
},
'POST /api/register/options': async (req, res) => {
const body = await readBody(req);
const name = String(body.name || '').trim().slice(0, 40);
if (!name) return json(res, 400, { error: 'name required' });
const code = String(body.code || '').trim().toUpperCase();
if (INVITE_ONLY && !db.invites.some(i => i.code === code && !i.usedBy && !i.revoked))
return json(res, 403, { error: 'a valid invite code is required' });
const uid = crypto.randomBytes(12).toString('base64url');
const options = await generateRegistrationOptions({
rpName: RP_NAME, rpID: RP_ID,
@@ -230,7 +264,7 @@ const routes = {
authenticatorSelection: { residentKey: 'required', userVerification: 'preferred' },
excludeCredentials: []
});
const cid = putChallenge({ challenge: options.challenge, name, uid });
const cid = putChallenge({ challenge: options.challenge, name, uid, code });
json(res, 200, { cid, options });
},
@@ -251,7 +285,14 @@ const routes = {
if (!verification.verified) return json(res, 400, { error: 'not verified' });
const { credential } = verification.registrationInfo;
if (db.creds.find(x => x.id === credential.id)) return json(res, 409, { error: 'credential already registered' });
// Re-check the invite at the last moment (it may have been used/revoked since options), then burn it.
let invite = null;
if (INVITE_ONLY) {
invite = db.invites.find(i => i.code === c.code && !i.usedBy && !i.revoked);
if (!invite) return json(res, 403, { error: 'invite code is no longer valid — ask for a new one' });
}
const user = { id: c.uid, name: c.name, created: new Date().toISOString() };
if (invite) { user.invitedBy = invite.code; invite.usedBy = user.id; invite.usedAt = user.created; }
db.users.push(user);
db.creds.push({
id: credential.id, userId: user.id,
@@ -260,7 +301,7 @@ const routes = {
transports: body.credential?.response?.transports || []
});
saveDb();
json(res, 200, { user: { id: user.id, name: user.name } }, { 'Set-Cookie': sessionCookie(user.id) });
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } }, { 'Set-Cookie': sessionCookie(user.id) });
},
'POST /api/login/options': async (req, res) => {
@@ -298,7 +339,8 @@ const routes = {
saveDb();
const user = db.users.find(u => u.id === cred.userId);
if (!user) return json(res, 500, { error: 'user missing' });
json(res, 200, { user: { id: user.id, name: user.name } }, { 'Set-Cookie': sessionCookie(user.id) });
if (user.disabled) return json(res, 403, { error: 'this account has been disabled' });
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } }, { 'Set-Cookie': sessionCookie(user.id) });
},
'POST /api/logout': async (req, res) => json(res, 200, { ok: true }, { 'Set-Cookie': clearCookie }),
@@ -367,6 +409,104 @@ const routes = {
if (!user) return json(res, 401, { error: 'not signed in' });
cancelRestTimer(user.id);
json(res, 200, { ok: true });
},
// Live-workout heartbeat: client pings while a workout is on screen; { active:false } drops it.
'POST /api/activity': async (req, res) => {
const user = readSession(req);
if (!user) return json(res, 401, { error: 'not signed in' });
const body = await readBody(req);
if (body.active) {
presence.set(user.id, {
name: String(body.name || '').slice(0, 60),
exIdx: +body.exIdx || 0, exTotal: +body.exTotal || 0,
setsDone: +body.setsDone || 0, setsTotal: +body.setsTotal || 0,
startedAt: +body.startedAt || Date.now(),
updatedAt: Date.now()
});
} else presence.delete(user.id);
json(res, 200, { ok: true });
},
/* ---------- admin dashboard ---------- */
// One row per user, cheap enough for a personal instance (reads each state file once).
'GET /api/admin/users': async (req, res) => {
if (!requireAdmin(req, res)) return;
const users = db.users.map(u => {
const S = readState(u.id) || {};
const workouts = S.workouts || [];
const last = workouts[workouts.length - 1];
return {
id: u.id, name: u.name, created: u.created || null,
disabled: !!u.disabled, admin: isAdmin(u), invitedBy: u.invitedBy || null,
workouts: workouts.length,
lastWorkout: last ? last.d : null,
lastSync: S._ts || null,
hasPush: db.subs.some(s => s.userId === u.id),
live: livePresence(u.id)
};
});
json(res, 200, { users, invite_only: INVITE_ONLY, now: Date.now() });
},
// Drill-down: full workout history + body-weight log for one user.
'GET /api/admin/user': async (req, res) => {
if (!requireAdmin(req, res)) return;
const id = new URL(req.url, 'http://x').searchParams.get('id');
const u = db.users.find(x => x.id === id);
if (!u) return json(res, 404, { error: 'no such user' });
const S = readState(u.id) || {};
json(res, 200, {
user: { id: u.id, name: u.name, created: u.created || null, disabled: !!u.disabled, admin: isAdmin(u), invitedBy: u.invitedBy || null },
unit: S.unit || 'kg',
lastSync: S._ts || null,
routines: (S.routines || []).map(r => ({ id: r.id, name: r.name, emoji: r.emoji, count: (r.ex || []).length })),
bodyweight: S.bodyweight || [],
workouts: (S.workouts || []).slice().reverse() // newest first for display
});
},
'POST /api/admin/user/disable': async (req, res) => {
if (!requireAdmin(req, res)) return;
const body = await readBody(req);
const u = db.users.find(x => x.id === body.id);
if (!u) return json(res, 404, { error: 'no such user' });
if (isAdmin(u)) return json(res, 400, { error: 'cannot disable an admin' });
u.disabled = !!body.disabled;
if (u.disabled) presence.delete(u.id); // drop them off "training now" at once
saveDb();
json(res, 200, { ok: true, id: u.id, disabled: u.disabled });
},
'GET /api/admin/invites': async (req, res) => {
if (!requireAdmin(req, res)) return;
// resolve usedBy uid → name for display
const invites = db.invites.map(i => ({
...i, usedByName: i.usedBy ? (db.users.find(u => u.id === i.usedBy) || {}).name || null : null
}));
json(res, 200, { invites, invite_only: INVITE_ONLY });
},
'POST /api/admin/invites/new': async (req, res) => {
const admin = requireAdmin(req, res); if (!admin) return;
const body = await readBody(req);
let code;
do { code = crypto.randomBytes(4).toString('hex').toUpperCase(); } while (db.invites.some(i => i.code === code));
const invite = { code, note: String(body.note || '').slice(0, 60), createdBy: admin.id, created: new Date().toISOString() };
db.invites.push(invite);
saveDb();
json(res, 200, { invite });
},
'POST /api/admin/invites/revoke': async (req, res) => {
if (!requireAdmin(req, res)) return;
const body = await readBody(req);
const inv = db.invites.find(i => i.code === String(body.code || '').toUpperCase());
if (!inv) return json(res, 404, { error: 'no such code' });
if (inv.usedBy) return json(res, 400, { error: 'already used — cannot revoke' });
db.invites = db.invites.filter(i => i.code !== inv.code);
saveDb();
json(res, 200, { ok: true });
}
};
Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

After

Width:  |  Height:  |  Size: 381 KiB

+19 -3
View File
@@ -87,9 +87,25 @@ Visit `https://gym.example.com`, create your profile, and add it to your home sc
## 4. Multiple users
Anyone who can reach the URL can create their own profile — each gets isolated data. There's no
admin/invite system by design; if you want it private, keep it behind your VPN, an auth proxy
(Authelia, Cloudflare Access…), or just don't share the URL.
Anyone who can reach the URL can create their own profile — each gets isolated data. That's the
default: open signup, no admin.
If you'd rather control who gets in, two optional settings in `.env` turn that around:
```bash
ADMIN_UIDS=youruserid # comma-separated; these users get the admin dashboard
INVITE_ONLY=1 # new profiles need an invite code
```
Register your own passkey profile first, then find your id in `./data/db.json` under `users[].id`
and put it in `ADMIN_UIDS`. You'll get an **Admin dashboard** link in Settings: who's training
right now, each user's workout history and body weight, the ability to disable an account (signed
out and locked out everywhere until you re-enable it), and — with `INVITE_ONLY=1` — generating and
revoking invite codes. Existing accounts keep working when you switch invite-only on. Admin access
is gated by your passkey and enforced server-side, so it needs no separate login.
Prefer to keep the whole thing off the open internet? A VPN or an auth proxy (Authelia, Cloudflare
Access…) in front still works, and composes with the above.
## 5. Backups
+15 -15
View File
@@ -1,13 +1,13 @@
{
"name": "opengym",
"version": "1.0.0",
"name": "opengym-frontend",
"version": "1.2.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "opengym",
"version": "1.0.0",
"license": "ISC",
"name": "opengym-frontend",
"version": "1.2.0",
"license": "AGPL-3.0-or-later",
"dependencies": {
"react": "^19.2.7",
"react-dom": "^19.2.7",
@@ -336,9 +336,9 @@
}
},
"node_modules/@vitejs/plugin-react": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.3.tgz",
"integrity": "sha512-vmFvco5/QuC2f9Oj+wTk0+9XeDFkHxSamwZKYc7MxYwKICfvUvlMhqKI0VuICPltGqh1neqBKDvO4kes1ya8vg==",
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.4.tgz",
"integrity": "sha512-XcCQz0TBpBgljhj0gMuuDj49i6Ytqh5q1osT/Gp5uAVJUCTWxyskk/l1jwYYiu2xcNHHipdMz40EGfM1VdamVg==",
"dev": true,
"dependencies": {
"@rolldown/pluginutils": "^1.0.1"
@@ -726,22 +726,22 @@
}
},
"node_modules/react": {
"version": "19.2.7",
"resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz",
"integrity": "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==",
"version": "19.2.8",
"resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz",
"integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/react-dom": {
"version": "19.2.7",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.7.tgz",
"integrity": "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==",
"version": "19.2.8",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.8.tgz",
"integrity": "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==",
"dependencies": {
"scheduler": "^0.27.0"
},
"peerDependencies": {
"react": "^19.2.7"
"react": "^19.2.8"
}
},
"node_modules/react-router": {
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "opengym-frontend",
"private": true,
"version": "1.1.2",
"version": "1.2.1",
"type": "module",
"scripts": {
"dev": "vite",
+15 -2
View File
@@ -1,10 +1,13 @@
import { useEffect } from 'react'
import { HashRouter, Routes, Route, Navigate, useNavigate, useLocation } from 'react-router-dom'
import { useStore } from './store/useStore.js'
import { useUI } from './store/useUI.js'
import { bindUI } from './components/ui.jsx'
import { ACCENTS } from './lib/format.js'
import { setLang, useLang } from './lib/i18n.js'
import { setNav } from './lib/nav.js'
import { startFlow } from './sheets.jsx'
import Icon from './components/Icon.jsx'
import TabBar from './components/TabBar.jsx'
import Modals from './components/Modals.jsx'
import Toast from './components/Toast.jsx'
@@ -18,13 +21,16 @@ import Stats from './views/Stats.jsx'
import History from './views/History.jsx'
import Library from './views/Library.jsx'
import Settings from './views/Settings.jsx'
import Admin from './views/Admin.jsx'
bindUI(useUI) // lets the shared controls open sheets without importing the store at module scope
function applyPrefs(theme, accent) {
const de = document.documentElement
de.dataset.theme = theme === 'light' ? 'light' : 'dark'
de.dataset.accent = ACCENTS[accent] ? accent : 'lime'
const meta = document.querySelector('meta[name="theme-color"]')
if (meta) meta.content = de.dataset.theme === 'light' ? '#f2f4f7' : '#0c0e12'
if (meta) meta.content = de.dataset.theme === 'light' ? '#f2f2f7' : '#000000'
}
function Shell() {
@@ -41,7 +47,13 @@ function Shell() {
useEffect(() => { window.scrollTo(0, 0) }, [loc.pathname])
const authed = user || isGuest
if (!ready && !authed) return <div id="app"><div style={{ paddingTop: '42vh', textAlign: 'center', fontSize: '2.2rem' }}>🏋️</div></div>
if (!ready && !authed) return (
<div id="app">
<div style={{ paddingTop: '44vh', display: 'flex', justifyContent: 'center', fontSize: 34, color: 'var(--label-3)' }}>
<Icon name="dumbbell" />
</div>
</div>
)
return (
<>
@@ -56,6 +68,7 @@ function Shell() {
<Route path="/history" element={<History />} />
<Route path="/library" element={<Library />} />
<Route path="/settings" element={<Settings />} />
<Route path="/admin" element={user?.admin ? <Admin /> : <Navigate to="/home" replace />} />
<Route path="*" element={<Navigate to="/home" replace />} />
</Routes>
)}
+71
View File
@@ -0,0 +1,71 @@
import { useEffect, useState } from 'react'
import { MUSCLES, INERT, MUSCLE_NAME, levelsOf } from '../lib/muscles.js'
import { t } from '../lib/i18n.js'
// Front and back views of a body, each muscle shaded by how hard it was worked.
//
// The five shade steps are the same ones the activity heatmap uses (.hm-c.l0…l4), so
// "more accent = more training" means one thing everywhere in the app rather than two.
//
// The geometry is ~90 KB and only some screens show a map, so it is fetched on first
// render instead of riding along in the main bundle. Until it lands the component
// renders nothing but keeps its height, so nothing below it jumps on arrival.
let CACHE = null // shared across every mounted map
let PENDING = null
function useBodyPaths() {
const [paths, setPaths] = useState(CACHE)
useEffect(() => {
if (CACHE) return
let alive = true
PENDING = PENDING || import('../lib/body-paths.js').then(m => (CACHE = m.default))
PENDING.then(p => { if (alive) setPaths(p) }).catch(() => {})
return () => { alive = false }
}, [])
return paths
}
function View({ view, levels, onMuscle, selected }) {
return (
<svg className="bm-v" viewBox={view.vb} role="img">
{INERT.map(slug => (view.p[slug] || []).map((d, i) =>
<path key={slug + i} className="bm-sil" d={d} />))}
{MUSCLES.map(slug => (view.p[slug] || []).map((d, i) =>
<path
key={slug + i}
className={'bm-m l' + (levels[slug] || 0) + (selected === slug ? ' sel' : '')}
d={d}
onClick={onMuscle ? () => onMuscle(slug) : undefined}
>
<title>{t(MUSCLE_NAME[slug])}</title>
</path>))}
</svg>
)
}
/**
* <BodyMap load={{ chest: 12, … }} body="male" />
* `load` is effective sets per muscle (see lib/muscles.js); shading is relative to
* the hardest-worked muscle in that same load, so it always reads as a balance.
*/
export default function BodyMap({ load = {}, body = 'male', onMuscle, selected, className = '' }) {
const paths = useBodyPaths()
const levels = levelsOf(load)
const g = paths && (paths[body] || paths.male)
return (
<div className={'bodymap ' + className}>
{g ? <>
<View view={g.front} levels={levels} onMuscle={onMuscle} selected={selected} />
<View view={g.back} levels={levels} onMuscle={onMuscle} selected={selected} />
</> : <div className="bm-ph" aria-hidden="true" />}
</div>
)
}
export function BodyMapLegend() {
return <div className="hm-legend">
{t('Less')} <div className="hm-c l0" /><div className="hm-c l1" /><div className="hm-c l2" />
<div className="hm-c l3" /><div className="hm-c l4" /> {t('More')}
</div>
}
+142
View File
@@ -0,0 +1,142 @@
// openGym icon set — hand-drawn on a 24×24 grid, stroke-based, single weight.
//
// Everything is one <svg> primitive with `currentColor`, so an icon inherits the
// text colour and optical size of whatever it sits in. No emoji anywhere in the
// chrome: emoji render differently on every platform, sit on their own baseline
// and can't take a theme colour, which is what made the old UI feel assembled
// rather than designed.
//
// Conventions, so a new icon never looks foreign next to an old one:
// · 24×24 viewBox, live area 3…21 — 3px of optical padding all round
// · strokes only (no fills) except where a shape reads better solid (star.fill)
// · round caps + round joins, stroke width from --icon-stroke (1.7 default)
// · geometry snapped to .5 so it lands on pixel edges at 24px
const P = {
/* ---- navigation ---- */
house: <path d="M3.5 10.7 12 3.8l8.5 6.9M5.9 9.4V19a1.4 1.4 0 0 0 1.4 1.4h9.4A1.4 1.4 0 0 0 18.1 19V9.4" />,
calendar: <><rect x="3.4" y="5.2" width="17.2" height="15.4" rx="3.2" /><path d="M8.2 3.4v3.4M15.8 3.4v3.4M3.4 10.2h17.2" /></>,
chart: <path d="M4.5 20.2V13M9.5 20.2V6.4M14.5 20.2v-5.1M19.5 20.2V9.6" />,
magnifier: <><circle cx="11" cy="11" r="7" /><path d="m20.5 20.5-4.4-4.4" /></>,
// A real cog outline (8 teeth, generated on a circle) — an earlier version drew
// radial rays and was indistinguishable from `sun` at tab-bar size.
gear: <><path d="M20.48 10.59 20.48 13.41 18.58 13.72 17.87 15.43 19 17 17 19 15.43 17.87 13.72 18.58 13.41 20.48 10.59 20.48 10.28 18.58 8.57 17.87 7 19 5 17 6.13 15.43 5.42 13.72 3.52 13.41 3.52 10.59 5.42 10.28 6.13 8.57 5 7 7 5 8.57 6.13 10.28 5.42 10.59 3.52 13.41 3.52 13.72 5.42 15.43 6.13 17 5 19 7 17.87 8.57 18.58 10.28Z" /><circle cx="12" cy="12" r="3.1" /></>,
/* ---- training ---- */
dumbbell: <><rect x="5.9" y="7.9" width="3.2" height="8.2" rx="1.3" /><rect x="14.9" y="7.9" width="3.2" height="8.2" rx="1.3" /><path d="M9.1 12h5.8M3.6 9.9v4.2M20.4 9.9v4.2" /></>,
barbell: <path d="M2.9 12h18.2M7.4 7.4v9.2M9.8 9.3v5.4M16.6 7.4v9.2M14.2 9.3v5.4" />,
figureRun: <><circle cx="14.2" cy="4.9" r="1.9" /><path d="M13.4 9.1 9.6 11.4l1.7 3.3-2.4 5.4M13.4 9.1l3.4 1.5 1.4 3.4M11.3 14.7l4.3.9 1.5 4.5M9.6 11.4 6 10.2" /></>,
figureStrength: <><circle cx="12" cy="5.2" r="2" /><path d="M12 8.4v5.6M12 14 9.2 20.5M12 14l2.8 6.5M8 10.6h8M5.4 9.1v3M18.6 9.1v3" /></>,
scale: <><rect x="3.4" y="4.4" width="17.2" height="16.2" rx="3.4" /><path d="M8.3 9.2a3.9 3.9 0 0 1 7.4 0" /><path d="M12 9.2v2.5M8.9 16.2h6.2" /></>,
flame: <path d="M12 20.4c3.2 0 5.4-2.1 5.4-5.1 0-3.9-3.4-5.6-2.6-9.8-2.5.8-4 2.9-4 5.1 0 1-.5 1.6-1.2 1.6-.8 0-1.2-.7-1.2-1.8-1.1 1.2-1.8 2.9-1.8 4.9 0 3 2.2 5.1 5.4 5.1Z" />,
timer: <><circle cx="12" cy="13.4" r="7.2" /><path d="M12 9.6v3.8h2.8M9.6 3.4h4.8" /></>,
clock: <><circle cx="12" cy="12" r="8.2" /><path d="M12 7.4V12l3.1 1.9" /></>,
/* ---- status / achievement ---- */
trophy: <><path d="M7.6 4h8.8v4.6a4.4 4.4 0 0 1-8.8 0Z" /><path d="M7.6 5.6H4.9v1.5a3 3 0 0 0 2.9 3M16.4 5.6h2.7v1.5a3 3 0 0 1-2.9 3M12 13v3.4M8.6 20.4h6.8l-.7-4H9.3Z" /></>,
medal: <><circle cx="12" cy="14.8" r="5.2" /><circle cx="12" cy="14.8" r="1.9" /><path d="M9.1 9.9 6.4 3.6M14.9 9.9l2.7-6.3" /></>,
target: <><circle cx="12" cy="12" r="8.2" /><circle cx="12" cy="12" r="4.6" /><circle cx="12" cy="12" r="1.1" /></>,
star: <path d="m12 3.9 2.6 5.3 5.8.8-4.2 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8-4.2-4.1 5.8-.8Z" />,
starFill: <path d="m12 3.9 2.6 5.3 5.8.8-4.2 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8-4.2-4.1 5.8-.8Z" fill="currentColor" stroke="none" />,
crown: <path d="M4.2 17.6h15.6M4.2 17.6 3.4 7.2l4.6 3.2L12 4.6l4 5.8 4.6-3.2-.8 10.4Z" />,
bolt: <path d="M13.4 3.4 5.6 13.6h5.2l-.2 7 7.8-10.2h-5.2Z" />,
shield: <path d="M12 3.6 5 6.2v5.5c0 4 2.9 7.5 7 8.7 4.1-1.2 7-4.7 7-8.7V6.2Z" />,
heart: <path d="M12 20c-.4 0-.8-.1-1-.4l-6.2-6a4.6 4.6 0 0 1 0-6.6 4.4 4.4 0 0 1 6.2 0l1 1 1-1a4.4 4.4 0 0 1 6.2 0 4.6 4.6 0 0 1 0 6.6l-6.2 6c-.2.3-.6.4-1 .4Z" />,
rocket: <><path d="M12 3.6c2.8 2.5 4.2 5.7 4.2 9.1v4.5H7.8v-4.5c0-3.4 1.4-6.6 4.2-9.1Z" /><circle cx="12" cy="10.3" r="1.8" /><path d="M7.8 14 5.2 16.6v3.8l2.6-2M16.2 14l2.6 2.6v3.8l-2.6-2" /></>,
sparkles: <><path d="m8.4 3.8 1.1 2.9 2.9 1.1-2.9 1.1-1.1 2.9-1.1-2.9L4.4 7.8l2.9-1.1Z" /><path d="m16.2 12.4.8 2.1 2.1.8-2.1.8-.8 2.1-.8-2.1-2.1-.8 2.1-.8Z" /></>,
lightbulb: <><path d="M9.2 16.4a5.6 5.6 0 1 1 5.6 0v1.8H9.2Z" /><path d="M10 20.6h4" /></>,
/* ---- routine glyphs: what a training day actually is ---- */
// Named after the split or the kit, because that's how people name routines
// ("Push Day", "Leg Day", "Kettlebell") — an award icon says nothing about it.
arm: <><circle cx="7" cy="5.8" r="1.9" /><path d="M7 8.8v4.6l-1.2 6.2M7 11.4l4.4 1.9" /><rect x="12.2" y="10.8" width="2.3" height="5" rx=".9" /><rect x="15.9" y="10.8" width="2.3" height="5" rx=".9" /><path d="M14.5 13.3h1.4" /></>,
abs: <><path d="M7.8 4.4h8.4v10.4a4.2 4.2 0 0 1-8.4 0Z" /><path d="M12 5.4v12M8.2 9h7.6M8.6 12.7h6.8" /></>,
legs: <><path d="M8.4 4.2h7.2" /><path d="M9.9 4.2v4.9l-1.3 4.4.9 6.3M14.1 4.2v4.9l1.3 4.4-.9 6.3" /><path d="M7.7 19.8h2.6M13.7 19.8h2.6" /></>,
pullup: <><path d="M3.6 5.1h16.8M8.5 5.5v2.3M15.5 5.5v2.3" /><circle cx="12" cy="10.5" r="1.9" /><path d="m8.5 7.8 3.5 5 3.5-5M12 13.3v3.9M12 17.2l-2.1 3.2M12 17.2l2.1 3.2" /></>,
kettlebell: <><path d="M9.5 11V9.6a2.5 2.5 0 0 1 5 0V11" /><path d="M14.9 11.8c2.2 1.5 3.6 3.9 3.6 6.4a1.6 1.6 0 0 1-1.6 1.6H7.1a1.6 1.6 0 0 1-1.6-1.6c0-2.5 1.4-4.9 3.6-6.4Z" /></>,
plate: <><circle cx="12" cy="12" r="8.2" /><circle cx="12" cy="12" r="2.7" /></>,
machine: <><path d="M12 3.6v3.1" /><rect x="6.6" y="6.7" width="10.8" height="12.9" rx="1.9" /><path d="M9 10.1h6M9 13.2h6M9 16.3h6" /></>,
bike: <><circle cx="6.2" cy="16.2" r="3.5" /><circle cx="17.8" cy="16.2" r="3.5" /><path d="m6.2 16.2 4.3-7.4h4.9l2.4 7.4M9.3 8.8h4.5M13.8 8.8l-2.6 7.4" /></>,
swim: <><circle cx="8.8" cy="8.2" r="1.8" /><path d="m10.9 10 4.6-2.2 3.3 3.4" /><path d="M3.5 15.6c1.6-1.3 3.1-1.3 4.7 0s3.1 1.3 4.7 0 3.1-1.3 4.7 0c.9.7 1.7.9 2.6.5" /></>,
boxing: <><path d="M7.6 8.6A4.6 4.6 0 0 1 12.2 4h1.6a5.4 5.4 0 0 1 5.4 5.4v2.4a3 3 0 0 1-3 3H7.6Z" /><path d="M7.6 14.8v2.3a2.6 2.6 0 0 0 2.6 2.6h5.2a2.6 2.6 0 0 0 2.6-2.6v-2.3" /><path d="M7.6 9.8H6.3a1.8 1.8 0 0 0 0 3.6h1.3" /></>,
stretch: <><circle cx="14.4" cy="5.4" r="1.9" /><path d="M14.4 8.2c-3 1.4-5 4-5.8 7.4" /><path d="M8.6 15.6 6.2 20M8.6 15.6l4.6 4.4" /><path d="M12.6 9.6 18 12" /></>,
/* ---- actions ---- */
plus: <path d="M12 5.2v13.6M5.2 12h13.6" />,
minus: <path d="M5.2 12h13.6" />,
check: <path d="m4.8 12.6 4.8 4.8L19.2 6.8" />,
checkCircle: <><circle cx="12" cy="12" r="8.2" /><path d="m8.2 12.2 2.7 2.7 5.1-5.4" /></>,
xmark: <path d="M6.2 6.2 17.8 17.8M17.8 6.2 6.2 17.8" />,
pencil: <><path d="M17.1 3.9a2.1 2.1 0 0 1 3 3l-9.9 9.9-4 1 1-4Z" /><path d="m15.1 5.9 3 3" /></>,
trash: <><path d="M4.8 6.6h14.4M9.4 6.6V4.8a1.2 1.2 0 0 1 1.2-1.2h2.8a1.2 1.2 0 0 1 1.2 1.2v1.8" /><path d="M6.6 6.6 7.4 19a1.6 1.6 0 0 0 1.6 1.4h6a1.6 1.6 0 0 0 1.6-1.4l.8-12.4" /><path d="M10.4 10.2v6.4M13.6 10.2v6.4" /></>,
link: <><path d="M10.2 13.8a3.6 3.6 0 0 0 5.4.4l2.6-2.6a3.6 3.6 0 0 0-5.1-5.1l-1.5 1.5" /><path d="M13.8 10.2a3.6 3.6 0 0 0-5.4-.4l-2.6 2.6a3.6 3.6 0 0 0 5.1 5.1l1.5-1.5" /></>,
play: <path d="M8.4 5.6 18 12l-9.6 6.4Z" />,
pause: <path d="M9.4 5.8v12.4M14.6 5.8v12.4" />,
reset: <><path d="M4.4 12a7.6 7.6 0 1 0 2.3-5.4" /><path d="M4 4.4v4.4h4.4" /></>,
bell: <><path d="M6.6 10.4a5.4 5.4 0 0 1 10.8 0c0 4 1.4 5.6 1.4 5.6H5.2s1.4-1.6 1.4-5.6Z" /><path d="M10.1 19.2a2.1 2.1 0 0 0 3.8 0" /></>,
bellSlash: <><path d="M8.1 6.6a5.4 5.4 0 0 1 9.3 3.8c0 4 1.4 5.6 1.4 5.6H9.4M6.6 16H5.2s1.4-1.6 1.4-5.6v-.6" /><path d="M10.1 19.2a2.1 2.1 0 0 0 3.8 0M4 3.6l16 16.8" /></>,
chevronRight: <path d="m9.6 5.6 6.6 6.4-6.6 6.4" />,
chevronLeft: <path d="m14.4 5.6-6.6 6.4 6.6 6.4" />,
chevronDown: <path d="m5.6 9.4 6.4 6.2 6.4-6.2" />,
chevronUp: <path d="m5.6 14.6 6.4-6.2 6.4 6.2" />,
arrowUp: <path d="M12 19.6V4.4M6.2 10.6 12 4.4l5.8 6.2" />,
arrowDown: <path d="M12 4.4v15.2M6.2 13.4 12 19.6l5.8-6.2" />,
expand: <path d="M14.4 4.4h5.2v5.2M9.6 19.6H4.4v-5.2M19.6 4.4 13.8 10.2M4.4 19.6l5.8-5.8" />,
minimize: <path d="M19.6 9.6h-5.2V4.4M4.4 14.4h5.2v5.2M14.4 9.6l5.2-5.2M9.6 14.4l-5.2 5.2" />,
/* ---- objects ---- */
person: <><circle cx="12" cy="8" r="3.8" /><path d="M4.8 20.4a7.2 7.2 0 0 1 14.4 0" /></>,
personCircle: <><circle cx="12" cy="12" r="8.4" /><circle cx="12" cy="10" r="2.9" /><path d="M6.6 18.4a5.8 5.8 0 0 1 10.8 0" /></>,
clipboard: <><rect x="5.4" y="4.8" width="13.2" height="15.8" rx="2.6" /><path d="M9 4.8a1.6 1.6 0 0 1 1.6-1.6h2.8A1.6 1.6 0 0 1 15 4.8v1.4H9Z" /><path d="M9.2 11.6h5.6M9.2 15.2h4" /></>,
list: <path d="M8.4 6.6h11.2M8.4 12h11.2M8.4 17.4h11.2M4.6 6.6h.01M4.6 12h.01M4.6 17.4h.01" />,
folder: <path d="M3.6 7.4a2 2 0 0 1 2-2h3.1l2 2.4h6.7a2 2 0 0 1 2 2v7.8a2 2 0 0 1-2 2H5.6a2 2 0 0 1-2-2Z" />,
globe: <><circle cx="12" cy="12" r="8.2" /><path d="M3.8 12h16.4M12 3.8c2.1 2.2 3.2 5.1 3.2 8.2s-1.1 6-3.2 8.2c-2.1-2.2-3.2-5.1-3.2-8.2s1.1-6 3.2-8.2Z" /></>,
moon: <path d="M19.4 14.2A7.8 7.8 0 0 1 9.8 4.6a8.2 8.2 0 1 0 9.6 9.6Z" />,
sun: <><circle cx="12" cy="12" r="4.4" /><path d="M12 3.6v2M12 18.4v2M20.4 12h-2M5.6 12h-2M17.94 6.06l-1.42 1.42M7.48 16.52l-1.42 1.42M17.94 17.94l-1.42-1.42M7.48 7.48 6.06 6.06" /></>,
key: <><circle cx="8.2" cy="15.8" r="3.8" /><path d="m10.9 13.1 8-8M16.6 7.4l2 2M14.6 9.4l2 2" /></>,
lock: <><rect x="5" y="10.4" width="14" height="10" rx="2.8" /><path d="M8.4 10.4V7.8a3.6 3.6 0 0 1 7.2 0v2.6" /></>,
download: <path d="M12 3.8v11.4M7.6 11.2 12 15.6l4.4-4.4M4.6 19.4h14.8" />,
upload: <path d="M12 15.6V4.2M7.6 8.2 12 3.8l4.4 4.4M4.6 19.4h14.8" />,
wrench: <path d="M15.2 3.9a5 5 0 0 0-4.8 6.6l-6 6a2.1 2.1 0 0 0 3 3l6-6a5 5 0 0 0 6.1-6.3l-2.9 2.9-2.8-.7-.7-2.8Z" />,
// checkered, not a pennant — this marks "finish workout", and a 2×2 grid is
// what reads as a finish line at 16px
flag: <><path d="M6 20.4V4.2" /><path d="M6.4 5.2h13v9.2h-13" /><path d="M12.9 5.2v9.2M6.4 9.8h13" /></>,
chartLine: <path d="M3.6 20.2V4.4M3.6 20.2h16.8M6.4 16.4l3.9-4.8 3.1 2.7 5.2-6.6" />,
dot: <circle cx="12" cy="12" r="4.2" fill="currentColor" stroke="none" />,
history: <><path d="M4.5 12.2a7.6 7.6 0 1 0 2.5-5.6" /><path d="M4.1 4.4v4.3h4.3" /><path d="M12 8.3v4.2l3.1 1.9" /></>,
signOut: <><path d="M14.2 4.6H7a1.9 1.9 0 0 0-1.9 1.9v11a1.9 1.9 0 0 0 1.9 1.9h7.2" /><path d="m16.8 8.4 3.6 3.6-3.6 3.6M20.4 12H10.2" /></>,
shuffle: <><path d="M3.6 7.2h2.9c1.6 0 2.8.9 3.8 2.4l3 4.8c1 1.5 2.2 2.4 3.8 2.4h2.9M3.6 16.8h2.9c1.6 0 2.8-.9 3.8-2.4l.7-1.1M15.6 9.9l.7-1.1c1-1.5 2.2-2.4 3.8-2.4h1.9" /><path d="m17.9 4.3 2.8 2.1-2.8 2.1M17.9 14.7l2.8 2.1-2.8 2.1" /></>,
info: <><circle cx="12" cy="12" r="8.2" /><path d="M12 11v5.4" /><circle cx="12" cy="7.9" r=".9" fill="currentColor" stroke="none" /></>,
}
// A few keys are aliases so call sites can say what they mean.
P.search = P.magnifier
P.settings = P.gear
P.exercises = P.magnifier
P.weight = P.scale
P.streak = P.flame
P.done = P.check
export const ICON_NAMES = Object.keys(P)
/**
* <Icon name="flame" /> — inherits font-size via `1em` sizing
* <Icon name="flame" size={28} /> — explicit pixel size
*/
export default function Icon({ name, size, className = '', style, ...rest }) {
const d = P[name]
if (!d) return null
const s = size ? { width: size, height: size } : null
return (
<svg
className={'icn ' + className}
viewBox="0 0 24 24"
aria-hidden="true"
focusable="false"
style={s ? { ...s, ...style } : style}
{...rest}
>
{d}
</svg>
)
}
+36 -12
View File
@@ -1,14 +1,37 @@
import { useRef, useState } from 'react'
import { useLayoutEffect, useRef, useState } from 'react'
import { fmtNum, fmtDate, MONTHS, isoOf } from '../lib/format.js'
import { t } from '../lib/i18n.js'
const W = 340 // viewBox width; the svg stretches to its container, height comes from `h`
// points: [{ t: ms, y: num, d?: iso }] sorted by t. opts: { h, unit, color, axes, goal }
export default function LineChart({ points, h = 150, unit = '', color = 'var(--acc)', axes = true, goal = null }) {
const svgRef = useRef(null)
const wrapRef = useRef(null)
const tipRef = useRef(null)
const [hover, setHover] = useState(null) // { x, y, iso, v }
// The tooltip is placed after layout, from its measured size, because the chart
// lives in an overflow-clipped box: a fixed half-width offset (what this used to
// do) hangs the label off the edge on the first and last point, and the clip then
// eats it. Reading offsetWidth here also covers translated labels, which are not
// all the same length. Writing straight to the node's style keeps this off the
// render path — hover fires on every mouse move.
useLayoutEffect(() => {
const tip = tipRef.current, wrap = wrapRef.current
if (!hover || !tip || !wrap) return
const cw = wrap.clientWidth, ch = wrap.clientHeight
const tw = tip.offsetWidth, th = tip.offsetHeight
const M = 4 // breathing room against the clip
const cx = hover.x / W * cw, cy = hover.y / h * ch
tip.style.left = Math.max(M, Math.min(cw - tw - M, cx - tw / 2)) + 'px'
// Parked at the top, but dropped below the point when the point sits high
// enough that the label would cover the very value it is reporting.
tip.style.top = (cy < th + 14 ? Math.min(ch - th - M, cy + 14) : M) + 'px'
})
if (!points || points.length === 0) return <div className="empty small">{t('No data yet')}</div>
const W = 340, H = h
const H = h
const P = { l: axes ? 34 : 8, r: 12, t: 10, b: axes ? 22 : 8 }
const single = points.length === 1
const pts = single ? [points[0], points[0]] : points
@@ -30,8 +53,8 @@ export default function LineChart({ points, h = 150, unit = '', color = 'var(--a
for (let v = Math.ceil(ymin / step) * step; v <= ymax + 1e-9; v += step) {
const y = Y(v)
gridlines.push(<g key={'y' + v}>
<line x1={P.l} y1={y} x2={W - P.r} y2={y} stroke="var(--line)" strokeWidth="1" strokeDasharray="2 4" />
<text x={P.l - 5} y={y + 3.5} textAnchor="end" fontSize="9.5" fill="var(--dim)">{fmtNum(v)}</text>
<line x1={P.l} y1={y} x2={W - P.r} y2={y} stroke="var(--sep-op)" strokeWidth="1" strokeDasharray="2 4" />
<text x={P.l - 5} y={y + 3.5} textAnchor="end" fontSize="9.5" fill="var(--label-2)">{fmtNum(v)}</text>
</g>)
}
const d0 = new Date(t0), d1 = new Date(t1)
@@ -49,8 +72,8 @@ export default function LineChart({ points, h = 150, unit = '', color = 'var(--a
if (i % every) return
const x = X(tk.t)
gridlines.push(<g key={'x' + i}>
<line x1={x} y1={P.t} x2={x} y2={H - P.b} stroke="var(--line)" strokeWidth="1" strokeDasharray="2 4" />
<text x={x} y={H - 7} textAnchor={tk.anchor || 'middle'} fontSize="9.5" fill="var(--dim)">{tk.txt}</text>
<line x1={x} y1={P.t} x2={x} y2={H - P.b} stroke="var(--sep-op)" strokeWidth="1" strokeDasharray="2 4" />
<text x={x} y={H - 7} textAnchor={tk.anchor || 'middle'} fontSize="9.5" fill="var(--label-2)">{tk.txt}</text>
</g>)
})
}
@@ -72,8 +95,9 @@ export default function LineChart({ points, h = 150, unit = '', color = 'var(--a
}
return (
<div className="chart-i"
<div className="chart-i" ref={wrapRef}
onMouseMove={onMove} onMouseDown={onMove}
onMouseLeave={() => setHover(null)}
onTouchStart={onMove} onTouchMove={onMove}>
<svg ref={svgRef} viewBox={`0 0 ${W} ${H}`} preserveAspectRatio="none" style={{ aspectRatio: `${W}/${H}` }}>
<defs><linearGradient id={gid} x1="0" y1="0" x2="0" y2="1">
@@ -82,19 +106,19 @@ export default function LineChart({ points, h = 150, unit = '', color = 'var(--a
</linearGradient></defs>
{gridlines}
{goal != null && isFinite(goal) && <>
<line x1={P.l} y1={Y(goal)} x2={W - P.r} y2={Y(goal)} stroke="var(--gold)" strokeWidth="1.6" strokeDasharray="7 4" />
<text x={W - P.r - 2} y={Y(goal) - 5} textAnchor="end" fontSize="9.5" fontWeight="700" fill="var(--gold)">🎯 {fmtNum(goal)}</text>
<line x1={P.l} y1={Y(goal)} x2={W - P.r} y2={Y(goal)} stroke="var(--yellow)" strokeWidth="1.6" strokeDasharray="7 4" />
<text x={W - P.r - 2} y={Y(goal) - 5} textAnchor="end" fontSize="9.5" fontWeight="700" fill="var(--yellow)">{fmtNum(goal)}</text>
</>}
<polygon points={`${P.l},${H - P.b} ${poly} ${X(last.t).toFixed(1)},${H - P.b}`} fill={`url(#${gid})`} />
<polyline points={poly} fill="none" stroke={color} strokeWidth="2.5" strokeLinejoin="round" strokeLinecap="round" />
<circle cx={X(last.t)} cy={Y(last.y)} r="4" fill={color} />
{hover && <g>
<line className="cvl" x1={hover.x} y1={P.t} x2={hover.x} y2={H - P.b} stroke="var(--mut)" strokeWidth="1" strokeDasharray="3 3" />
<line className="chl" x1={P.l} y1={hover.y} x2={W - P.r} y2={hover.y} stroke="var(--mut)" strokeWidth="1" strokeDasharray="3 3" />
<line className="cvl" x1={hover.x} y1={P.t} x2={hover.x} y2={H - P.b} stroke="var(--label-3)" strokeWidth="1" strokeDasharray="3 3" />
<line className="chl" x1={P.l} y1={hover.y} x2={W - P.r} y2={hover.y} stroke="var(--label-3)" strokeWidth="1" strokeDasharray="3 3" />
<circle cx={hover.x} cy={hover.y} r="5" fill={color} stroke="var(--bg)" strokeWidth="2" />
</g>}
</svg>
{hover && <div className="ctip" style={{ left: `calc(${hover.x / W * 100}% - 55px)` }}>
{hover && <div className="ctip" ref={tipRef}>
{fmtDate(hover.iso, true)} · {fmtNum(hover.v)}{unit ? ' ' + unit : ''}
</div>}
</div>
+22 -4
View File
@@ -1,21 +1,39 @@
import { useState } from 'react'
import { imgSrc, gifSrc } from '../lib/exercises.js'
import { useStore } from '../store/useStore.js'
import { t } from '../lib/i18n.js'
import Icon from './Icon.jsx'
// Big autoplaying animation; tap toggles to the still frame. `compact` shrinks it (superset cards).
// Custom exercises have no media — the animation stays blank by design (issue #11).
export default function Media({ ex, id, compact }) {
// `minimizable` (workout view) adds a persistent minimize/expand control so the animation stops
// eating the screen; the chosen size is saved to settings and carries across exercises and
// future workouts (issue #12).
export default function Media({ ex, id, compact, minimizable }) {
const [playing, setPlaying] = useState(true)
const gifSize = useStore(s => s.S.gifSize)
const update = useStore(s => s.update)
if (!ex.gif) return null
const mini = minimizable && gifSize === 'mini'
const toggleSize = e => { e.stopPropagation(); update(s => { s.gifSize = mini ? 'full' : 'mini' }) }
return (
<div className={'exmedia' + (compact ? ' compact' : '')} id={id} onClick={() => setPlaying(p => !p)}>
<div className={'exmedia' + (compact ? ' compact' : '') + (mini ? ' mini' : '')} id={id} onClick={() => setPlaying(p => !p)}>
<img decoding="async" src={playing ? gifSrc(ex) : imgSrc(ex)} alt={ex.n} />
<span className="gifhint">{playing ? '⏸ ' + t('tap to pause') : '▶ ' + t('tap to play')}</span>
{minimizable && (
<button className="giftoggle" onClick={toggleSize}>
<Icon name={mini ? 'expand' : 'minimize'} />{mini ? t('Expand') : t('Minimize')}
</button>
)}
{!mini && (
<span className="gifhint">
<Icon name={playing ? 'pause' : 'play'} />{playing ? t('tap to pause') : t('tap to play')}
</span>
)}
</div>
)
}
export function Thumb({ ex }) {
if (!ex.img) return <div className="thumb thumb-x">🏋️</div>
if (!ex.img) return <div className="thumb thumb-x"><Icon name="dumbbell" /></div>
return <img className="thumb" loading="lazy" decoding="async" src={imgSrc(ex)} alt="" />
}
+3 -31
View File
@@ -1,31 +1,3 @@
import { useRef, useState } from 'react'
// Numeric input that accepts "," as decimal separator — iOS decimal keypads in many
// locales only offer a comma, and type="number" reports "" for it (value snaps to 0).
// Keeps a local string draft while focused so partial input like "33," survives typing.
export default function NumField({ value, onChange, decimal = true, ...rest }) {
const [draft, setDraft] = useState(null)
const committed = useRef(null)
// external change (e.g. −/+ buttons) while a draft is showing → drop the draft
if (draft !== null && committed.current !== value) { setDraft(null); committed.current = null }
const commit = raw => {
let s = raw.replace(/,/g, '.').replace(/[^0-9.]/g, '')
const i = s.indexOf('.')
if (i !== -1) s = decimal ? s.slice(0, i + 1) + s.slice(i + 1).replace(/\./g, '') : s.slice(0, i)
const n = s === '' || s === '.' ? 0 : Math.max(0, parseFloat(s))
committed.current = n
setDraft(s)
onChange(n)
}
return (
<input
type="text"
inputMode={decimal ? 'decimal' : 'numeric'}
value={draft ?? (value ?? '')}
onFocus={e => e.target.select()}
onChange={e => commit(e.target.value)}
onBlur={() => { setDraft(null); committed.current = null }}
{...rest}
/>
)
}
// Kept as a module so existing imports keep working — the implementation now
// lives in the shared control set.
export { NumberField as default } from './ui.jsx'
+4 -2
View File
@@ -1,5 +1,7 @@
import { useUI } from '../store/useUI.js'
import { t } from '../lib/i18n.js'
import { Button } from './ui.jsx'
export default function RestTimer() {
const timer = useUI(s => s.timer)
const { addRest, stopRest } = useUI()
@@ -10,8 +12,8 @@ export default function RestTimer() {
<div id="timer">
<div className="t">{m}:{s}</div>
<div className="bar"><i style={{ width: pct + '%' }} /></div>
<button className="btn sm" onClick={() => addRest(15)}>+15s</button>
<button className="btn sm primary" onClick={stopRest}>{t('Skip')}</button>
<Button size="sm" icon="plus" onClick={() => addRest(15)}>15s</Button>
<Button size="sm" variant="primary" onClick={stopRest}>{t('Skip')}</Button>
</div>
)
}
+3 -20
View File
@@ -1,20 +1,3 @@
import NumField from './NumField.jsx'
// Number field with −/+ buttons; tapping the field selects its content so typing replaces.
export default function Stepper({ value, step = 1, onChange, decimal = true, className = '', label }) {
const set = v => onChange(Math.max(0, Math.round((v || 0) * 100) / 100))
const inner = (
<div className={'step ' + className}>
<button onClick={() => set((+value || 0) - step)}>−</button>
<NumField value={value} decimal={decimal} onChange={onChange} />
<button onClick={() => set((+value || 0) + step)}>+</button>
</div>
)
if (!label) return inner
return (
<div>
<div className="small muted" style={{ marginBottom: 5, textAlign: 'center' }}>{label}</div>
{inner}
</div>
)
}
// Kept as a module so existing imports keep working — the implementation now
// lives in the shared control set.
export { Stepper as default } from './ui.jsx'
+11 -13
View File
@@ -3,13 +3,7 @@ import { useStore } from '../store/useStore.js'
import { effectiveRoutine } from '../lib/history.js'
import { todayISO } from '../lib/format.js'
import { t } from '../lib/i18n.js'
const ICONS = {
home: <path d="M3 10.5 12 3l9 7.5M5 9.5V21h14V9.5" />,
plan: <><rect x="3" y="5" width="18" height="16" rx="2" /><path d="M8 3v4M16 3v4M3 11h18" /></>,
stats: <path d="M4 20V10M10 20V4M16 20v-8M22 20H2" />,
library: <><circle cx="11" cy="11" r="7" /><path d="m21 21-4.3-4.3" /></>
}
import Icon from './Icon.jsx'
export default function TabBar({ onStart }) {
const nav = useNavigate()
@@ -28,18 +22,22 @@ export default function TabBar({ onStart }) {
}
nav('/workout')
}
const Icon = ({ k }) => <svg viewBox="0 0 24 24">{ICONS[k]}</svg>
const Tab = ({ k, icon, to, label }) => (
<button className={on(k) ? 'on' : ''} onClick={() => nav(to)}>
<Icon name={icon} /><span>{label}</span>
</button>
)
return (
<nav id="tabbar">
<button className={on('home') ? 'on' : ''} onClick={() => nav('/home')}><Icon k="home" /><span>{t('Home')}</span></button>
<button className={on('plan') ? 'on' : ''} onClick={() => nav('/plan')}><Icon k="plan" /><span>{t('Plan')}</span></button>
<Tab k="home" icon="house" to="/home" label={t('Home')} />
<Tab k="plan" icon="calendar" to="/plan" label={t('Plan')} />
<button className={'start' + (S.active ? ' rec' : '')} onClick={startWorkout}>
<span className="cir"><svg viewBox="0 0 24 24"><path d="M6.5 6.5v11M17.5 6.5v11M2.5 9.5v5M21.5 9.5v5M6.5 12h11" /></svg></span>
<span className="cir"><Icon name={S.active ? 'play' : 'dumbbell'} /></span>
<span>{S.active ? t('Resume') : t('Start')}</span>
</button>
<button className={on('stats') ? 'on' : ''} onClick={() => nav('/stats')}><Icon k="stats" /><span>{t('Stats')}</span></button>
<button className={on('library') ? 'on' : ''} onClick={() => nav('/library')}><Icon k="library" /><span>{t('Exercises')}</span></button>
<Tab k="stats" icon="chart" to="/stats" label={t('Stats')} />
<Tab k="library" icon="list" to="/library" label={t('Exercises')} />
</nav>
)
}
+293
View File
@@ -0,0 +1,293 @@
// openGym control set.
//
// Every input in the app is built here rather than styled on top of a native
// widget. Native controls are the single loudest "unfinished" tell: a checkbox
// renders blue on iOS and grey on Android, a range slider paints its own white
// track that no theme reaches, and a <select> opens a system list that ignores
// dark mode entirely. Rebuilding them means one visual language and one focus
// treatment across every platform.
//
// Shared rules:
// · every control is driven by (value, onChange) — no internal source of truth
// · hit targets are ≥44px even when the painted control is smaller
// · :active gives a scale/tint response so touch feels acknowledged
// · focus-visible draws a ring; pointer interaction never does
import { useRef, useState, useEffect, useCallback, forwardRef } from 'react'
import Icon from './Icon.jsx'
/* ============================ text ============================ */
// Numeric input accepting "," as decimal separator — iOS decimal keypads in many
// locales only offer a comma, and type="number" reports "" for it (value snaps to
// 0). Keeps a local string draft while focused so partial input like "33," survives.
export function NumberField({ value, onChange, decimal = true, className = '', ...rest }) {
const [draft, setDraft] = useState(null)
const committed = useRef(null)
if (draft !== null && committed.current !== value) { setDraft(null); committed.current = null }
const commit = raw => {
let s = raw.replace(/,/g, '.').replace(/[^0-9.]/g, '')
const i = s.indexOf('.')
if (i !== -1) s = decimal ? s.slice(0, i + 1) + s.slice(i + 1).replace(/\./g, '') : s.slice(0, i)
const n = s === '' || s === '.' ? 0 : Math.max(0, parseFloat(s))
committed.current = n
setDraft(s)
onChange(n)
}
return (
<input
type="text"
inputMode={decimal ? 'decimal' : 'numeric'}
className={'num ' + className}
value={draft ?? (value ?? '')}
onFocus={e => e.target.select()}
onChange={e => commit(e.target.value)}
onBlur={() => { setDraft(null); committed.current = null }}
{...rest}
/>
)
}
// forwardRef so callers can focus it or read its value imperatively
export const TextField = forwardRef(function TextField({ className = '', ...rest }, ref) {
return <input ref={ref} className={'field ' + className} {...rest} />
})
export function TextArea({ className = '', ...rest }) {
return <textarea className={'field area ' + className} {...rest} />
}
export function SearchField({ value, onChange, onClear, ...rest }) {
return (
<div className="searchf">
<Icon name="magnifier" className="lead" />
<input className="field" value={value} onChange={onChange} {...rest} />
{!!value && (
<button className="clear" onClick={onClear} aria-label="Clear">
<Icon name="xmark" />
</button>
)}
</div>
)
}
/* ============================ switch ============================ */
export function Switch({ checked, onChange, disabled }) {
return (
<button
role="switch"
aria-checked={!!checked}
disabled={disabled}
className={'sw' + (checked ? ' on' : '')}
onClick={() => onChange(!checked)}
>
<span className="knob" />
</button>
)
}
/* ============================ segmented ============================ */
// options: [{ value, label, icon? }] — the selected pill slides between cells.
export function Segmented({ options, value, onChange, className = '' }) {
const i = Math.max(0, options.findIndex(o => o.value === value))
return (
<div className={'seg ' + className} style={{ '--n': options.length, '--i': i }}>
<span className="seg-sel" aria-hidden="true" />
{options.map(o => (
<button
key={o.value}
className={o.value === value ? 'on' : ''}
aria-pressed={o.value === value}
onClick={() => onChange(o.value)}
>
{o.icon && <Icon name={o.icon} />}
{o.label && <span>{o.label}</span>}
</button>
))}
</div>
)
}
/* ============================ stepper ============================ */
export function Stepper({ value, step = 1, onChange, decimal = true, className = '', label, unit }) {
const set = v => onChange(Math.max(0, Math.round((v || 0) * 100) / 100))
const inner = (
<div className={'stp ' + className}>
<button onClick={() => set((+value || 0) - step)} aria-label="Decrease"><Icon name="minus" /></button>
<span className="val">
<NumberField value={value} decimal={decimal} onChange={onChange} />
{unit && <i>{unit}</i>}
</span>
<button onClick={() => set((+value || 0) + step)} aria-label="Increase"><Icon name="plus" /></button>
</div>
)
if (!label) return inner
return <div className="stp-w"><span className="stp-l">{label}</span>{inner}</div>
}
/* ============================ slider ============================ */
// Pointer-driven so the fill, track and thumb are all ours — no ::-webkit-*
// pseudo-elements, which is the only way the control looks identical on every
// platform and can pick up the accent colour.
export function Slider({ value, min = 0, max = 100, step = 1, onChange, className = '' }) {
const ref = useRef(null)
const [drag, setDrag] = useState(false)
const pct = Math.min(100, Math.max(0, ((value - min) / (max - min)) * 100))
const posToValue = useCallback(clientX => {
const el = ref.current
if (!el) return value
const r = el.getBoundingClientRect()
const f = Math.min(1, Math.max(0, (clientX - r.left) / r.width))
const raw = min + f * (max - min)
const snapped = Math.round(raw / step) * step
// step can be fractional (0.1) — round away binary noise
return Math.min(max, Math.max(min, Math.round(snapped * 1000) / 1000))
}, [min, max, step, value])
useEffect(() => {
if (!drag) return
const move = e => {
e.preventDefault()
onChange(posToValue(e.touches ? e.touches[0].clientX : e.clientX))
}
const up = () => setDrag(false)
window.addEventListener('pointermove', move)
window.addEventListener('pointerup', up)
window.addEventListener('pointercancel', up)
return () => {
window.removeEventListener('pointermove', move)
window.removeEventListener('pointerup', up)
window.removeEventListener('pointercancel', up)
}
}, [drag, onChange, posToValue])
const key = e => {
const d = e.key === 'ArrowRight' || e.key === 'ArrowUp' ? step
: e.key === 'ArrowLeft' || e.key === 'ArrowDown' ? -step : 0
if (!d) return
e.preventDefault()
onChange(Math.min(max, Math.max(min, Math.round((value + d) * 1000) / 1000)))
}
return (
<div
ref={ref}
className={'sld' + (drag ? ' dragging' : '') + ' ' + className}
role="slider"
tabIndex={0}
aria-valuenow={value} aria-valuemin={min} aria-valuemax={max}
data-nodrag /* keeps the sheet from swipe-dismissing */
onKeyDown={key}
onPointerDown={e => { e.currentTarget.setPointerCapture?.(e.pointerId); setDrag(true); onChange(posToValue(e.clientX)) }}
>
<span className="sld-track"><span className="sld-fill" style={{ width: pct + '%' }} /></span>
<span className="sld-knob" style={{ left: pct + '%' }} />
</div>
)
}
/* ============================ checkbox ============================ */
export function Check({ checked, onChange, className = '', size }) {
return (
<button
role="checkbox"
aria-checked={!!checked}
className={'chk' + (checked ? ' on' : '') + ' ' + className}
style={size ? { width: size, height: size } : null}
onClick={() => onChange(!checked)}
>
<Icon name="check" />
</button>
)
}
/* ============================ grouped list ============================ */
// The inset-grouped list is the app's main structural primitive: a titled
// section holding rows separated by hairlines that stop short of the leading
// edge, so the icon column reads as a continuous rail.
export function Section({ title, footer, children, className = '' }) {
return (
<section className={'sect ' + className}>
{title && <h2 className="sect-t">{title}</h2>}
<div className="sect-b">{children}</div>
{footer && <p className="sect-f">{footer}</p>}
</section>
)
}
export function Row({ icon, iconTint, title, subtitle, value, accessory = 'none', onClick, danger, children, className = '' }) {
const Tag = onClick ? 'button' : 'div'
return (
<Tag className={'lrow' + (onClick ? ' tap' : '') + (danger ? ' danger' : '') + ' ' + className} onClick={onClick}>
{icon && <span className="lrow-i" style={iconTint ? { '--tint': iconTint } : null}><Icon name={icon} /></span>}
<span className="lrow-m">
<span className="lrow-t">{title}</span>
{subtitle && <span className="lrow-s">{subtitle}</span>}
</span>
{children}
{value != null && <span className="lrow-v">{value}</span>}
{accessory === 'chevron' && <Icon name="chevronRight" className="lrow-c" />}
{accessory === 'check' && <Icon name="check" className="lrow-k" />}
</Tag>
)
}
/* ============================ picker ============================ */
// Replaces <select>. A native select opens a system list that ignores the app's
// theme entirely — on dark mode it flashes a white sheet — and can't show more
// than a bare label per option. This opens our own sheet with a checkmark on the
// current value, which is also how iOS itself handles a long option list.
export function SelectRow({ icon, iconTint, title, value, options, onChange, sheetTitle }) {
const cur = options.find(o => o.value === value)
const open = () => {
const { openSheet } = require_ui()
const h = openSheet(close => (
<>
<h3>{sheetTitle || title}</h3>
<div className="sect-b">
{options.map(o => (
<button key={o.value} className="lrow tap" onClick={() => { close(); onChange(o.value) }}>
<span className="lrow-m"><span className="lrow-t">{o.label}</span>
{o.subtitle && <span className="lrow-s">{o.subtitle}</span>}</span>
{o.value === value && <Icon name="check" className="lrow-k" />}
</button>
))}
</div>
<div style={{ height: 8 }} />
</>
))
return h
}
return (
<Row icon={icon} iconTint={iconTint} title={title} value={cur ? cur.label : value} accessory="chevron" onClick={open} />
)
}
// Late import keeps this module free of a cycle at load time (useUI pulls in the
// store, which pulls in helpers that import controls).
let _ui = null
export function bindUI(store) { _ui = store }
function require_ui() {
if (!_ui) throw new Error('ui store not bound — call bindUI(useUI) once at boot')
return _ui.getState()
}
/* ============================ buttons ============================ */
export function Button({ variant = 'plain', size, icon, trailingIcon, children, className = '', ...rest }) {
return (
<button className={`btn ${variant}${size ? ' ' + size : ''} ${className}`} {...rest}>
{icon && <Icon name={icon} />}
{children && <span>{children}</span>}
{trailingIcon && <Icon name={trailingIcon} />}
</button>
)
}
+754 -298
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -45,8 +45,8 @@ function credToJSON(cred) {
}
return out
}
export async function passkeyRegister(name) {
const { cid, options } = await api('/api/register/options', { method: 'POST', body: JSON.stringify({ name }) })
export async function passkeyRegister(name, code) {
const { cid, options } = await api('/api/register/options', { method: 'POST', body: JSON.stringify({ name, code: code || '' }) })
const cred = await navigator.credentials.create({ publicKey: toCreationOptions(options) })
const res = await api('/api/register/verify', { method: 'POST', body: JSON.stringify({ cid, credential: credToJSON(cred) }) })
return res.user
+16
View File
@@ -0,0 +1,16 @@
// Body geometry — the SVG outlines every muscle map in the app is drawn from.
//
// Converted from MuscleMap by Melih Colpan (MIT), whose path data ships as Swift
// source rather than .svg files; see NOTICE.md. Four views (male/female ×
// front/back), each a viewBox plus one path list per body part. Parts that are
// not muscles — head, hair, neck, hands, feet, knees, ankles — are drawn as the
// silhouette and never take a heat colour; see INERT in lib/muscles.js.
//
// MuscleMap's sub-groups (upper-abs, lower-chest, outer-quad, front-deltoid …)
// are dropped: the exercise dataset resolves to whole muscles, so shading a
// sub-region would imply a precision the data does not have.
//
// ~90 KB, so this module is imported dynamically and only lands in the bundle
// once a muscle map is actually shown. Generated — do not hand-edit.
export default {"male":{"front":{"vb":"0 95 727 1280","p":{"chest":["M272.91 422.84c-18.95-17.19-22-57-12.64-78.79 5.57-12.99 26.54-24.37 39.97-25.87q20.36-2.26 37.02.75c9.74 1.76 16.13 15.64 18.41 25.04 3.99 16.48 3.23 31.38 1.67 48.06q-1.35 14.35-2.05 16.89c-6.52 23.5-38.08 29.23-58.28 24.53-9.12-2.12-17.24-4.38-24.1-10.61z","M416.04 435c-15.12.11-34.46-6.78-41.37-21.48q-1.88-3.99-2.84-12.18c-2.89-24.41-5.9-53.65 8.44-74.79 4.26-6.26 10.49-7.93 18.36-8.56q11.66-.92 23.32-.35c10.58.53 18.02 2.74 26.62 7.87 12.81 7.65 19.73 14.52 22.67 29.75 4.94 25.57.24 64.14-28.21 74.97q-12.26 4.67-26.99 4.77z"],"abs":["M311.02 531.71a.23.23 0 01-.19-.21q-.39-10.47 1.9-20.76c1.26-5.69 7.66-9.9 13.1-12.9 9.09-5.01 18.93-11.15 28.56-14.92a1.24 1.21-42.6 01.94.03c3.28 1.52 4.78 3.87 4.82 7.68q.13 13.16-.15 26.31c-.08 3.85.78 8.39-.87 13.1q-.17.46-.59.72-2.65 1.65-4.29 1.82-21.06 2.22-43.23-.87z","M321 577.76c-5.17-.33-8.71-.44-10-6.26q-3.2-14.44-.59-27.83.11-.53.64-.63c7.58-1.44 13.62-2.45 22.45-4.56q11.5-2.76 23.94-1.88c3.67.26 3.3 3.46 3.4 6.21q.46 12.55-.33 26.94-.25 4.41-1.81 8.08-.21.49-.73.6-1.39.28-3.22.29-16.89.14-33.75-.96z","M347.73 429.25c7.46-3.61 10.5 6.27 10.99 11.52.48 5.06 3.46 30.61-2.78 32.93q-4.17 1.55-6.89 3.33-17.56 11.54-35.88 21.46a1.6 1.59-21.9 01-2.3-.98c-2.87-10.41-10.59-43.96 1.66-50.95 11.3-6.45 23.96-11.86 35.2-17.31z","M350.35 712.81c-29.15-9.93-37.98-100.69-39.47-126.61a.99.99 0 01.33-.8c3.58-3.26 27.61-1.47 34.62-.93 4.41.34 15.27 1.31 15.26 7.53-.05 40.77.64 82.05-1.96 122.72a1.29 1.29 0 01-1.86 1.08c-2.3-1.14-4.12-2.04-6.92-2.99z","M371.94 473.31c-5.46-2.59-2.97-24.26-2.77-29.56.25-6.8 2.41-18.63 12.64-13.8q16.26 7.67 32.34 15.72 6.18 3.1 7.13 10.05c.58 4.26 1.35 8.49 1.07 12.72q-.84 12.55-4.33 26.56-.54 2.16-1.1 3.44-.25.58-.81.31c-15.78-7.29-30.79-19.08-44.17-25.44z","M382.57 533.27c-4.17-.18-9.56-.3-13.15-2.69q-.17-.11-.24-.31c-1.82-5.55-.86-11.17-.96-15.66-.18-8.4-.78-17.36.06-25.71.29-2.85 1.88-4.42 4.15-5.79q.42-.26.91-.19 1.71.25 3.21 1.03 12.48 6.44 24.75 13.26c4.96 2.75 12.21 7.02 13.72 12.41q2.93 10.56 2.39 21.49a.77.76-1.8 01-.67.71q-16.89 2.18-34.17 1.45z","M373.75 578.69c-2.47 0-4.31.22-5-2.7-1.8-7.7-3.05-34.29-.19-38.81q.27-.43.77-.47 13.14-1.24 25.77 1.83c8.41 2.04 14.51 3.01 21.85 4.36a1.29 1.28.6 011.05 1.07q2.16 14.12-.73 28.07c-1.08 5.24-5.22 5.26-10.36 5.63q-14.26 1.04-33.16 1.02z","M416.32 584.73q1.14.41 1.07 1.62c-1.62 26.44-9.96 116.68-40.43 126.74-2.27.75-4.15 2.12-6.35 2.73q-1.18.33-1.3-.89-.86-9.2-1.06-17.75c-.83-35.67-.91-71.2-1.01-106.88q0-.5.31-.89c4.95-6.46 41.69-7.25 48.77-4.68z"],"biceps":["M189.52 492.51c-2.43.62-7.38.57-7.51-3.08-.56-16.01-.42-35.49 5.11-50.26 3.19-8.54 13.89-30.22 23.27-32.72 10.08-2.68 12.68 16.59 12.6 22.8-.22 15.98-7.51 34.79-15.05 48.71-4.29 7.94-9.95 12.38-18.42 14.55z","M526.69 486.31c-9.9-8.61-17.75-33.21-20.65-47.73-1.41-7.06-1.34-29.61 8.58-32.16 10.33-2.66 23.81 25.34 26.6 32.91q2.6 7.04 3.6 16.13 1.62 14.66 1.66 32.28c.03 11.04-16.45 1.48-19.79-1.43z"],"triceps":["M206.2 514.2c-5.41-.67-6.55-7.29-4.69-11.42 11.08-24.55 22.84-50.62 30.54-75.51 1.37-4.41 3.08-8.59 3.95-12.45q2.94-13.12 5.79-26.26.42-1.98 1.82-3.39a.52.52 0 01.81.1q1.04 1.69 1.94 4.56 4.63 14.65 5.15 24.92c.57 11.36-5.11 24.55-8.65 35.5q-7.69 23.78-20.25 45.39c-2.45 4.23-11.51 19.18-16.41 18.56z","M517.69 512.06c-20.07-22.12-28.95-51.73-38.01-79.03-3.27-9.87-3.58-19.18-1.34-29.38 1.29-5.88 2.49-13.03 5.61-18.52q.32-.57.72-.06 1.35 1.67 1.79 3.69c2.67 12.33 5.14 24.49 9.07 36.52 8.25 25.28 18.58 49.8 31.1 77.2q1.42 3.1 1.05 5.33c-.81 4.89-5.46 9.25-9.99 4.25z"],"deltoids":["M274.06 311.69q3.94 2.77 4.33 8.14.04.48-.38.73c-9.98 5.88-24.35 7.45-28.82 19.75-2.31 6.36-.97 17.35-1.43 23.68q-.55 7.51-5.73 14.07-10.37 13.11-13.81 16.67c-3.41 3.53-6.81 1.76-10.69-.47-15.42-8.87-24.95-25.45-22.52-43.22 2.05-14.92 12.71-25.79 24.06-35.02 16.99-13.82 35.58-17.99 54.99-4.33z","M450.39 320.75q-.95-.52-.7-1.58c1.57-6.61 5.8-9.1 12.14-11.9 24.99-11.03 43.76 3.33 60.17 20.74 20.73 21.99 11.81 56.44-14.82 68.19-4.41 1.94-6.79-1.03-9.81-4.51-5.81-6.7-13.46-14.12-15.99-22.8-3.93-13.43 4.32-27.54-9.64-37.62q-8.22-5.93-17.99-9.08-1.84-.59-3.36-1.44z"],"obliques":["M264.21 435.53c-4.88-3.13-5.75-12.11-5.39-17.36q.03-.53.51-.75 1.8-.84 3.43.85 10.05 10.45 22.57 16.9c3.64 1.89 5.54 3.62 4.79 7.8q-.42 2.35-2.82 1.87-12.45-2.49-23.09-9.31z","M287.33 452.44c-4.05 4.46-10.38 11.38-16.28 14.3a.84.83 51.1 01-.9-.1c-6.29-5.17-12.54-18.97-14.21-25.09q-.91-3.34.85-8.81.12-.39.35-.05c2.41 3.65 4.59 7.74 8.67 9.76q10.18 5.05 21.27 9.01a.61.61 0 01.25.98z","M297.3 487.82c-7.36-4.23-16.68-11.37-20.55-17.57q-.32-.5.09-.92 8.72-9.04 19.84-17.87 1.46-1.17 2.81-1.67a.44.44 0 01.59.43c-.28 10.08-.4 20.42.65 30.43q.34 3.26-.68 6.15a1.9 1.9 0 01-2.75 1.02z","M257.35 456.18l13.68 16.63a1.86 1.82 22.9 01.4.95c.59 5.4-2.02 12.71-3.8 17.56q-.3.84-.84.13-11.85-15.55-9.77-35.17.04-.45.33-.1z","M271.69 494.07a1.53 1.52-61.8 01-.49-1.64l4.2-13.58a.98.98 0 011.51-.5c3.2 2.32 21.89 14.05 22.26 16.7q1.15 8.32.66 16.79aLine truncated
+14
View File
@@ -0,0 +1,14 @@
// Demo build (VITE_DEMO=1) — what runs on the GitHub Pages deployment.
//
// Pages can only serve static files, so there is no API: passkey sign-in, per-profile sync
// and the admin dashboard all need the Node backend and are simply not part of a demo build.
// The app therefore stays in guest mode (everything in localStorage) and boots with a seeded
// example history (demoSeed.js), so the charts, heatmap, streaks and "last time you lifted…"
// pre-fills have something to show instead of an empty shell.
//
// Only these three constants are shared with normal builds: Vite replaces VITE_DEMO at build
// time, so the demo-only UI folds away and the seed generator — imported dynamically — never
// lands in a self-hosted bundle.
export const DEMO = import.meta.env.VITE_DEMO === '1'
export const DEMO_SEEDED = 'gym_demo_seeded_v1'
export const REPO = 'https://github.com/DuarteSantos8/openGym'
+108
View File
@@ -0,0 +1,108 @@
// The example profile behind the demo build (see demo.js). Imported dynamically, so it stays
// out of the bundle self-hosters ship.
import { isoOf, uid } from './format.js'
import { starterRoutines } from './starter.js'
// Starting weight and weekly increment per exercise of the starter plan (kg).
// Chest dips are body-weight only here, so they log reps at 0 added weight.
const PROG = {
'0025': [60, 1.25], '0047': [45, 1], '0426': [20, 0.5], '0334': [10, 0.25], '0241': [25, 0.75], '0251': [0, 0],
'2330': [50, 1.25], '0027': [50, 1], '1323': [45, 1], '0031': [30, 0.5], '0313': [12, 0.3],
'0043': [70, 1.5], '0085': [60, 1.25], '0739': [120, 3], '0585': [45, 1], '0586': [40, 1], '0605': [60, 1.5]
}
const WEEKS = 12 // how much history to fabricate
const BW_FROM = 82.4, BW_TO = 78.3 // body-weight trend across those weeks
const TARGET_W = 77
// Deterministic PRNG — the demo should look the same on every visit and in screenshots.
function rng(seed) {
let a = seed >>> 0
return () => {
a = (a + 0x6d2b79f5) >>> 0
let t = Math.imul(a ^ (a >>> 15), 1 | a)
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t
return ((t ^ (t >>> 14)) >>> 0) / 4294967296
}
}
const round = (w, step) => Math.round(w / step) * step
const at = (date, h, m) => { const d = new Date(date); d.setHours(h, m, 0, 0); return d.getTime() }
// A full example profile: 12 weeks of Mon/Wed/Fri sessions on the starter plan, with linear
// progression, the odd missed session, and twice-weekly weigh-ins trending toward the goal.
export function buildDemoState() {
const rnd = rng(20260723)
const [push, pull, legs] = starterRoutines()
const byWeekday = { 1: push, 3: pull, 5: legs }
const nowH = new Date().getHours()
const today = new Date(); today.setHours(12, 0, 0, 0)
const start = new Date(today); start.setDate(start.getDate() - WEEKS * 7)
const workouts = []
const bodyweight = []
const exWeights = {}
const best = {}
for (let d = new Date(start); d <= today; d.setDate(d.getDate() + 1)) {
const day = new Date(d)
const iso = isoOf(day)
const weekIdx = Math.floor((day - start) / (7 * 86400000))
const p = Math.min(1, weekIdx / WEEKS)
// weigh-ins: Monday and Thursday mornings
if (day.getDay() === 1 || day.getDay() === 4) {
const w = BW_FROM + (BW_TO - BW_FROM) * p + (rnd() - 0.5) * 0.7
bodyweight.push({ d: iso, w: Math.round(w * 10) / 10, t: at(day, 7, 30) })
}
const routine = byWeekday[day.getDay()]
if (!routine) continue
if (rnd() < 0.09) continue // life happens — a few missed sessions
if (iso === isoOf(today) && nowH < 18) continue // leave today's session to try out, unless it's already evening
const prs = []
const entries = routine.ex.map(cfg => {
const [base, inc] = PROG[cfg.id] || [20, 0.5]
const step = base >= 40 ? 2.5 : 1.25
const w = base ? Math.max(step, round(base + inc * weekIdx, step)) : 0
const sets = []
for (let i = 0; i < cfg.sets; i++) {
// last set is where reps usually start slipping
const drop = i === cfg.sets - 1 && rnd() < 0.55 ? (rnd() < 0.4 ? 2 : 1) : 0
sets.push({ w, r: Math.max(4, cfg.reps - drop), done: true })
}
if (w > (best[cfg.id] || 0)) { best[cfg.id] = w; prs.push(cfg.id) }
exWeights[cfg.id] = { w: Math.max(w, exWeights[cfg.id]?.w || 0), d: iso }
return { id: cfg.id, sets, topW: w || null }
})
const bw = bodyweight.length ? bodyweight[bodyweight.length - 1].w : BW_FROM
const startMs = at(day, 18, 5 + Math.floor(rnd() * 25))
const w = {
id: uid(), d: iso, start: startMs, end: startMs + (46 + Math.floor(rnd() * 26)) * 60000,
routineId: routine.id, name: routine.name, bw,
entries,
prs: weekIdx === 0 ? [] : prs // the very first session isn't a PR party
}
w.vol = entries.reduce((v, e) => v + e.sets.reduce((n, s) => n + s.w * s.r, 0), 0)
workouts.push(w)
}
// A visitor should always have something to press "Start" on, so if they land on a rest day
// the next routine in the rotation is moved onto today — which also shows off rescheduling.
const dayPlan = {}
const tIso = isoOf(today)
if (!byWeekday[today.getDay()] && !workouts.some(w => w.d === tIso)) {
const order = [push, pull, legs]
const lastName = workouts.length ? workouts[workouts.length - 1].name : legs.name
dayPlan[tIso] = order[(order.findIndex(r => r.name === lastName) + 1) % order.length].id
}
return {
routines: [push, pull, legs],
week: { 1: push.id, 3: pull.id, 5: legs.id },
dayPlan,
workouts, bodyweight, exWeights,
targetW: TARGET_W
}
}
+16 -2
View File
@@ -5,6 +5,15 @@ export const EXIDX = {}
EXDB.forEach(e => { EXIDX[e.id] = e })
export const BODYPARTS = [...new Set(EXDB.map(e => e.bp))].sort()
// Equipment options present in a given list of exercises, most common first (issue #6).
// Deriving them from the *already filtered* list keeps the chip row short and means
// every body-part × equipment combination on screen has results behind it.
export function equipmentOf(list) {
const c = {}
list.forEach(e => { if (e.eq) c[e.eq] = (c[e.eq] || 0) + 1 })
return Object.keys(c).sort((a, b) => c[b] - c[a] || (a < b ? -1 : 1))
}
// Custom (user-created) exercises live in synced state S.customEx (issue #11) and are
// merged into the id index here so every EXIDX[id] lookup keeps working unchanged.
let customIds = []
@@ -16,8 +25,13 @@ export function registerCustom(list) {
// Full searchable catalogue — customs first so your own exercises are easy to find.
export const allExercises = st => [...(st.customEx || []), ...EXDB]
export const imgSrc = ex => 'img/' + ex.img
export const gifSrc = ex => 'gif/' + ex.gif
// Media normally sits next to the app (img/ and gif/, mounted into the web container).
// A build can point them somewhere else — the demo build pulls them off a CDN instead of
// shipping ~140 MB of images into the deployment.
const IMG_BASE = import.meta.env.VITE_IMG_BASE || 'img/'
const GIF_BASE = import.meta.env.VITE_GIF_BASE || 'gif/'
export const imgSrc = ex => IMG_BASE + ex.img
export const gifSrc = ex => GIF_BASE + ex.gif
// Cardio exercises log time + speed instead of weight × reps.
export const isCardio = idOrEx => (typeof idOrEx === 'string' ? EXIDX[idOrEx] : idOrEx)?.bp === 'cardio'
+1 -1
View File
@@ -35,4 +35,4 @@ export function weekKey(d) {
export const localTZ = () => { try { return Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC' } catch { return 'UTC' } }
export const uid = () => Date.now().toString(36) + Math.random().toString(36).slice(2, 7)
export const ACCENTS = { lime: '#a3e635', sky: '#38bdf8', orange: '#fb923c', violet: '#a78bfa', pink: '#f472b6', red: '#f87171', teal: '#2dd4bf', gold: '#fbbf24' }
export const ACCENTS = { lime: '#30d158', sky: '#0a84ff', orange: '#ff9f0a', violet: '#bf5af2', pink: '#ff375f', red: '#ff453a', teal: '#40c8e0', gold: '#ffd60a' }
+49
View File
@@ -0,0 +1,49 @@
// Routine glyphs.
//
// Routines used to store a literal emoji in `r.emoji` ('💪', '🦵', …). The
// redesign stores an icon key instead, but the field keeps its name so existing
// synced state stays readable by both builds — no migration, no lost routines.
//
// glyphOf() accepts either form: a known icon key passes through, a legacy emoji
// is mapped, and anything unrecognised falls back to the default.
import { ICON_NAMES } from '../components/Icon.jsx'
export const DEFAULT_GLYPH = 'figureStrength'
// The picker offers glyphs that describe a TRAINING DAY — the split, the kit, or
// the kind of session. The first version offered trophy/medal/crown/flag/star,
// which say how a workout went, not what it is; nobody names a routine "crown".
// Grouped, because 20 loose icons is a wall — you scan the group first.
export const GLYPH_GROUPS = [
{ key: 'Strength', items: ['figureStrength', 'arm', 'abs', 'legs', 'pullup'] },
{ key: 'Equipment', items: ['dumbbell', 'barbell', 'kettlebell', 'plate', 'machine'] },
{ key: 'Cardio', items: ['figureRun', 'bike', 'swim', 'boxing', 'timer'] },
{ key: 'Recovery', items: ['stretch', 'moon', 'heart', 'flame', 'bolt'] },
]
export const GLYPHS = GLYPH_GROUPS.flatMap(g => g.items)
// Legacy emoji → icon key, so routines created before the redesign keep a
// sensible glyph instead of all collapsing onto the default.
const LEGACY = {
'💪': 'arm', '🦾': 'arm', '🫸': 'figureStrength', '🫷': 'pullup',
'🏋️': 'dumbbell', '🏋': 'dumbbell', '🏋️‍♀️': 'dumbbell',
'🦵': 'legs', '🍑': 'legs',
'🔥': 'flame', '⚡': 'bolt', '💥': 'bolt', '🧨': 'bolt', '😤': 'flame',
'🏃': 'figureRun', '🏃‍♀️': 'figureRun', '🚴': 'bike', '🏊': 'swim',
'🤸': 'stretch', '🧘': 'stretch', '🧘‍♀️': 'stretch',
'🥊': 'boxing', '🧗': 'pullup', '⛰️': 'figureRun', '🏔️': 'figureRun', '🚀': 'bolt',
'🎯': 'target', '🏆': 'trophy', '🥇': 'medal', '⭐': 'star', '🌟': 'star',
'👑': 'crown', '🛡️': 'shield', '⚔️': 'shield', '❤️‍🔥': 'heart',
'🦍': 'kettlebell', '🐂': 'barbell', '🐻': 'kettlebell', '🦁': 'boxing',
'🐺': 'figureRun', '🦈': 'swim', '🤖': 'machine',
}
export function glyphOf(v) {
if (!v) return DEFAULT_GLYPH
if (ICON_NAMES.includes(v)) return v
if (LEGACY[v]) return LEGACY[v]
// strip variation selectors / ZWJ sequences and retry the base emoji
const base = [...v].filter(c => c !== '️' && c !== '‍')[0]
return LEGACY[base] || DEFAULT_GLYPH
}
+136
View File
@@ -0,0 +1,136 @@
// Which muscles an exercise trains, and how hard — the data behind every muscle map.
//
// The exercise dataset names muscles in free text and is not consistent about it:
// "shoulders", "deltoids" and "delts" are the same thing, so are "quads" and
// "quadriceps", "lats" and "latissimus dorsi", "core" and "abdominals". Nineteen
// primary and forty secondary spellings collapse onto the eighteen muscles the body
// map can actually draw, via ALIAS below. Anything genuinely undrawable (hands,
// ankles, "cardiovascular system") maps to null and is dropped rather than guessed at.
import { EXIDX } from './exercises.js'
// The muscles a map can shade, in head-to-toe order — also the order of any list
// built from them, so "what am I neglecting" reads top-down like a body.
export const MUSCLES = [
'trapezius', 'deltoids', 'chest', 'upper-back', 'serratus',
'biceps', 'triceps', 'forearm',
'abs', 'obliques', 'lower-back',
'gluteal', 'quadriceps', 'hamstring', 'adductors', 'hip-flexors',
'calves', 'tibialis',
]
// Drawn as the silhouette, never shaded: they carry no training load.
export const INERT = ['head', 'hair', 'neck', 'hands', 'feet', 'knees', 'ankles']
// English display names; these strings are the i18n keys (see lib/i18n.js).
export const MUSCLE_NAME = {
trapezius: 'Traps', deltoids: 'Shoulders', chest: 'Chest', 'upper-back': 'Upper back',
serratus: 'Serratus', biceps: 'Biceps', triceps: 'Triceps', forearm: 'Forearms',
abs: 'Abs', obliques: 'Obliques', 'lower-back': 'Lower back', gluteal: 'Glutes',
quadriceps: 'Quads', hamstring: 'Hamstrings', adductors: 'Adductors',
'hip-flexors': 'Hip flexors', calves: 'Calves', tibialis: 'Shins',
}
// Every spelling that occurs in the dataset's `tg` and `sm` fields. null = not drawable.
const ALIAS = {
// primaries
abs: 'abs', pectorals: 'chest', biceps: 'biceps', glutes: 'gluteal', delts: 'deltoids',
triceps: 'triceps', 'upper back': 'upper-back', lats: 'upper-back', calves: 'calves',
quads: 'quadriceps', forearms: 'forearm', hamstrings: 'hamstring', spine: 'lower-back',
traps: 'trapezius', adductors: 'adductors', 'serratus anterior': 'serratus',
abductors: 'gluteal', 'levator scapulae': 'trapezius', 'cardiovascular system': null,
// secondaries
shoulders: 'deltoids', deltoids: 'deltoids', 'rear deltoids': 'deltoids',
'rotator cuff': 'deltoids', quadriceps: 'quadriceps', core: 'abs', abdominals: 'abs',
'lower abs': 'abs', chest: 'chest', 'upper chest': 'chest', 'hip flexors': 'hip-flexors',
obliques: 'obliques', 'lower back': 'lower-back', rhomboids: 'upper-back',
trapezius: 'trapezius', back: 'upper-back', 'latissimus dorsi': 'upper-back',
brachialis: 'biceps', soleus: 'calves', shins: 'tibialis', wrists: 'forearm',
'wrist flexors': 'forearm', 'wrist extensors': 'forearm', 'grip muscles': 'forearm',
groin: 'adductors', 'inner thighs': 'adductors',
ankles: null, feet: null, hands: null, 'ankle stabilizers': null,
sternocleidomastoid: null,
}
// Custom exercises carry only a body part, so they fall back to it. Weights inside a
// group sum to 1 — "upper legs" spreads over three muscles rather than counting triple.
const BY_BODYPART = {
chest: { chest: 1 },
back: { 'upper-back': 0.75, 'lower-back': 0.25 },
shoulders: { deltoids: 1 },
'upper arms': { biceps: 0.5, triceps: 0.5 },
'lower arms': { forearm: 1 },
waist: { abs: 0.7, obliques: 0.3 },
'upper legs': { quadriceps: 0.4, hamstring: 0.35, gluteal: 0.25 },
'lower legs': { calves: 0.8, tibialis: 0.2 },
neck: { trapezius: 1 },
cardio: {},
}
const SECONDARY = 0.4 // a supporting muscle counts this much against a primary
/** Muscles one exercise trains: { slug: 0…1 }. */
export function musclesOf(ex) {
if (!ex) return {}
const out = {}
const add = (name, w) => {
const slug = ALIAS[String(name || '').toLowerCase().trim()]
if (slug) out[slug] = Math.max(out[slug] || 0, w)
}
add(ex.tg, 1)
;(ex.sm || []).forEach(m => add(m, SECONDARY))
// Nothing recognised (custom exercises, or a target we don't draw) — use the body part.
if (!Object.keys(out).length) Object.assign(out, BY_BODYPART[ex.bp] || {})
return out
}
/**
* Training load per muscle, in "effective sets".
* `items` is [{ id, sets }] — sets being a count, so a 4×8 bench press weighs four
* times a single set. Volume in kg is deliberately not used: 100 kg of leg press
* against 12 kg of lateral raise says nothing about which muscle worked harder.
*/
export function loadOf(items) {
const load = {}
items.forEach(({ id, sets }) => {
if (!sets) return
const m = musclesOf(EXIDX[id])
for (const slug in m) load[slug] = (load[slug] || 0) + m[slug] * sets
})
return load
}
/** Load for finished workouts (only sets actually ticked off count). */
export const loadOfWorkouts = workouts =>
loadOf((workouts || []).flatMap(w =>
(w.entries || []).map(e => ({ id: e.id, sets: (e.sets || []).filter(s => s.done).length }))))
/** Load a routine *would* produce, from its planned set counts. */
export const loadOfRoutine = routine =>
loadOf((routine?.ex || []).map(c => ({ id: c.id, sets: c.sets || 1 })))
/** Load for a workout still in progress — the sets ticked so far. */
export const loadOfActive = active =>
loadOf((active?.entries || []).map(e => ({ id: e.id, sets: (e.sets || []).filter(s => s.done).length })))
/**
* Shade buckets 0–4 per muscle, relative to the hardest-worked muscle in the same
* window. Relative rather than absolute on purpose: the map answers "is my training
* balanced", which only means anything as a comparison within one period.
*/
export function levelsOf(load) {
const max = Math.max(0, ...MUSCLES.map(m => load[m] || 0))
const lv = {}
MUSCLES.forEach(m => {
const v = load[m] || 0
lv[m] = !v ? 0 : max <= 0 ? 0 : Math.max(1, Math.min(4, Math.ceil(v / max * 4)))
})
return lv
}
/** Muscles sorted hardest-worked first; untrained ones last, in body order. */
export function rankOf(load) {
const worked = MUSCLES.filter(m => (load[m] || 0) > 0).sort((a, b) => load[b] - load[a])
const missed = MUSCLES.filter(m => !(load[m] > 0))
return { worked, missed }
}
+13
View File
@@ -0,0 +1,13 @@
// The Push/Pull/Legs starter plan. Shared by the "Load starter plan" action in Settings
// and by the demo build, which seeds a history on top of exactly these routines.
import { uid } from './format.js'
const SPEC = [
['Push Day', 'barbell', [['0025', 4, 8], ['0047', 3, 10], ['0426', 3, 10], ['0334', 3, 12], ['0241', 3, 12], ['0251', 3, 10]]],
['Pull Day', 'pullup', [['2330', 4, 10], ['0027', 4, 8], ['1323', 3, 10], ['0031', 3, 10], ['0313', 3, 12]]],
['Leg Day', 'legs', [['0043', 4, 8], ['0085', 3, 10], ['0739', 3, 12], ['0585', 3, 12], ['0586', 3, 12], ['0605', 4, 15]]]
]
// Fresh routine objects (new ids) — [push, pull, legs].
export const starterRoutines = () =>
SPEC.map(([name, emoji, list]) => ({ id: uid(), name, emoji, ex: list.map(([id, sets, reps]) => ({ id, sets, reps, weight: 0 })) }))
+83 -35
View File
@@ -46,16 +46,16 @@ export default {
'June': 'Juni', 'July': 'Juli', 'August': 'August', 'September': 'September',
'October': 'Oktober', 'November': 'November', 'December': 'Dezember',
// --- body weight & goal ---
'Quick check-in ⚖️': 'Kurzer Check-in ⚖️',
'Quick check-in': 'Kurzer Check-in',
'Log body weight': 'Körpergewicht eintragen',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': 'Schieben oder tippen, um dein Gewicht zu setzen — vor jedem Training erfasst, damit deine Kurve ehrlich bleibt.',
'Save & start workout': 'Speichern & Training starten',
'Skip today': 'Heute überspringen',
'↺ Choose a different workout': '↺ Anderes Training wählen',
'Choose a different workout': 'Anderes Training wählen',
'Recent weigh-ins': 'Letzte Messungen',
'Enter a valid weight': 'Gib ein gültiges Gewicht ein',
'Weight saved ✓': 'Gewicht gespeichert ✓',
'Target weight 🎯': 'Zielgewicht 🎯',
'Weight saved': 'Gewicht gespeichert',
'Target weight': 'Zielgewicht',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': 'Dein Ziel wird als Linie in den Gewichts-Charts angezeigt, und Zu-/Abnahmen werden danach eingefärbt, ob sie darauf zusteuern.',
'Save goal': 'Ziel speichern',
'Goal set: {0}': 'Ziel gesetzt: {0}',
@@ -63,18 +63,18 @@ export default {
'Goal removed': 'Ziel entfernt',
'Remove goal': 'Ziel entfernen',
'Body weight': 'Körpergewicht',
'reached! 🎉': 'erreicht! 🎉',
'reached!': 'erreicht!',
'{0} to gain': 'noch {0} zunehmen',
'{0} to lose': 'noch {0} abnehmen',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": 'Noch keine Einträge — trag dein Gewicht ein, um die Kurve zu starten. Es wird auch vor jedem Training abgefragt.',
// --- exercise detail / picker / config ---
'Best:': 'Bestwert:',
'+ Add to my plan': '+ Zu meinem Plan',
'Add to my plan': 'Zu meinem Plan',
'How to': 'Ausführung',
'instructions in English': 'Anleitung auf Englisch',
'New routine': 'Neue Routine',
'Add “{0}”': '„{0}“ hinzufügen',
'“{0}” added to {1} ✓': '„{0}“ zu {1} hinzugefügt ✓',
'“{0}” added to {1}': '„{0}“ zu {1} hinzugefügt',
'Pick a routine — sets, reps & weight come next.': 'Wähle eine Routine — Sätze, Wiederholungen & Gewicht kommen gleich.',
'{0} exercises': '{0} Übungen',
'already in': 'schon drin',
@@ -83,7 +83,7 @@ export default {
'Search {0} exercises…': '{0} Übungen durchsuchen…',
'Chosen': 'Gewählt',
'Nothing chosen yet — add exercises and they’ll show up here.': 'Noch nichts gewählt — füge Übungen hinzu, dann erscheinen sie hier.',
'No match 🤷': 'Kein Treffer 🤷',
'No match': 'Kein Treffer',
'Show more': 'Mehr anzeigen',
'Intervals': 'Intervalle',
'Minutes': 'Minuten',
@@ -93,11 +93,11 @@ export default {
'Weight ({0})': 'Gewicht ({0})',
'Add to routine': 'Zur Routine hinzufügen',
'Remove exercise': 'Übung entfernen',
'Pick an emoji': 'Emoji auswählen',
'Pick an icon': 'Symbol auswählen',
// --- day planning / calendar ---
'Back to weekly plan': 'Zurück zum Wochenplan',
'{0} set to rest': '{0} als Pausentag gesetzt',
'{0} planned for {1} ✓': '{0} für {1} geplant ✓',
'{0} planned for {1}': '{0} für {1} geplant',
'Weekly plan:': 'Wochenplan:',
'changed for this day': 'für diesen Tag geändert',
'Sick, missed a day or want a different session? Pick what to train instead.': 'Krank, Tag verpasst oder Lust auf was anderes? Wähle, was du stattdessen trainierst.',
@@ -121,23 +121,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': 'Bestätige das Gewicht, mit dem du trainiert hast — dein höchstes wird beim nächsten Mal vorausgefüllt.',
'Then finish the superset partner.': 'Dann den Supersatz-Partner abschliessen.',
'Previous best:': 'Bisheriger Bestwert:',
'new record! 🏆': 'neuer Rekord! 🏆',
'Save ✓': 'Speichern ✓',
'Save & next exercise ›': 'Speichern & nächste Übung ›',
'new record!': 'neuer Rekord!',
'Save': 'Speichern',
'Save & next exercise': 'Speichern & nächste Übung',
'Just close': 'Nur schliessen',
'Save weight': 'Gewicht speichern',
'Tracked — next time starts at {0} 📈': 'Gespeichert — nächstes Mal startest du bei {0} 📈',
'Tracked — next time starts at {0}': 'Gespeichert — nächstes Mal startest du bei {0}',
"That's the whole workout!": 'Das war das ganze Training!',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': 'Alle Übungen geschafft — stark! Schliesse ab oder mach weiter und füge eine Übung hinzu.',
'Finish workout 🏁': 'Training beenden 🏁',
'Finish workout': 'Training beenden',
'Continue workout': 'Weitertrainieren',
'Keep going 💪 — tap “+ Add exercise” below': 'Weiter so 💪 — tippe unten auf „+ Übung hinzufügen“',
'Keep going — tap “+ Add exercise” below': 'Weiter so — tippe unten auf „+ Übung hinzufügen“',
'Workout complete!': 'Training abgeschlossen!',
'Duration': 'Dauer',
'Volume': 'Volumen',
'PRs': 'Rekorde',
'New PR:': 'Neuer Rekord:',
'Nice! 💪': 'Stark! 💪',
'Nice!': 'Stark!',
'Nothing logged yet': 'Noch nichts eingetragen',
'You haven’t checked off any sets. Finish the workout anyway?': 'Du hast noch keine Sätze abgehakt. Training trotzdem beenden?',
'Finish anyway': 'Trotzdem beenden',
@@ -158,10 +158,10 @@ export default {
'Duration (min)': 'Dauer (min)',
'Last time': 'Letztes Mal',
'Last time you hit all reps — try {0}': 'Letztes Mal alle Wdh. geschafft — versuch {0}',
'Weights bumped to {0} 💪': 'Gewichte auf {0} erhöht 💪',
'Weights bumped to {0}': 'Gewichte auf {0} erhöht',
'Remove set': 'Satz entfernen',
'Add set': 'Satz hinzufügen',
'Cardio logged 🏃': 'Cardio eingetragen 🏃',
'Cardio logged': 'Cardio eingetragen',
'Discard workout?': 'Training verwerfen?',
'The sets you logged in this session will be lost.': 'Die in dieser Einheit eingetragenen Sätze gehen verloren.',
'Superset {0} / {1}': 'Supersatz {0} / {1}',
@@ -169,13 +169,13 @@ export default {
'Superset · do these back-to-back, rest after both': 'Supersatz · direkt nacheinander, Pause erst danach',
'Freestyle workout — add your first exercise.': 'Freies Training — füge deine erste Übung hinzu.',
'Finish workout early · {0} exercises': 'Training vorzeitig beenden · {0} Übungen',
'Rest over — next set! 💪': 'Pause vorbei — nächster Satz! 💪',
'Rest over — next set!': 'Pause vorbei — nächster Satz!',
// --- home ---
'Hi {0} 💪': 'Hi {0} 💪',
'Hi {0}': 'Hi {0}',
'This week': 'Diese Woche',
'{0} — in progress': '{0} — läuft',
'Resume ▶': 'Weiter ▶',
'Welcome! 👋': 'Willkommen! 👋',
'Welcome!': 'Willkommen!',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Richte deinen Wochenplan ein — oder lade einen fertigen Push-/Pull-/Beine-Plan.',
'Load starter plan (PPL)': 'Starterplan laden (PPL)',
'Build my own plan': 'Eigenen Plan erstellen',
@@ -194,7 +194,7 @@ export default {
'Exercise progress': 'Übungs-Fortschritt',
'Top speed per workout': 'Top-Tempo pro Training',
'Best set weight per workout': 'Bestes Satzgewicht pro Training',
'Finish your first workout to see progress curves here. 📈': 'Schliess dein erstes Training ab, um hier Fortschrittskurven zu sehen. 📈',
'Finish your first workout to see progress curves here.': 'Schliess dein erstes Training ab, um hier Fortschrittskurven zu sehen.',
'Recent workouts': 'Letzte Trainings',
'Less time': 'Weniger',
'More time': 'Mehr',
@@ -209,7 +209,7 @@ export default {
// --- routine edit ---
'Superset with exercise above': 'Supersatz mit der Übung darüber',
'No exercises yet — add your first one.': 'Noch keine Übungen — füge deine erste hinzu.',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Tipp: Tippe bei einer Übung auf 🔗, um sie mit der darüber zum Supersatz zu verbinden — du machst sie direkt nacheinander.',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Tippe bei einer Übung auf die Verknüpfen-Taste, um sie mit der darüber zum Supersatz zu verbinden — du machst sie direkt nacheinander.',
'Delete routine?': 'Routine löschen?',
'“{0}” and its exercises will be removed.': '„{0}“ und ihre Übungen werden entfernt.',
'Delete routine': 'Routine löschen',
@@ -220,13 +220,13 @@ export default {
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Starterplan geladen — Mo Push · Mi Pull · Fr Beine',
// --- login / account ---
'Enter a name': 'Gib einen Namen ein',
'Profile created — data from this device moved into it ✓': 'Profil erstellt — Daten von diesem Gerät wurden übernommen ✓',
'Profile created — data moved into it ✓': 'Profil erstellt — Daten übernommen ✓',
'Welcome, {0} 💪': 'Willkommen, {0} 💪',
'Welcome back, {0} 💪': 'Willkommen zurück, {0} 💪',
'Profile created — data from this device moved into it': 'Profil erstellt — Daten von diesem Gerät wurden übernommen',
'Profile created — data moved into it': 'Profil erstellt — Daten übernommen',
'Welcome, {0}': 'Willkommen, {0}',
'Welcome back, {0}': 'Willkommen zurück, {0}',
'Registration failed': 'Registrierung fehlgeschlagen',
'Sign-in failed': 'Anmeldung fehlgeschlagen',
'Create your profile ✨': 'Erstelle dein Profil ✨',
'Create your profile': 'Erstelle dein Profil',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': 'Wähle einen Namen und bestätige mit {0}. Der Passkey wird auf deinem Gerät gespeichert — kein Passwort nötig.',
'Pick a name, then confirm with your device.': 'Wähle einen Namen und bestätige mit deinem Gerät.',
'Your name': 'Dein Name',
@@ -268,10 +268,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': 'Löscht Plan, Trainings und Körpergewicht auf diesem Gerät. Das kann nicht rückgängig gemacht werden.',
'Delete everything': 'Alles löschen',
'All data reset': 'Alle Daten zurückgesetzt',
'Backup exported ✓': 'Backup exportiert ✓',
'Backup exported': 'Backup exportiert',
'Import backup?': 'Backup importieren?',
'This replaces all current data with the backup file.': 'Das ersetzt alle aktuellen Daten durch die Backup-Datei.',
'Backup imported ✓': 'Backup importiert ✓',
'Backup imported': 'Backup importiert',
'Import failed: {0}': 'Import fehlgeschlagen: {0}',
'Tip': 'Tipp',
'In Chrome: ⋮ menu → Add to Home screen': 'In Chrome: ⋮-Menü → Zum Startbildschirm hinzufügen',
@@ -292,7 +292,7 @@ export default {
'Test sent — should arrive any second': 'Test gesendet — sollte jeden Moment ankommen',
'Test failed': 'Test fehlgeschlagen',
'Notifications off': 'Benachrichtigungen aus',
'Notifications on 🔔': 'Benachrichtigungen an 🔔',
'Notifications on': 'Benachrichtigungen an',
'Could not change notification settings': 'Benachrichtigungs-Einstellungen konnten nicht geändert werden',
// --- media ---
'tap to pause': 'Tippen zum Pausieren',
@@ -302,6 +302,15 @@ export default {
'lower legs': 'Unterschenkel', 'neck': 'Nacken', 'shoulders': 'Schultern',
'upper arms': 'Oberarme', 'upper legs': 'Oberschenkel', 'waist': 'Rumpf',
// --- data terms: equipment ---
'Details': 'Details',
'Finish': 'Beenden',
'Start {0}': '{0} starten',
'Guest mode — data lives only in this browser.': 'Gastmodus — die Daten liegen nur in diesem Browser.',
'Keeps your data safe and separate per person.': 'Hält deine Daten sicher und pro Person getrennt.',
'Strength': 'Kraft',
'Equipment': 'Geräte',
'Recovery': 'Erholung',
'Any equipment': 'Alle Geräte',
'assisted': 'assistiert', 'band': 'Band', 'barbell': 'Langhantel', 'body weight': 'Körpergewicht',
'bosu ball': 'Bosu-Ball', 'cable': 'Kabelzug', 'dumbbell': 'Kurzhantel',
'elliptical machine': 'Crosstrainer', 'ez barbell': 'SZ-Stange', 'hammer': 'Hammer',
@@ -338,11 +347,11 @@ export default {
'Give it a name': 'Gib ihr einen Namen',
'Pick a body part': 'Wähle eine Körperpartie',
'“{0}” already exists': '„{0}“ existiert bereits',
'“{0}” created ✓': '„{0}“ erstellt ✓',
'“{0}” created': '„{0}“ erstellt',
'Cardio exercises log time + speed instead of weight × reps.': 'Cardio-Übungen erfassen Zeit + Tempo statt Gewicht × Wdh.',
'custom': 'eigene',
'Edit': 'Bearbeiten',
'Saved ✓': 'Gespeichert ✓',
'Saved': 'Gespeichert',
'Delete “{0}”?': '„{0}“ löschen?',
'It will be removed from your routines. Already-logged workouts keep their sets.': 'Sie wird aus deinen Routinen entfernt. Bereits geloggte Workouts behalten ihre Sätze.',
'Exercise deleted': 'Übung gelöscht',
@@ -350,5 +359,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': 'Beschreibung (optional) — Aufbau, Hinweise, was du dir merken willst',
'Delete exercise': 'Übung löschen',
'Edit or delete this exercise': 'Übung bearbeiten oder löschen',
'Remove from routine': 'Aus Routine entfernen'
'Remove from routine': 'Aus Routine entfernen',
'Minimize': 'Verkleinern',
'Expand': 'Vergrössern',
'Invite code': 'Einladungscode',
'This app is invite-only — enter the code you were given.': 'Diese App ist nur mit Einladung — gib den Code ein, den du erhalten hast.',
'An invite code is required': 'Ein Einladungscode ist erforderlich',
'Admin dashboard': 'Admin-Dashboard',
// --- muscle map ---
'Muscle balance': 'Muskelbalance',
'by sets worked': 'nach Sätzen',
'Week': 'Woche',
'not trained': 'nicht trainiert',
'Not trained in this period': 'In diesem Zeitraum nicht trainiert',
'Every muscle group got some work in this period.': 'Jede Muskelgruppe hat in diesem Zeitraum etwas abbekommen.',
'No workouts in this period yet.': 'Noch keine Trainings in diesem Zeitraum.',
'What this session hits': 'Was dieses Training trifft',
'What you just trained': 'Was du gerade trainiert hast',
'Body diagram': 'Körperdiagramm',
'Male': 'Männlich',
'Female': 'Weiblich',
'Less': 'Weniger',
'More': 'Mehr',
'Traps': 'Trapez',
'Shoulders': 'Schultern',
'Chest': 'Brust',
'Upper back': 'Oberer Rücken',
'Serratus': 'Sägemuskel',
'Biceps': 'Bizeps',
'Triceps': 'Trizeps',
'Forearms': 'Unterarme',
'Abs': 'Bauch',
'Obliques': 'Schräge Bauchmuskeln',
'Lower back': 'Unterer Rücken',
'Glutes': 'Gesäß',
'Quads': 'Quadrizeps',
'Hamstrings': 'Beinbeuger',
'Adductors': 'Adduktoren',
'Hip flexors': 'Hüftbeuger',
'Calves': 'Waden',
'Shins': 'Schienbein'
}
+83 -35
View File
@@ -43,16 +43,16 @@ export default {
'January': 'Enero', 'February': 'Febrero', 'March': 'Marzo', 'April': 'Abril',
'June': 'Junio', 'July': 'Julio', 'August': 'Agosto', 'September': 'Septiembre',
'October': 'Octubre', 'November': 'Noviembre', 'December': 'Diciembre',
'Quick check-in ⚖️': 'Chequeo rápido ⚖️',
'Quick check-in': 'Chequeo rápido',
'Log body weight': 'Registrar peso corporal',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': 'Desliza o toca para fijar tu peso — se registra antes de cada entrenamiento para que tu curva sea honesta.',
'Save & start workout': 'Guardar y empezar',
'Skip today': 'Saltar hoy',
'↺ Choose a different workout': '↺ Elegir otro entrenamiento',
'Choose a different workout': 'Elegir otro entrenamiento',
'Recent weigh-ins': 'Pesajes recientes',
'Enter a valid weight': 'Introduce un peso válido',
'Weight saved ✓': 'Peso guardado ✓',
'Target weight 🎯': 'Peso objetivo 🎯',
'Weight saved': 'Peso guardado',
'Target weight': 'Peso objetivo',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': 'Tu meta se dibuja como una línea en las gráficas de peso, y las subidas/bajadas se colorean según se acerquen a ella.',
'Save goal': 'Guardar meta',
'Goal set: {0}': 'Meta fijada: {0}',
@@ -60,17 +60,17 @@ export default {
'Goal removed': 'Meta eliminada',
'Remove goal': 'Eliminar meta',
'Body weight': 'Peso corporal',
'reached! 🎉': '¡conseguido! 🎉',
'reached!': '¡conseguido!',
'{0} to gain': '{0} por ganar',
'{0} to lose': '{0} por perder',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": 'Sin registros aún — apunta tu peso para empezar la curva. También se pide antes de cada entrenamiento.',
'Best:': 'Mejor:',
'+ Add to my plan': '+ Añadir a mi plan',
'Add to my plan': 'Añadir a mi plan',
'How to': 'Cómo hacerlo',
'instructions in English': 'instrucciones en inglés',
'New routine': 'Nueva rutina',
'Add “{0}”': 'Añadir «{0}»',
'“{0}” added to {1} ✓': '«{0}» añadido a {1} ✓',
'“{0}” added to {1}': '«{0}» añadido a {1}',
'Pick a routine — sets, reps & weight come next.': 'Elige una rutina — series, repeticiones y peso vienen después.',
'{0} exercises': '{0} ejercicios',
'already in': 'ya incluido',
@@ -79,7 +79,7 @@ export default {
'Search {0} exercises…': 'Buscar entre {0} ejercicios…',
'Chosen': 'Elegidos',
'Nothing chosen yet — add exercises and they’ll show up here.': 'Nada elegido aún — añade ejercicios y aparecerán aquí.',
'No match 🤷': 'Sin resultados 🤷',
'No match': 'Sin resultados',
'Show more': 'Mostrar más',
'Intervals': 'Intervalos',
'Minutes': 'Minutos',
@@ -89,10 +89,10 @@ export default {
'Weight ({0})': 'Peso ({0})',
'Add to routine': 'Añadir a la rutina',
'Remove exercise': 'Quitar ejercicio',
'Pick an emoji': 'Elige un emoji',
'Pick an icon': 'Elige un icono',
'Back to weekly plan': 'Volver al plan semanal',
'{0} set to rest': '{0} marcado como descanso',
'{0} planned for {1} ✓': '{0} planificado para {1} ✓',
'{0} planned for {1}': '{0} planificado para {1}',
'Weekly plan:': 'Plan semanal:',
'changed for this day': 'cambiado para este día',
'Sick, missed a day or want a different session? Pick what to train instead.': '¿Enfermo, te saltaste un día o quieres otra sesión? Elige qué entrenar en su lugar.',
@@ -115,23 +115,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': 'Confirma el peso con el que trabajaste — el más alto será el predeterminado la próxima vez.',
'Then finish the superset partner.': 'Luego termina el otro ejercicio de la superserie.',
'Previous best:': 'Mejor anterior:',
'new record! 🏆': '¡nuevo récord! 🏆',
'Save ✓': 'Guardar ✓',
'Save & next exercise ›': 'Guardar y siguiente ejercicio ›',
'new record!': '¡nuevo récord!',
'Save': 'Guardar',
'Save & next exercise': 'Guardar y siguiente ejercicio',
'Just close': 'Solo cerrar',
'Save weight': 'Guardar peso',
'Tracked — next time starts at {0} 📈': 'Registrado — la próxima vez empiezas en {0} 📈',
'Tracked — next time starts at {0}': 'Registrado — la próxima vez empiezas en {0}',
"That's the whole workout!": '¡Ese era todo el entrenamiento!',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': 'Todos los ejercicios hechos — ¡buen trabajo! Termina, o sigue y añade otro ejercicio.',
'Finish workout 🏁': 'Terminar entrenamiento 🏁',
'Finish workout': 'Terminar entrenamiento',
'Continue workout': 'Continuar entrenamiento',
'Keep going 💪 — tap “+ Add exercise” below': 'Sigue así 💪 — toca «+ Añadir ejercicio» abajo',
'Keep going — tap “+ Add exercise” below': 'Sigue así — toca «+ Añadir ejercicio» abajo',
'Workout complete!': '¡Entrenamiento completado!',
'Duration': 'Duración',
'Volume': 'Volumen',
'PRs': 'Récords',
'New PR:': 'Nuevo récord:',
'Nice! 💪': '¡Genial! 💪',
'Nice!': '¡Genial!',
'Nothing logged yet': 'Nada registrado aún',
'You haven’t checked off any sets. Finish the workout anyway?': 'No has marcado ninguna serie. ¿Terminar el entrenamiento igualmente?',
'Finish anyway': 'Terminar igualmente',
@@ -151,10 +151,10 @@ export default {
'Duration (min)': 'Duración (min)',
'Last time': 'La última vez',
'Last time you hit all reps — try {0}': 'La última vez completaste todas las reps — prueba {0}',
'Weights bumped to {0} 💪': 'Pesos subidos a {0} 💪',
'Weights bumped to {0}': 'Pesos subidos a {0}',
'Remove set': 'Quitar serie',
'Add set': 'Añadir serie',
'Cardio logged 🏃': 'Cardio registrado 🏃',
'Cardio logged': 'Cardio registrado',
'Discard workout?': '¿Descartar entrenamiento?',
'The sets you logged in this session will be lost.': 'Las series registradas en esta sesión se perderán.',
'Superset {0} / {1}': 'Superserie {0} / {1}',
@@ -162,12 +162,12 @@ export default {
'Superset · do these back-to-back, rest after both': 'Superserie · hazlos seguidos, descansa después de ambos',
'Freestyle workout — add your first exercise.': 'Entrenamiento libre — añade tu primer ejercicio.',
'Finish workout early · {0} exercises': 'Terminar antes · {0} ejercicios',
'Rest over — next set! 💪': '¡Descanso terminado — siguiente serie! 💪',
'Hi {0} 💪': 'Hola {0} 💪',
'Rest over — next set!': '¡Descanso terminado — siguiente serie!',
'Hi {0}': 'Hola {0}',
'This week': 'Esta semana',
'{0} — in progress': '{0} — en curso',
'Resume ▶': 'Seguir ▶',
'Welcome! 👋': '¡Bienvenido! 👋',
'Welcome!': '¡Bienvenido!',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Configura tu rutina semanal para empezar — o carga un plan Push / Pull / Piernas ya hecho.',
'Load starter plan (PPL)': 'Cargar plan inicial (PPL)',
'Build my own plan': 'Crear mi propio plan',
@@ -185,7 +185,7 @@ export default {
'Exercise progress': 'Progreso por ejercicio',
'Top speed per workout': 'Velocidad máxima por entrenamiento',
'Best set weight per workout': 'Mejor peso por entrenamiento',
'Finish your first workout to see progress curves here. 📈': 'Termina tu primer entrenamiento para ver curvas de progreso aquí. 📈',
'Finish your first workout to see progress curves here.': 'Termina tu primer entrenamiento para ver curvas de progreso aquí.',
'Recent workouts': 'Entrenamientos recientes',
'Less time': 'Menos',
'More time': 'Más',
@@ -198,7 +198,7 @@ export default {
'Load starter plan (Push / Pull / Legs)': 'Cargar plan inicial (Push / Pull / Piernas)',
'Superset with exercise above': 'Superserie con el ejercicio de arriba',
'No exercises yet — add your first one.': 'Aún no hay ejercicios — añade el primero.',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Consejo: toca 🔗 en un ejercicio para hacer superserie con el de arriba — los harás seguidos.',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Toca el botón de enlace en un ejercicio para hacer superserie con el de arriba — los harás seguidos.',
'Delete routine?': '¿Eliminar rutina?',
'“{0}” and its exercises will be removed.': '«{0}» y sus ejercicios se eliminarán.',
'Delete routine': 'Eliminar rutina',
@@ -207,13 +207,13 @@ export default {
'No workouts yet.': 'Aún no hay entrenamientos.',
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Plan inicial cargado — Lun Push · Mié Pull · Vie Piernas',
'Enter a name': 'Introduce un nombre',
'Profile created — data from this device moved into it ✓': 'Perfil creado — los datos de este dispositivo se han movido a él ✓',
'Profile created — data moved into it ✓': 'Perfil creado — datos movidos a él ✓',
'Welcome, {0} 💪': 'Bienvenido, {0} 💪',
'Welcome back, {0} 💪': 'Bienvenido de nuevo, {0} 💪',
'Profile created — data from this device moved into it': 'Perfil creado — los datos de este dispositivo se han movido a él',
'Profile created — data moved into it': 'Perfil creado — datos movidos a él',
'Welcome, {0}': 'Bienvenido, {0}',
'Welcome back, {0}': 'Bienvenido de nuevo, {0}',
'Registration failed': 'Registro fallido',
'Sign-in failed': 'Inicio de sesión fallido',
'Create your profile ✨': 'Crea tu perfil ✨',
'Create your profile': 'Crea tu perfil',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': 'Elige un nombre y confirma con {0}. La passkey se guarda en tu dispositivo — sin contraseñas.',
'Pick a name, then confirm with your device.': 'Elige un nombre y confirma con tu dispositivo.',
'Your name': 'Tu nombre',
@@ -254,10 +254,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': 'Elimina tu plan, entrenamientos y peso corporal en este dispositivo. No se puede deshacer.',
'Delete everything': 'Eliminar todo',
'All data reset': 'Todos los datos restablecidos',
'Backup exported ✓': 'Copia exportada ✓',
'Backup exported': 'Copia exportada',
'Import backup?': '¿Importar copia?',
'This replaces all current data with the backup file.': 'Esto sustituye todos los datos actuales por el archivo de copia.',
'Backup imported ✓': 'Copia importada ✓',
'Backup imported': 'Copia importada',
'Import failed: {0}': 'Importación fallida: {0}',
'Tip': 'Consejo',
'In Chrome: ⋮ menu → Add to Home screen': 'En Chrome: menú ⋮ → Añadir a pantalla de inicio',
@@ -278,13 +278,22 @@ export default {
'Test sent — should arrive any second': 'Prueba enviada — debería llegar en segundos',
'Test failed': 'Prueba fallida',
'Notifications off': 'Notificaciones desactivadas',
'Notifications on 🔔': 'Notificaciones activadas 🔔',
'Notifications on': 'Notificaciones activadas',
'Could not change notification settings': 'No se pudo cambiar la configuración de notificaciones',
'tap to pause': 'toca para pausar',
'tap to play': 'toca para reproducir',
'back': 'espalda', 'cardio': 'cardio', 'chest': 'pecho', 'lower arms': 'antebrazos',
'lower legs': 'pantorrillas', 'neck': 'cuello', 'shoulders': 'hombros',
'upper arms': 'brazos', 'upper legs': 'piernas', 'waist': 'abdomen',
'Details': 'Detalles',
'Finish': 'Terminar',
'Start {0}': 'Empezar {0}',
'Guest mode — data lives only in this browser.': 'Modo invitado: los datos solo viven en este navegador.',
'Keeps your data safe and separate per person.': 'Mantiene tus datos seguros y separados por persona.',
'Strength': 'Fuerza',
'Equipment': 'Equipo',
'Recovery': 'Recuperación',
'Any equipment': 'Cualquier equipo',
'assisted': 'asistido', 'band': 'banda', 'barbell': 'barra', 'body weight': 'peso corporal',
'bosu ball': 'bosu', 'cable': 'polea', 'dumbbell': 'mancuerna',
'elliptical machine': 'elíptica', 'ez barbell': 'barra EZ', 'hammer': 'martillo',
@@ -320,11 +329,11 @@ export default {
'Give it a name': 'Ponle un nombre',
'Pick a body part': 'Elige una parte del cuerpo',
'“{0}” already exists': '«{0}» ya existe',
'“{0}” created ✓': '«{0}» creado ✓',
'“{0}” created': '«{0}» creado',
'Cardio exercises log time + speed instead of weight × reps.': 'Los ejercicios de cardio registran tiempo + velocidad en vez de peso × reps.',
'custom': 'propio',
'Edit': 'Editar',
'Saved ✓': 'Guardado ✓',
'Saved': 'Guardado',
'Delete “{0}”?': '¿Eliminar «{0}»?',
'It will be removed from your routines. Already-logged workouts keep their sets.': 'Se quitará de tus rutinas. Los entrenamientos ya registrados conservan sus series.',
'Exercise deleted': 'Ejercicio eliminado',
@@ -332,5 +341,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': 'Descripción (opcional) — preparación, consejos, lo que quieras recordar',
'Delete exercise': 'Eliminar ejercicio',
'Edit or delete this exercise': 'Editar o eliminar este ejercicio',
'Remove from routine': 'Quitar de la rutina'
'Remove from routine': 'Quitar de la rutina',
'Minimize': 'Minimizar',
'Expand': 'Ampliar',
'Invite code': 'Código de invitación',
'This app is invite-only — enter the code you were given.': 'Esta app es solo por invitación: introduce el código que te dieron.',
'An invite code is required': 'Se requiere un código de invitación',
'Admin dashboard': 'Panel de administración',
// --- muscle map ---
'Muscle balance': 'Equilibrio muscular',
'by sets worked': 'por series trabajadas',
'Week': 'Semana',
'not trained': 'sin entrenar',
'Not trained in this period': 'Sin entrenar en este periodo',
'Every muscle group got some work in this period.': 'Todos los grupos musculares recibieron algo de trabajo en este periodo.',
'No workouts in this period yet.': 'Aún no hay entrenamientos en este periodo.',
'What this session hits': 'Qué trabaja esta sesión',
'What you just trained': 'Lo que acabas de entrenar',
'Body diagram': 'Diagrama corporal',
'Male': 'Masculino',
'Female': 'Femenino',
'Less': 'Menos',
'More': 'Más',
'Traps': 'Trapecio',
'Shoulders': 'Hombros',
'Chest': 'Pecho',
'Upper back': 'Espalda alta',
'Serratus': 'Serrato',
'Biceps': 'Bíceps',
'Triceps': 'Tríceps',
'Forearms': 'Antebrazos',
'Abs': 'Abdominales',
'Obliques': 'Oblicuos',
'Lower back': 'Espalda baja',
'Glutes': 'Glúteos',
'Quads': 'Cuádriceps',
'Hamstrings': 'Isquiotibiales',
'Adductors': 'Aductores',
'Hip flexors': 'Flexores de cadera',
'Calves': 'Gemelos',
'Shins': 'Tibiales'
}
+83 -35
View File
@@ -43,16 +43,16 @@ export default {
'January': 'Janvier', 'February': 'Février', 'March': 'Mars', 'April': 'Avril',
'June': 'Juin', 'July': 'Juillet', 'August': 'Août', 'September': 'Septembre',
'October': 'Octobre', 'November': 'Novembre', 'December': 'Décembre',
'Quick check-in ⚖️': 'Pesée rapide ⚖️',
'Quick check-in': 'Pesée rapide',
'Log body weight': 'Noter le poids corporel',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': 'Glisse ou tape pour régler ton poids — noté avant chaque séance pour que ta courbe reste honnête.',
'Save & start workout': 'Enregistrer et démarrer',
'Skip today': "Passer aujourd'hui",
'↺ Choose a different workout': '↺ Choisir une autre séance',
'Choose a different workout': 'Choisir une autre séance',
'Recent weigh-ins': 'Pesées récentes',
'Enter a valid weight': 'Entre un poids valide',
'Weight saved ✓': 'Poids enregistré ✓',
'Target weight 🎯': 'Poids cible 🎯',
'Weight saved': 'Poids enregistré',
'Target weight': 'Poids cible',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': "Ton objectif apparaît comme une ligne sur les graphiques de poids, et les variations sont colorées selon qu'elles s'en rapprochent.",
'Save goal': "Enregistrer l'objectif",
'Goal set: {0}': 'Objectif fixé : {0}',
@@ -60,17 +60,17 @@ export default {
'Goal removed': 'Objectif supprimé',
'Remove goal': "Supprimer l'objectif",
'Body weight': 'Poids corporel',
'reached! 🎉': 'atteint ! 🎉',
'reached!': 'atteint !',
'{0} to gain': '{0} à prendre',
'{0} to lose': '{0} à perdre',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": "Aucune entrée — note ton poids pour démarrer la courbe. Il est aussi demandé avant chaque séance.",
'Best:': 'Record :',
'+ Add to my plan': '+ Ajouter à mon plan',
'Add to my plan': 'Ajouter à mon plan',
'How to': 'Exécution',
'instructions in English': 'instructions en anglais',
'New routine': 'Nouvelle routine',
'Add “{0}”': 'Ajouter « {0} »',
'“{0}” added to {1} ✓': '« {0} » ajouté à {1} ✓',
'“{0}” added to {1}': '« {0} » ajouté à {1}',
'Pick a routine — sets, reps & weight come next.': 'Choisis une routine — séries, répétitions et poids viennent ensuite.',
'{0} exercises': '{0} exercices',
'already in': 'déjà dedans',
@@ -79,7 +79,7 @@ export default {
'Search {0} exercises…': 'Rechercher parmi {0} exercices…',
'Chosen': 'Choisis',
'Nothing chosen yet — add exercises and they’ll show up here.': 'Rien de choisi — ajoute des exercices et ils apparaîtront ici.',
'No match 🤷': 'Aucun résultat 🤷',
'No match': 'Aucun résultat',
'Show more': 'Afficher plus',
'Intervals': 'Intervalles',
'Minutes': 'Minutes',
@@ -89,10 +89,10 @@ export default {
'Weight ({0})': 'Poids ({0})',
'Add to routine': 'Ajouter à la routine',
'Remove exercise': "Retirer l'exercice",
'Pick an emoji': 'Choisis un emoji',
'Pick an icon': 'Choisis une icône',
'Back to weekly plan': 'Retour au plan hebdo',
'{0} set to rest': '{0} passé en repos',
'{0} planned for {1} ✓': '{0} prévu pour {1} ✓',
'{0} planned for {1}': '{0} prévu pour {1}',
'Weekly plan:': 'Plan hebdo :',
'changed for this day': 'modifié pour ce jour',
'Sick, missed a day or want a different session? Pick what to train instead.': 'Malade, jour manqué ou envie d’autre chose ? Choisis quoi entraîner à la place.',
@@ -115,23 +115,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': 'Confirme le poids utilisé — le plus élevé devient la valeur par défaut la prochaine fois.',
'Then finish the superset partner.': 'Puis termine le partenaire du superset.',
'Previous best:': 'Ancien record :',
'new record! 🏆': 'nouveau record ! 🏆',
'Save ✓': 'Enregistrer ✓',
'Save & next exercise ›': 'Enregistrer et exercice suivant ›',
'new record!': 'nouveau record !',
'Save': 'Enregistrer',
'Save & next exercise': 'Enregistrer et exercice suivant',
'Just close': 'Juste fermer',
'Save weight': 'Enregistrer le poids',
'Tracked — next time starts at {0} 📈': 'Noté — la prochaine fois tu démarres à {0} 📈',
'Tracked — next time starts at {0}': 'Noté — la prochaine fois tu démarres à {0}',
"That's the whole workout!": 'C’était toute la séance !',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': 'Tous les exercices faits — bravo ! Termine, ou continue et ajoute un exercice.',
'Finish workout 🏁': 'Terminer la séance 🏁',
'Finish workout': 'Terminer la séance',
'Continue workout': 'Continuer la séance',
'Keep going 💪 — tap “+ Add exercise” below': 'Continue 💪 — tape « + Ajouter un exercice » en bas',
'Keep going — tap “+ Add exercise” below': 'Continue — tape « + Ajouter un exercice » en bas',
'Workout complete!': 'Séance terminée !',
'Duration': 'Durée',
'Volume': 'Volume',
'PRs': 'Records',
'New PR:': 'Nouveau record :',
'Nice! 💪': 'Bien joué ! 💪',
'Nice!': 'Bien joué !',
'Nothing logged yet': 'Rien de noté',
'You haven’t checked off any sets. Finish the workout anyway?': 'Tu n’as coché aucune série. Terminer la séance quand même ?',
'Finish anyway': 'Terminer quand même',
@@ -151,10 +151,10 @@ export default {
'Duration (min)': 'Durée (min)',
'Last time': 'La dernière fois',
'Last time you hit all reps — try {0}': 'Toutes les reps réussies la dernière fois — essaie {0}',
'Weights bumped to {0} 💪': 'Poids montés à {0} 💪',
'Weights bumped to {0}': 'Poids montés à {0}',
'Remove set': 'Retirer une série',
'Add set': 'Ajouter une série',
'Cardio logged 🏃': 'Cardio noté 🏃',
'Cardio logged': 'Cardio noté',
'Discard workout?': 'Abandonner la séance ?',
'The sets you logged in this session will be lost.': 'Les séries notées dans cette session seront perdues.',
'Superset {0} / {1}': 'Superset {0} / {1}',
@@ -162,12 +162,12 @@ export default {
'Superset · do these back-to-back, rest after both': 'Superset · enchaîne-les, repos après les deux',
'Freestyle workout — add your first exercise.': 'Séance libre — ajoute ton premier exercice.',
'Finish workout early · {0} exercises': 'Terminer plus tôt · {0} exercices',
'Rest over — next set! 💪': 'Repos fini — série suivante ! 💪',
'Hi {0} 💪': 'Salut {0} 💪',
'Rest over — next set!': 'Repos fini — série suivante !',
'Hi {0}': 'Salut {0}',
'This week': 'Cette semaine',
'{0} — in progress': '{0} — en cours',
'Resume ▶': 'Reprendre ▶',
'Welcome! 👋': 'Bienvenue ! 👋',
'Welcome!': 'Bienvenue !',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Configure ta routine hebdo pour commencer — ou charge un plan Push / Pull / Jambes tout prêt.',
'Load starter plan (PPL)': 'Charger le plan de départ (PPL)',
'Build my own plan': 'Créer mon propre plan',
@@ -185,7 +185,7 @@ export default {
'Exercise progress': 'Progression par exercice',
'Top speed per workout': 'Vitesse max par séance',
'Best set weight per workout': 'Meilleur poids par séance',
'Finish your first workout to see progress curves here. 📈': 'Termine ta première séance pour voir tes courbes de progression ici. 📈',
'Finish your first workout to see progress curves here.': 'Termine ta première séance pour voir tes courbes de progression ici.',
'Recent workouts': 'Séances récentes',
'Less time': 'Moins',
'More time': 'Plus',
@@ -198,7 +198,7 @@ export default {
'Load starter plan (Push / Pull / Legs)': 'Charger le plan de départ (Push / Pull / Jambes)',
'Superset with exercise above': "Superset avec l'exercice au-dessus",
'No exercises yet — add your first one.': 'Aucun exercice — ajoute le premier.',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Astuce : tape 🔗 sur un exercice pour le mettre en superset avec celui au-dessus — tu les feras enchaînés.',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Appuie sur le bouton de liaison d’un exercice pour le mettre en superset avec celui au-dessus — tu les enchaîneras.',
'Delete routine?': 'Supprimer la routine ?',
'“{0}” and its exercises will be removed.': '« {0} » et ses exercices seront supprimés.',
'Delete routine': 'Supprimer la routine',
@@ -207,13 +207,13 @@ export default {
'No workouts yet.': 'Aucune séance pour l’instant.',
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Plan de départ chargé — Lun Push · Mer Pull · Ven Jambes',
'Enter a name': 'Entre un nom',
'Profile created — data from this device moved into it ✓': 'Profil créé — les données de cet appareil y ont été transférées ✓',
'Profile created — data moved into it ✓': 'Profil créé — données transférées ✓',
'Welcome, {0} 💪': 'Bienvenue, {0} 💪',
'Welcome back, {0} 💪': 'Content de te revoir, {0} 💪',
'Profile created — data from this device moved into it': 'Profil créé — les données de cet appareil y ont été transférées',
'Profile created — data moved into it': 'Profil créé — données transférées',
'Welcome, {0}': 'Bienvenue, {0}',
'Welcome back, {0}': 'Content de te revoir, {0}',
'Registration failed': 'Échec de l’inscription',
'Sign-in failed': 'Échec de la connexion',
'Create your profile ✨': 'Crée ton profil ✨',
'Create your profile': 'Crée ton profil',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': 'Choisis un nom, puis confirme avec {0}. La passkey est enregistrée sur ton appareil — pas de mot de passe.',
'Pick a name, then confirm with your device.': 'Choisis un nom, puis confirme avec ton appareil.',
'Your name': 'Ton nom',
@@ -254,10 +254,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': 'Supprime ton plan, tes séances et ton poids corporel sur cet appareil. Irréversible.',
'Delete everything': 'Tout supprimer',
'All data reset': 'Toutes les données réinitialisées',
'Backup exported ✓': 'Sauvegarde exportée ✓',
'Backup exported': 'Sauvegarde exportée',
'Import backup?': 'Importer la sauvegarde ?',
'This replaces all current data with the backup file.': 'Cela remplace toutes les données actuelles par le fichier de sauvegarde.',
'Backup imported ✓': 'Sauvegarde importée ✓',
'Backup imported': 'Sauvegarde importée',
'Import failed: {0}': 'Échec de l’import : {0}',
'Tip': 'Astuce',
'In Chrome: ⋮ menu → Add to Home screen': 'Dans Chrome : menu ⋮ → Ajouter à l’écran d’accueil',
@@ -278,13 +278,22 @@ export default {
'Test sent — should arrive any second': 'Test envoyé — il devrait arriver d’une seconde à l’autre',
'Test failed': 'Échec du test',
'Notifications off': 'Notifications désactivées',
'Notifications on 🔔': 'Notifications activées 🔔',
'Notifications on': 'Notifications activées',
'Could not change notification settings': 'Impossible de modifier les réglages de notification',
'tap to pause': 'toucher pour mettre en pause',
'tap to play': 'toucher pour lire',
'back': 'dos', 'cardio': 'cardio', 'chest': 'pectoraux', 'lower arms': 'avant-bras',
'lower legs': 'mollets', 'neck': 'cou', 'shoulders': 'épaules',
'upper arms': 'bras', 'upper legs': 'cuisses', 'waist': 'abdos',
'Details': 'Détails',
'Finish': 'Terminer',
'Start {0}': 'Commencer {0}',
'Guest mode — data lives only in this browser.': 'Mode invité — les données ne vivent que dans ce navigateur.',
'Keeps your data safe and separate per person.': 'Garde tes données en sécurité et séparées par personne.',
'Strength': 'Force',
'Equipment': 'Équipement',
'Recovery': 'Récupération',
'Any equipment': 'Tout équipement',
'assisted': 'assisté', 'band': 'élastique', 'barbell': 'barre', 'body weight': 'poids du corps',
'bosu ball': 'bosu', 'cable': 'poulie', 'dumbbell': 'haltère',
'elliptical machine': 'vélo elliptique', 'ez barbell': 'barre EZ', 'hammer': 'marteau',
@@ -320,11 +329,11 @@ export default {
'Give it a name': 'Donnez-lui un nom',
'Pick a body part': 'Choisissez une partie du corps',
'“{0}” already exists': '« {0} » existe déjà',
'“{0}” created ✓': '« {0} » créé ✓',
'“{0}” created': '« {0} » créé',
'Cardio exercises log time + speed instead of weight × reps.': 'Les exercices cardio enregistrent temps + vitesse au lieu de poids × reps.',
'custom': 'perso',
'Edit': 'Modifier',
'Saved ✓': 'Enregistré ✓',
'Saved': 'Enregistré',
'Delete “{0}”?': 'Supprimer « {0} » ?',
'It will be removed from your routines. Already-logged workouts keep their sets.': 'Il sera retiré de vos routines. Les séances déjà enregistrées gardent leurs séries.',
'Exercise deleted': 'Exercice supprimé',
@@ -332,5 +341,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': 'Description (facultatif) — installation, conseils, ce que vous voulez retenir',
'Delete exercise': 'Supprimer l’exercice',
'Edit or delete this exercise': 'Modifier ou supprimer cet exercice',
'Remove from routine': 'Retirer de la routine'
'Remove from routine': 'Retirer de la routine',
'Minimize': 'Réduire',
'Expand': 'Agrandir',
'Invite code': 'Code d’invitation',
'This app is invite-only — enter the code you were given.': 'Cette appli est sur invitation — saisissez le code qu’on vous a donné.',
'An invite code is required': 'Un code d’invitation est requis',
'Admin dashboard': 'Tableau d’administration',
// --- muscle map ---
'Muscle balance': 'Équilibre musculaire',
'by sets worked': 'par séries effectuées',
'Week': 'Semaine',
'not trained': 'non travaillé',
'Not trained in this period': 'Non travaillé sur cette période',
'Every muscle group got some work in this period.': 'Chaque groupe musculaire a été sollicité sur cette période.',
'No workouts in this period yet.': 'Pas encore d\'entraînement sur cette période.',
'What this session hits': 'Ce que cette séance sollicite',
'What you just trained': 'Ce que tu viens de travailler',
'Body diagram': 'Schéma du corps',
'Male': 'Homme',
'Female': 'Femme',
'Less': 'Moins',
'More': 'Plus',
'Traps': 'Trapèzes',
'Shoulders': 'Épaules',
'Chest': 'Pectoraux',
'Upper back': 'Haut du dos',
'Serratus': 'Dentelé',
'Biceps': 'Biceps',
'Triceps': 'Triceps',
'Forearms': 'Avant-bras',
'Abs': 'Abdominaux',
'Obliques': 'Obliques',
'Lower back': 'Bas du dos',
'Glutes': 'Fessiers',
'Quads': 'Quadriceps',
'Hamstrings': 'Ischio-jambiers',
'Adductors': 'Adducteurs',
'Hip flexors': 'Fléchisseurs de hanche',
'Calves': 'Mollets',
'Shins': 'Tibiaux'
}
+83 -35
View File
@@ -43,16 +43,16 @@ export default {
'January': 'जनवरी', 'February': 'फ़रवरी', 'March': 'मार्च', 'April': 'अप्रैल',
'June': 'जून', 'July': 'जुलाई', 'August': 'अगस्त', 'September': 'सितंबर',
'October': 'अक्टूबर', 'November': 'नवंबर', 'December': 'दिसंबर',
'Quick check-in ⚖️': 'झटपट वज़न चेक ⚖️',
'Quick check-in': 'झटपट वज़न चेक',
'Log body weight': 'शरीर का वज़न दर्ज करें',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': 'वज़न सेट करने के लिए स्लाइड या टैप करें — हर वर्कआउट से पहले दर्ज होता है ताकि आपका ग्राफ़ सही रहे।',
'Save & start workout': 'सहेजें और वर्कआउट शुरू करें',
'Skip today': 'आज छोड़ें',
'↺ Choose a different workout': '↺ दूसरा वर्कआउट चुनें',
'Choose a different workout': 'दूसरा वर्कआउट चुनें',
'Recent weigh-ins': 'हाल के वज़न',
'Enter a valid weight': 'सही वज़न दर्ज करें',
'Weight saved ✓': 'वज़न सहेजा गया ✓',
'Target weight 🎯': 'लक्ष्य वज़न 🎯',
'Weight saved': 'वज़न सहेजा गया',
'Target weight': 'लक्ष्य वज़न',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': 'आपका लक्ष्य वज़न चार्ट में एक रेखा के रूप में दिखता है, और बढ़त/घटत को इस आधार पर रंगा जाता है कि वे लक्ष्य की ओर जा रहे हैं या नहीं।',
'Save goal': 'लक्ष्य सहेजें',
'Goal set: {0}': 'लक्ष्य सेट: {0}',
@@ -60,17 +60,17 @@ export default {
'Goal removed': 'लक्ष्य हटाया गया',
'Remove goal': 'लक्ष्य हटाएँ',
'Body weight': 'शरीर का वज़न',
'reached! 🎉': 'पूरा हुआ! 🎉',
'reached!': 'पूरा हुआ!',
'{0} to gain': '{0} बढ़ाना बाकी',
'{0} to lose': '{0} घटाना बाकी',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": 'अभी कोई एंट्री नहीं — ग्राफ़ शुरू करने के लिए वज़न दर्ज करें। हर वर्कआउट से पहले भी पूछा जाता है।',
'Best:': 'सर्वश्रेष्ठ:',
'+ Add to my plan': '+ मेरी योजना में जोड़ें',
'Add to my plan': 'मेरी योजना में जोड़ें',
'How to': 'कैसे करें',
'instructions in English': 'निर्देश अंग्रेज़ी में',
'New routine': 'नया रूटीन',
'Add “{0}”': '"{0}" जोड़ें',
'“{0}” added to {1} ✓': '"{0}" को {1} में जोड़ा गया ✓',
'“{0}” added to {1}': '"{0}" को {1} में जोड़ा गया',
'Pick a routine — sets, reps & weight come next.': 'एक रूटीन चुनें — सेट, रेप्स और वज़न आगे आते हैं।',
'{0} exercises': '{0} व्यायाम',
'already in': 'पहले से है',
@@ -79,7 +79,7 @@ export default {
'Search {0} exercises…': '{0} व्यायामों में खोजें…',
'Chosen': 'चुने हुए',
'Nothing chosen yet — add exercises and they’ll show up here.': 'अभी कुछ नहीं चुना — व्यायाम जोड़ें तो वे यहाँ दिखेंगे।',
'No match 🤷': 'कोई परिणाम नहीं 🤷',
'No match': 'कोई परिणाम नहीं',
'Show more': 'और दिखाएँ',
'Intervals': 'इंटरवल',
'Minutes': 'मिनट',
@@ -89,10 +89,10 @@ export default {
'Weight ({0})': 'वज़न ({0})',
'Add to routine': 'रूटीन में जोड़ें',
'Remove exercise': 'व्यायाम हटाएँ',
'Pick an emoji': 'इमोजी चुनें',
'Pick an icon': 'आइकन चुनें',
'Back to weekly plan': 'साप्ताहिक योजना पर वापस',
'{0} set to rest': '{0} आराम के लिए सेट',
'{0} planned for {1} ✓': '{0} को {1} के लिए तय किया ✓',
'{0} planned for {1}': '{0} को {1} के लिए तय किया',
'Weekly plan:': 'साप्ताहिक योजना:',
'changed for this day': 'इस दिन के लिए बदला गया',
'Sick, missed a day or want a different session? Pick what to train instead.': 'बीमार हैं, दिन छूट गया या कुछ और करना है? चुनें कि इसके बदले क्या ट्रेन करें।',
@@ -115,23 +115,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': 'जिस वज़न से काम किया उसकी पुष्टि करें — सबसे ज़्यादा वज़न अगली बार डिफ़ॉल्ट बन जाएगा।',
'Then finish the superset partner.': 'फिर सुपरसेट का दूसरा व्यायाम पूरा करें।',
'Previous best:': 'पिछला सर्वश्रेष्ठ:',
'new record! 🏆': 'नया रिकॉर्ड! 🏆',
'Save ✓': 'सहेजें ✓',
'Save & next exercise ›': 'सहेजें और अगला व्यायाम ›',
'new record!': 'नया रिकॉर्ड!',
'Save': 'सहेजें',
'Save & next exercise': 'सहेजें और अगला व्यायाम',
'Just close': 'बस बंद करें',
'Save weight': 'वज़न सहेजें',
'Tracked — next time starts at {0} 📈': 'दर्ज हुआ — अगली बार {0} से शुरू होगा 📈',
'Tracked — next time starts at {0}': 'दर्ज हुआ — अगली बार {0} से शुरू होगा',
"That's the whole workout!": 'पूरा वर्कआउट हो गया!',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': 'सारे व्यायाम पूरे — बढ़िया काम! समाप्त करें, या जारी रखें और एक और व्यायाम जोड़ें।',
'Finish workout 🏁': 'वर्कआउट समाप्त करें 🏁',
'Finish workout': 'वर्कआउट समाप्त करें',
'Continue workout': 'वर्कआउट जारी रखें',
'Keep going 💪 — tap “+ Add exercise” below': 'जारी रखें 💪 — नीचे "+ व्यायाम जोड़ें" पर टैप करें',
'Keep going — tap “+ Add exercise” below': 'जारी रखें — नीचे "+ व्यायाम जोड़ें" पर टैप करें',
'Workout complete!': 'वर्कआउट पूरा!',
'Duration': 'अवधि',
'Volume': 'वॉल्यूम',
'PRs': 'रिकॉर्ड',
'New PR:': 'नया रिकॉर्ड:',
'Nice! 💪': 'बहुत बढ़िया! 💪',
'Nice!': 'बहुत बढ़िया!',
'Nothing logged yet': 'अभी कुछ दर्ज नहीं',
'You haven’t checked off any sets. Finish the workout anyway?': 'आपने कोई सेट चेक नहीं किया। फिर भी वर्कआउट समाप्त करें?',
'Finish anyway': 'फिर भी समाप्त करें',
@@ -151,10 +151,10 @@ export default {
'Duration (min)': 'अवधि (मिनट)',
'Last time': 'पिछली बार',
'Last time you hit all reps — try {0}': 'पिछली बार सारे रेप्स पूरे किए — {0} आज़माएँ',
'Weights bumped to {0} 💪': 'वज़न बढ़ाकर {0} किया 💪',
'Weights bumped to {0}': 'वज़न बढ़ाकर {0} किया',
'Remove set': 'सेट हटाएँ',
'Add set': 'सेट जोड़ें',
'Cardio logged 🏃': 'कार्डियो दर्ज हुआ 🏃',
'Cardio logged': 'कार्डियो दर्ज हुआ',
'Discard workout?': 'वर्कआउट छोड़ें?',
'The sets you logged in this session will be lost.': 'इस सत्र में दर्ज किए सेट खो जाएँगे।',
'Superset {0} / {1}': 'सुपरसेट {0} / {1}',
@@ -162,12 +162,12 @@ export default {
'Superset · do these back-to-back, rest after both': 'सुपरसेट · इन्हें लगातार करें, दोनों के बाद आराम',
'Freestyle workout — add your first exercise.': 'फ्रीस्टाइल वर्कआउट — पहला व्यायाम जोड़ें।',
'Finish workout early · {0} exercises': 'जल्दी समाप्त करें · {0} व्यायाम',
'Rest over — next set! 💪': 'आराम खत्म — अगला सेट! 💪',
'Hi {0} 💪': 'नमस्ते {0} 💪',
'Rest over — next set!': 'आराम खत्म — अगला सेट!',
'Hi {0}': 'नमस्ते {0}',
'This week': 'इस हफ़्ते',
'{0} — in progress': '{0} — चल रहा है',
'Resume ▶': 'जारी रखें ▶',
'Welcome! 👋': 'स्वागत है! 👋',
'Welcome!': 'स्वागत है!',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'शुरू करने के लिए अपना साप्ताहिक रूटीन बनाएँ — या बना-बनाया पुश / पुल / लेग्स प्लान लोड करें।',
'Load starter plan (PPL)': 'स्टार्टर प्लान लोड करें (PPL)',
'Build my own plan': 'अपनी योजना बनाएँ',
@@ -185,7 +185,7 @@ export default {
'Exercise progress': 'व्यायाम की प्रगति',
'Top speed per workout': 'हर वर्कआउट की अधिकतम गति',
'Best set weight per workout': 'हर वर्कआउट का सर्वश्रेष्ठ सेट वज़न',
'Finish your first workout to see progress curves here. 📈': 'प्रगति ग्राफ़ देखने के लिए पहला वर्कआउट पूरा करें। 📈',
'Finish your first workout to see progress curves here.': 'प्रगति ग्राफ़ देखने के लिए पहला वर्कआउट पूरा करें।',
'Recent workouts': 'हाल के वर्कआउट',
'Less time': 'कम',
'More time': 'ज़्यादा',
@@ -198,7 +198,7 @@ export default {
'Load starter plan (Push / Pull / Legs)': 'स्टार्टर प्लान लोड करें (पुश / पुल / लेग्स)',
'Superset with exercise above': 'ऊपर वाले व्यायाम के साथ सुपरसेट',
'No exercises yet — add your first one.': 'अभी कोई व्यायाम नहीं — पहला जोड़ें।',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': 'सुझाव: किसी व्यायाम पर 🔗 टैप करें ताकि वह ऊपर वाले के साथ सुपरसेट बने — आप इन्हें लगातार करेंगे।',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': 'किसी व्यायाम पर लिंक बटन दबाएँ ताकि वह ऊपर वाले के साथ सुपरसेट बने — आप उन्हें लगातार करेंगे।',
'Delete routine?': 'रूटीन हटाएँ?',
'“{0}” and its exercises will be removed.': '"{0}" और उसके व्यायाम हटा दिए जाएँगे।',
'Delete routine': 'रूटीन हटाएँ',
@@ -207,13 +207,13 @@ export default {
'No workouts yet.': 'अभी कोई वर्कआउट नहीं।',
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'स्टार्टर प्लान लोड हुआ — सोम पुश · बुध पुल · शुक्र लेग्स',
'Enter a name': 'नाम दर्ज करें',
'Profile created — data from this device moved into it ✓': 'प्रोफ़ाइल बनी — इस डिवाइस का डेटा उसमें चला गया ✓',
'Profile created — data moved into it ✓': 'प्रोफ़ाइल बनी — डेटा स्थानांतरित ✓',
'Welcome, {0} 💪': 'स्वागत है, {0} 💪',
'Welcome back, {0} 💪': 'वापसी पर स्वागत है, {0} 💪',
'Profile created — data from this device moved into it': 'प्रोफ़ाइल बनी — इस डिवाइस का डेटा उसमें चला गया',
'Profile created — data moved into it': 'प्रोफ़ाइल बनी — डेटा स्थानांतरित',
'Welcome, {0}': 'स्वागत है, {0}',
'Welcome back, {0}': 'वापसी पर स्वागत है, {0}',
'Registration failed': 'पंजीकरण विफल',
'Sign-in failed': 'साइन-इन विफल',
'Create your profile ✨': 'अपनी प्रोफ़ाइल बनाएँ ✨',
'Create your profile': 'अपनी प्रोफ़ाइल बनाएँ',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': 'नाम चुनें, फिर {0} से पुष्टि करें। पासकी आपके डिवाइस में सहेजी जाती है — पासवर्ड की ज़रूरत नहीं।',
'Pick a name, then confirm with your device.': 'नाम चुनें, फिर अपने डिवाइस से पुष्टि करें।',
'Your name': 'आपका नाम',
@@ -254,10 +254,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': 'इस डिवाइस पर आपकी योजना, वर्कआउट और वज़न हट जाएँगे। इसे पूर्ववत नहीं किया जा सकता।',
'Delete everything': 'सब हटाएँ',
'All data reset': 'सारा डेटा रीसेट',
'Backup exported ✓': 'बैकअप निर्यात हुआ ✓',
'Backup exported': 'बैकअप निर्यात हुआ',
'Import backup?': 'बैकअप आयात करें?',
'This replaces all current data with the backup file.': 'यह वर्तमान सारा डेटा बैकअप फ़ाइल से बदल देगा।',
'Backup imported ✓': 'बैकअप आयात हुआ ✓',
'Backup imported': 'बैकअप आयात हुआ',
'Import failed: {0}': 'आयात विफल: {0}',
'Tip': 'सुझाव',
'In Chrome: ⋮ menu → Add to Home screen': 'Chrome में: ⋮ मेनू → होम स्क्रीन पर जोड़ें',
@@ -278,13 +278,22 @@ export default {
'Test sent — should arrive any second': 'परीक्षण भेजा — किसी भी क्षण पहुँचेगा',
'Test failed': 'परीक्षण विफल',
'Notifications off': 'सूचनाएँ बंद',
'Notifications on 🔔': 'सूचनाएँ चालू 🔔',
'Notifications on': 'सूचनाएँ चालू',
'Could not change notification settings': 'सूचना सेटिंग नहीं बदल सके',
'tap to pause': 'रोकने के लिए टैप करें',
'tap to play': 'चलाने के लिए टैप करें',
'back': 'पीठ', 'cardio': 'कार्डियो', 'chest': 'छाती', 'lower arms': 'अग्रबाहु',
'lower legs': 'पिंडलियाँ', 'neck': 'गर्दन', 'shoulders': 'कंधे',
'upper arms': 'बाजू', 'upper legs': 'जाँघें', 'waist': 'पेट',
'Details': 'विवरण',
'Finish': 'समाप्त',
'Start {0}': '{0} शुरू करें',
'Guest mode — data lives only in this browser.': 'अतिथि मोड — डेटा केवल इसी ब्राउज़र में रहता है।',
'Keeps your data safe and separate per person.': 'आपका डेटा सुरक्षित और हर व्यक्ति के लिए अलग रखता है।',
'Strength': 'शक्ति',
'Equipment': 'उपकरण',
'Recovery': 'रिकवरी',
'Any equipment': 'कोई भी उपकरण',
'assisted': 'सहायता प्राप्त', 'band': 'बैंड', 'barbell': 'बारबेल', 'body weight': 'शरीर का वज़न',
'bosu ball': 'बोसु बॉल', 'cable': 'केबल', 'dumbbell': 'डम्बल',
'elliptical machine': 'एलिप्टिकल मशीन', 'ez barbell': 'EZ बारबेल', 'hammer': 'हैमर',
@@ -320,11 +329,11 @@ export default {
'Give it a name': 'कोई नाम दें',
'Pick a body part': 'एक बॉडी पार्ट चुनें',
'“{0}” already exists': '“{0}” पहले से मौजूद है',
'“{0}” created ✓': '“{0}” बन गई ✓',
'“{0}” created': '“{0}” बन गई',
'Cardio exercises log time + speed instead of weight × reps.': 'कार्डियो एक्सरसाइज़ में वज़न × रेप्स की जगह समय + गति दर्ज होती है।',
'custom': 'कस्टम',
'Edit': 'संपादित करें',
'Saved ✓': 'सहेजा गया ✓',
'Saved': 'सहेजा गया',
'Delete “{0}”?': '“{0}” हटाएं?',
'It will be removed from your routines. Already-logged workouts keep their sets.': 'यह आपकी रूटीन से हट जाएगी। दर्ज की गई वर्कआउट में सेट बने रहेंगे।',
'Exercise deleted': 'एक्सरसाइज़ हटाई गई',
@@ -332,5 +341,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': 'विवरण (वैकल्पिक) — सेटअप, संकेत, जो कुछ भी याद रखना चाहें',
'Delete exercise': 'एक्सरसाइज़ हटाएं',
'Edit or delete this exercise': 'इस एक्सरसाइज़ को संपादित या हटाएं',
'Remove from routine': 'रूटीन से हटाएं'
'Remove from routine': 'रूटीन से हटाएं',
'Minimize': 'छोटा करें',
'Expand': 'बड़ा करें',
'Invite code': 'इनवाइट कोड',
'This app is invite-only — enter the code you were given.': 'यह ऐप केवल इनवाइट से है — आपको दिया गया कोड डालें।',
'An invite code is required': 'एक इनवाइट कोड आवश्यक है',
'Admin dashboard': 'एडमिन डैशबोर्ड',
// --- muscle map ---
'Muscle balance': 'मांसपेशी संतुलन',
'by sets worked': 'सेट के अनुसार',
'Week': 'सप्ताह',
'not trained': 'प्रशिक्षित नहीं',
'Not trained in this period': 'इस अवधि में प्रशिक्षित नहीं',
'Every muscle group got some work in this period.': 'इस अवधि में हर मांसपेशी समूह पर काम हुआ।',
'No workouts in this period yet.': 'इस अवधि में अभी कोई वर्कआउट नहीं।',
'What this session hits': 'यह सत्र क्या ट्रेन करता है',
'What you just trained': 'आपने अभी क्या ट्रेन किया',
'Body diagram': 'शरीर आरेख',
'Male': 'पुरुष',
'Female': 'महिला',
'Less': 'कम',
'More': 'अधिक',
'Traps': 'ट्रैपेज़ियस',
'Shoulders': 'कंधे',
'Chest': 'छाती',
'Upper back': 'ऊपरी पीठ',
'Serratus': 'सेरेटस',
'Biceps': 'बाइसेप्स',
'Triceps': 'ट्राइसेप्स',
'Forearms': 'अग्रभुजा',
'Abs': 'एब्स',
'Obliques': 'तिरछी मांसपेशियाँ',
'Lower back': 'निचली पीठ',
'Glutes': 'ग्लूट्स',
'Quads': 'क्वाड्स',
'Hamstrings': 'हैमस्ट्रिंग',
'Adductors': 'एडक्टर',
'Hip flexors': 'हिप फ्लेक्सर',
'Calves': 'पिंडली',
'Shins': 'पिंडली की हड्डी'
}
+83 -35
View File
@@ -43,16 +43,16 @@ export default {
'January': 'Gennaio', 'February': 'Febbraio', 'March': 'Marzo', 'April': 'Aprile',
'June': 'Giugno', 'July': 'Luglio', 'August': 'Agosto', 'September': 'Settembre',
'October': 'Ottobre', 'November': 'Novembre', 'December': 'Dicembre',
'Quick check-in ⚖️': 'Check-in veloce ⚖️',
'Quick check-in': 'Check-in veloce',
'Log body weight': 'Registra peso corporeo',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': 'Scorri o tocca per impostare il peso — registrato prima di ogni allenamento così la tua curva resta onesta.',
'Save & start workout': 'Salva e inizia',
'Skip today': 'Salta oggi',
'↺ Choose a different workout': '↺ Scegli un altro allenamento',
'Choose a different workout': 'Scegli un altro allenamento',
'Recent weigh-ins': 'Pesate recenti',
'Enter a valid weight': 'Inserisci un peso valido',
'Weight saved ✓': 'Peso salvato ✓',
'Target weight 🎯': 'Peso obiettivo 🎯',
'Weight saved': 'Peso salvato',
'Target weight': 'Peso obiettivo',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': 'Il tuo obiettivo appare come una linea nei grafici del peso, e aumenti/cali sono colorati a seconda che vi si avvicinino.',
'Save goal': 'Salva obiettivo',
'Goal set: {0}': 'Obiettivo impostato: {0}',
@@ -60,17 +60,17 @@ export default {
'Goal removed': 'Obiettivo rimosso',
'Remove goal': 'Rimuovi obiettivo',
'Body weight': 'Peso corporeo',
'reached! 🎉': 'raggiunto! 🎉',
'reached!': 'raggiunto!',
'{0} to gain': '{0} da prendere',
'{0} to lose': '{0} da perdere',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": 'Nessun dato — registra il tuo peso per iniziare la curva. Viene chiesto anche prima di ogni allenamento.',
'Best:': 'Record:',
'+ Add to my plan': '+ Aggiungi al mio piano',
'Add to my plan': 'Aggiungi al mio piano',
'How to': 'Esecuzione',
'instructions in English': 'istruzioni in inglese',
'New routine': 'Nuova routine',
'Add “{0}”': 'Aggiungi «{0}»',
'“{0}” added to {1} ✓': '«{0}» aggiunto a {1} ✓',
'“{0}” added to {1}': '«{0}» aggiunto a {1}',
'Pick a routine — sets, reps & weight come next.': 'Scegli una routine — serie, ripetizioni e peso arrivano dopo.',
'{0} exercises': '{0} esercizi',
'already in': 'già incluso',
@@ -79,7 +79,7 @@ export default {
'Search {0} exercises…': 'Cerca tra {0} esercizi…',
'Chosen': 'Scelti',
'Nothing chosen yet — add exercises and they’ll show up here.': 'Ancora niente — aggiungi esercizi e appariranno qui.',
'No match 🤷': 'Nessun risultato 🤷',
'No match': 'Nessun risultato',
'Show more': 'Mostra altro',
'Intervals': 'Intervalli',
'Minutes': 'Minuti',
@@ -89,10 +89,10 @@ export default {
'Weight ({0})': 'Peso ({0})',
'Add to routine': 'Aggiungi alla routine',
'Remove exercise': 'Rimuovi esercizio',
'Pick an emoji': 'Scegli un emoji',
'Pick an icon': 'Scegli un’icona',
'Back to weekly plan': 'Torna al piano settimanale',
'{0} set to rest': '{0} impostato a riposo',
'{0} planned for {1} ✓': '{0} pianificato per {1} ✓',
'{0} planned for {1}': '{0} pianificato per {1}',
'Weekly plan:': 'Piano settimanale:',
'changed for this day': 'modificato per questo giorno',
'Sick, missed a day or want a different session? Pick what to train instead.': 'Malato, giorno saltato o voglia di altro? Scegli cosa allenare al suo posto.',
@@ -115,23 +115,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': 'Conferma il peso usato — il più alto diventa il predefinito la prossima volta.',
'Then finish the superset partner.': "Poi completa l'altro esercizio del superset.",
'Previous best:': 'Record precedente:',
'new record! 🏆': 'nuovo record! 🏆',
'Save ✓': 'Salva ✓',
'Save & next exercise ›': 'Salva e prossimo esercizio ›',
'new record!': 'nuovo record!',
'Save': 'Salva',
'Save & next exercise': 'Salva e prossimo esercizio',
'Just close': 'Chiudi soltanto',
'Save weight': 'Salva peso',
'Tracked — next time starts at {0} 📈': 'Registrato — la prossima volta parti da {0} 📈',
'Tracked — next time starts at {0}': 'Registrato — la prossima volta parti da {0}',
"That's the whole workout!": 'Allenamento completato!',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': 'Tutti gli esercizi fatti — ottimo lavoro! Concludi, o continua e aggiungi un altro esercizio.',
'Finish workout 🏁': 'Termina allenamento 🏁',
'Finish workout': 'Termina allenamento',
'Continue workout': 'Continua allenamento',
'Keep going 💪 — tap “+ Add exercise” below': 'Continua così 💪 — tocca «+ Aggiungi esercizio» in basso',
'Keep going — tap “+ Add exercise” below': 'Continua così — tocca «+ Aggiungi esercizio» in basso',
'Workout complete!': 'Allenamento completato!',
'Duration': 'Durata',
'Volume': 'Volume',
'PRs': 'Record',
'New PR:': 'Nuovo record:',
'Nice! 💪': 'Grande! 💪',
'Nice!': 'Grande!',
'Nothing logged yet': 'Niente registrato',
'You haven’t checked off any sets. Finish the workout anyway?': 'Non hai spuntato nessuna serie. Terminare comunque?',
'Finish anyway': 'Termina comunque',
@@ -151,10 +151,10 @@ export default {
'Duration (min)': 'Durata (min)',
'Last time': "L'ultima volta",
'Last time you hit all reps — try {0}': "L'ultima volta hai completato tutte le rip. — prova {0}",
'Weights bumped to {0} 💪': 'Pesi aumentati a {0} 💪',
'Weights bumped to {0}': 'Pesi aumentati a {0}',
'Remove set': 'Rimuovi serie',
'Add set': 'Aggiungi serie',
'Cardio logged 🏃': 'Cardio registrato 🏃',
'Cardio logged': 'Cardio registrato',
'Discard workout?': 'Scartare allenamento?',
'The sets you logged in this session will be lost.': 'Le serie registrate in questa sessione andranno perse.',
'Superset {0} / {1}': 'Superset {0} / {1}',
@@ -162,12 +162,12 @@ export default {
'Superset · do these back-to-back, rest after both': 'Superset · falli uno dopo l’altro, riposo dopo entrambi',
'Freestyle workout — add your first exercise.': 'Allenamento libero — aggiungi il primo esercizio.',
'Finish workout early · {0} exercises': 'Termina in anticipo · {0} esercizi',
'Rest over — next set! 💪': 'Riposo finito — prossima serie! 💪',
'Hi {0} 💪': 'Ciao {0} 💪',
'Rest over — next set!': 'Riposo finito — prossima serie!',
'Hi {0}': 'Ciao {0}',
'This week': 'Questa settimana',
'{0} — in progress': '{0} — in corso',
'Resume ▶': 'Riprendi ▶',
'Welcome! 👋': 'Benvenuto! 👋',
'Welcome!': 'Benvenuto!',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Imposta la tua routine settimanale — o carica un piano Push / Pull / Gambe già pronto.',
'Load starter plan (PPL)': 'Carica piano iniziale (PPL)',
'Build my own plan': 'Crea il mio piano',
@@ -185,7 +185,7 @@ export default {
'Exercise progress': 'Progressi per esercizio',
'Top speed per workout': 'Velocità massima per allenamento',
'Best set weight per workout': 'Miglior peso per allenamento',
'Finish your first workout to see progress curves here. 📈': 'Completa il primo allenamento per vedere qui le curve dei progressi. 📈',
'Finish your first workout to see progress curves here.': 'Completa il primo allenamento per vedere qui le curve dei progressi.',
'Recent workouts': 'Allenamenti recenti',
'Less time': 'Meno',
'More time': 'Più',
@@ -198,7 +198,7 @@ export default {
'Load starter plan (Push / Pull / Legs)': 'Carica piano iniziale (Push / Pull / Gambe)',
'Superset with exercise above': "Superset con l'esercizio sopra",
'No exercises yet — add your first one.': 'Ancora nessun esercizio — aggiungi il primo.',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Suggerimento: tocca 🔗 su un esercizio per farne un superset con quello sopra — li farai uno dopo l’altro.',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Tocca il pulsante di collegamento su un esercizio per farne un superset con quello sopra — li farai di seguito.',
'Delete routine?': 'Eliminare routine?',
'“{0}” and its exercises will be removed.': '«{0}» e i suoi esercizi verranno rimossi.',
'Delete routine': 'Elimina routine',
@@ -207,13 +207,13 @@ export default {
'No workouts yet.': 'Ancora nessun allenamento.',
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Piano iniziale caricato — Lun Push · Mer Pull · Ven Gambe',
'Enter a name': 'Inserisci un nome',
'Profile created — data from this device moved into it ✓': 'Profilo creato — i dati di questo dispositivo sono stati trasferiti ✓',
'Profile created — data moved into it ✓': 'Profilo creato — dati trasferiti ✓',
'Welcome, {0} 💪': 'Benvenuto, {0} 💪',
'Welcome back, {0} 💪': 'Bentornato, {0} 💪',
'Profile created — data from this device moved into it': 'Profilo creato — i dati di questo dispositivo sono stati trasferiti',
'Profile created — data moved into it': 'Profilo creato — dati trasferiti',
'Welcome, {0}': 'Benvenuto, {0}',
'Welcome back, {0}': 'Bentornato, {0}',
'Registration failed': 'Registrazione fallita',
'Sign-in failed': 'Accesso fallito',
'Create your profile ✨': 'Crea il tuo profilo ✨',
'Create your profile': 'Crea il tuo profilo',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': 'Scegli un nome e conferma con {0}. La passkey viene salvata sul tuo dispositivo — nessuna password.',
'Pick a name, then confirm with your device.': 'Scegli un nome e conferma con il tuo dispositivo.',
'Your name': 'Il tuo nome',
@@ -254,10 +254,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': 'Elimina piano, allenamenti e peso corporeo su questo dispositivo. Irreversibile.',
'Delete everything': 'Elimina tutto',
'All data reset': 'Tutti i dati azzerati',
'Backup exported ✓': 'Backup esportato ✓',
'Backup exported': 'Backup esportato',
'Import backup?': 'Importare backup?',
'This replaces all current data with the backup file.': 'Sostituisce tutti i dati attuali con il file di backup.',
'Backup imported ✓': 'Backup importato ✓',
'Backup imported': 'Backup importato',
'Import failed: {0}': 'Import fallito: {0}',
'Tip': 'Suggerimento',
'In Chrome: ⋮ menu → Add to Home screen': 'In Chrome: menu ⋮ → Aggiungi a schermata Home',
@@ -278,13 +278,22 @@ export default {
'Test sent — should arrive any second': 'Prova inviata — dovrebbe arrivare a momenti',
'Test failed': 'Prova fallita',
'Notifications off': 'Notifiche disattivate',
'Notifications on 🔔': 'Notifiche attivate 🔔',
'Notifications on': 'Notifiche attivate',
'Could not change notification settings': 'Impossibile modificare le impostazioni delle notifiche',
'tap to pause': 'tocca per mettere in pausa',
'tap to play': 'tocca per riprodurre',
'back': 'schiena', 'cardio': 'cardio', 'chest': 'petto', 'lower arms': 'avambracci',
'lower legs': 'polpacci', 'neck': 'collo', 'shoulders': 'spalle',
'upper arms': 'braccia', 'upper legs': 'gambe', 'waist': 'addome',
'Details': 'Dettagli',
'Finish': 'Termina',
'Start {0}': 'Inizia {0}',
'Guest mode — data lives only in this browser.': 'Modalità ospite — i dati restano solo in questo browser.',
'Keeps your data safe and separate per person.': 'Mantiene i tuoi dati al sicuro e separati per persona.',
'Strength': 'Forza',
'Equipment': 'Attrezzi',
'Recovery': 'Recupero',
'Any equipment': 'Qualsiasi attrezzo',
'assisted': 'assistito', 'band': 'elastico', 'barbell': 'bilanciere', 'body weight': 'corpo libero',
'bosu ball': 'bosu', 'cable': 'cavo', 'dumbbell': 'manubrio',
'elliptical machine': 'ellittica', 'ez barbell': 'bilanciere EZ', 'hammer': 'martello',
@@ -320,11 +329,11 @@ export default {
'Give it a name': 'Dagli un nome',
'Pick a body part': 'Scegli una parte del corpo',
'“{0}” already exists': '«{0}» esiste già',
'“{0}” created ✓': '«{0}» creato ✓',
'“{0}” created': '«{0}» creato',
'Cardio exercises log time + speed instead of weight × reps.': 'Gli esercizi cardio registrano tempo + velocità invece di peso × rip.',
'custom': 'personale',
'Edit': 'Modifica',
'Saved ✓': 'Salvato ✓',
'Saved': 'Salvato',
'Delete “{0}”?': 'Eliminare «{0}»?',
'It will be removed from your routines. Already-logged workouts keep their sets.': 'Verrà rimosso dalle tue routine. Gli allenamenti già registrati mantengono le loro serie.',
'Exercise deleted': 'Esercizio eliminato',
@@ -332,5 +341,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': 'Descrizione (facoltativa) — setup, spunti, quello che vuoi ricordare',
'Delete exercise': 'Elimina esercizio',
'Edit or delete this exercise': 'Modifica o elimina questo esercizio',
'Remove from routine': 'Rimuovi dalla routine'
'Remove from routine': 'Rimuovi dalla routine',
'Minimize': 'Riduci',
'Expand': 'Ingrandisci',
'Invite code': 'Codice di invito',
'This app is invite-only — enter the code you were given.': 'Questa app è solo su invito: inserisci il codice che hai ricevuto.',
'An invite code is required': 'È richiesto un codice di invito',
'Admin dashboard': 'Pannello di amministrazione',
// --- muscle map ---
'Muscle balance': 'Equilibrio muscolare',
'by sets worked': 'per serie svolte',
'Week': 'Settimana',
'not trained': 'non allenato',
'Not trained in this period': 'Non allenati in questo periodo',
'Every muscle group got some work in this period.': 'Ogni gruppo muscolare ha lavorato in questo periodo.',
'No workouts in this period yet.': 'Ancora nessun allenamento in questo periodo.',
'What this session hits': 'Cosa allena questa sessione',
'What you just trained': 'Cosa hai appena allenato',
'Body diagram': 'Diagramma del corpo',
'Male': 'Uomo',
'Female': 'Donna',
'Less': 'Meno',
'More': 'Più',
'Traps': 'Trapezio',
'Shoulders': 'Spalle',
'Chest': 'Petto',
'Upper back': 'Dorsali',
'Serratus': 'Dentato',
'Biceps': 'Bicipiti',
'Triceps': 'Tricipiti',
'Forearms': 'Avambracci',
'Abs': 'Addominali',
'Obliques': 'Obliqui',
'Lower back': 'Lombari',
'Glutes': 'Glutei',
'Quads': 'Quadricipiti',
'Hamstrings': 'Femorali',
'Adductors': 'Adduttori',
'Hip flexors': 'Flessori dell\'anca',
'Calves': 'Polpacci',
'Shins': 'Tibiali'
}
+83 -35
View File
@@ -43,16 +43,16 @@ export default {
'January': '1월', 'February': '2월', 'March': '3월', 'April': '4월',
'June': '6월', 'July': '7월', 'August': '8월', 'September': '9월',
'October': '10월', 'November': '11월', 'December': '12월',
'Quick check-in ⚖️': '빠른 체중 체크 ⚖️',
'Quick check-in': '빠른 체중 체크',
'Log body weight': '체중 기록',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': '슬라이드하거나 탭해서 체중을 설정하세요 — 매 운동 전에 기록되어 그래프가 정직하게 유지됩니다.',
'Save & start workout': '저장하고 운동 시작',
'Skip today': '오늘은 건너뛰기',
'↺ Choose a different workout': '↺ 다른 운동 선택',
'Choose a different workout': '다른 운동 선택',
'Recent weigh-ins': '최근 체중 기록',
'Enter a valid weight': '올바른 무게를 입력하세요',
'Weight saved ✓': '체중 저장됨 ✓',
'Target weight 🎯': '목표 체중 🎯',
'Weight saved': '체중 저장됨',
'Target weight': '목표 체중',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': '목표가 체중 그래프에 선으로 표시되며, 증감은 목표에 가까워지는지에 따라 색이 입혀집니다.',
'Save goal': '목표 저장',
'Goal set: {0}': '목표 설정: {0}',
@@ -60,17 +60,17 @@ export default {
'Goal removed': '목표 삭제됨',
'Remove goal': '목표 삭제',
'Body weight': '체중',
'reached! 🎉': '달성! 🎉',
'reached!': '달성!',
'{0} to gain': '{0} 증량 남음',
'{0} to lose': '{0} 감량 남음',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": '아직 기록이 없어요 — 체중을 기록해 그래프를 시작하세요. 매 운동 전에도 물어봅니다.',
'Best:': '최고 기록:',
'+ Add to my plan': '+ 내 계획에 추가',
'Add to my plan': '내 계획에 추가',
'How to': '운동 방법',
'instructions in English': '설명은 영어로 제공',
'New routine': '새 루틴',
'Add “{0}”': '"{0}" 추가',
'“{0}” added to {1} ✓': '"{0}"이(가) {1}에 추가됨 ✓',
'“{0}” added to {1}': '"{0}"이(가) {1}에 추가됨',
'Pick a routine — sets, reps & weight come next.': '루틴을 선택하세요 — 세트, 횟수, 무게는 다음 단계입니다.',
'{0} exercises': '운동 {0}개',
'already in': '이미 있음',
@@ -79,7 +79,7 @@ export default {
'Search {0} exercises…': '{0}개 운동 검색…',
'Chosen': '즐겨찾기',
'Nothing chosen yet — add exercises and they’ll show up here.': '아직 없어요 — 운동을 추가하면 여기에 표시됩니다.',
'No match 🤷': '검색 결과 없음 🤷',
'No match': '검색 결과 없음',
'Show more': '더 보기',
'Intervals': '인터벌',
'Minutes': '분',
@@ -89,10 +89,10 @@ export default {
'Weight ({0})': '무게 ({0})',
'Add to routine': '루틴에 추가',
'Remove exercise': '운동 제거',
'Pick an emoji': '이모지 선택',
'Pick an icon': '아이콘 선택',
'Back to weekly plan': '주간 계획으로 복귀',
'{0} set to rest': '{0}을(를) 휴식일로 설정',
'{0} planned for {1} ✓': '{1}에 {0} 예정됨 ✓',
'{0} planned for {1}': '{1}에 {0} 예정됨',
'Weekly plan:': '주간 계획:',
'changed for this day': '이 날만 변경됨',
'Sick, missed a day or want a different session? Pick what to train instead.': '아프거나, 하루를 놓쳤거나, 다른 운동이 하고 싶나요? 대신 할 운동을 선택하세요.',
@@ -115,23 +115,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': '사용한 무게를 확인하세요 — 최고 무게가 다음번 기본값이 됩니다.',
'Then finish the superset partner.': '그다음 슈퍼세트 짝 운동을 마무리하세요.',
'Previous best:': '이전 최고 기록:',
'new record! 🏆': '신기록! 🏆',
'Save ✓': '저장 ✓',
'Save & next exercise ›': '저장하고 다음 운동 ›',
'new record!': '신기록!',
'Save': '저장',
'Save & next exercise': '저장하고 다음 운동',
'Just close': '그냥 닫기',
'Save weight': '무게 저장',
'Tracked — next time starts at {0} 📈': '기록됨 — 다음번엔 {0}부터 시작합니다 📈',
'Tracked — next time starts at {0}': '기록됨 — 다음번엔 {0}부터 시작합니다',
"That's the whole workout!": '오늘 운동 전부 끝!',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': '모든 운동 완료 — 수고했어요! 마무리하거나, 계속해서 운동을 추가하세요.',
'Finish workout 🏁': '운동 마치기 🏁',
'Finish workout': '운동 마치기',
'Continue workout': '운동 계속하기',
'Keep going 💪 — tap “+ Add exercise” below': '계속 가요 💪 — 아래 "+ 운동 추가"를 탭하세요',
'Keep going — tap “+ Add exercise” below': '계속 가요 — 아래 "+ 운동 추가"를 탭하세요',
'Workout complete!': '운동 완료!',
'Duration': '시간',
'Volume': '볼륨',
'PRs': '신기록',
'New PR:': '신기록:',
'Nice! 💪': '좋아요! 💪',
'Nice!': '좋아요!',
'Nothing logged yet': '아직 기록 없음',
'You haven’t checked off any sets. Finish the workout anyway?': '체크한 세트가 없어요. 그래도 운동을 마칠까요?',
'Finish anyway': '그래도 마치기',
@@ -151,10 +151,10 @@ export default {
'Duration (min)': '시간 (분)',
'Last time': '지난번',
'Last time you hit all reps — try {0}': '지난번에 모든 횟수를 채웠어요 — {0}에 도전해 보세요',
'Weights bumped to {0} 💪': '무게를 {0}(으)로 올렸어요 💪',
'Weights bumped to {0}': '무게를 {0}(으)로 올렸어요',
'Remove set': '세트 빼기',
'Add set': '세트 추가',
'Cardio logged 🏃': '유산소 기록됨 🏃',
'Cardio logged': '유산소 기록됨',
'Discard workout?': '운동을 버릴까요?',
'The sets you logged in this session will be lost.': '이 세션에서 기록한 세트가 사라집니다.',
'Superset {0} / {1}': '슈퍼세트 {0} / {1}',
@@ -162,12 +162,12 @@ export default {
'Superset · do these back-to-back, rest after both': '슈퍼세트 · 연달아 수행하고, 둘 다 끝난 뒤 휴식',
'Freestyle workout — add your first exercise.': '자유 운동 — 첫 운동을 추가하세요.',
'Finish workout early · {0} exercises': '일찍 마치기 · 운동 {0}개',
'Rest over — next set! 💪': '휴식 끝 — 다음 세트! 💪',
'Hi {0} 💪': '안녕하세요 {0} 💪',
'Rest over — next set!': '휴식 끝 — 다음 세트!',
'Hi {0}': '안녕하세요 {0}',
'This week': '이번 주',
'{0} — in progress': '{0} — 진행 중',
'Resume ▶': '이어하기 ▶',
'Welcome! 👋': '환영합니다! 👋',
'Welcome!': '환영합니다!',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': '주간 루틴을 설정해 시작하세요 — 또는 미리 만들어진 푸시 / 풀 / 레그 계획을 불러오세요.',
'Load starter plan (PPL)': '스타터 계획 불러오기 (PPL)',
'Build my own plan': '내 계획 만들기',
@@ -185,7 +185,7 @@ export default {
'Exercise progress': '운동별 진행 상황',
'Top speed per workout': '운동별 최고 속도',
'Best set weight per workout': '운동별 최고 세트 무게',
'Finish your first workout to see progress curves here. 📈': '첫 운동을 마치면 여기에 진행 그래프가 표시됩니다. 📈',
'Finish your first workout to see progress curves here.': '첫 운동을 마치면 여기에 진행 그래프가 표시됩니다.',
'Recent workouts': '최근 운동',
'Less time': '적음',
'More time': '많음',
@@ -198,7 +198,7 @@ export default {
'Load starter plan (Push / Pull / Legs)': '스타터 계획 불러오기 (푸시 / 풀 / 레그)',
'Superset with exercise above': '위 운동과 슈퍼세트',
'No exercises yet — add your first one.': '아직 운동이 없어요 — 첫 운동을 추가하세요.',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': '팁: 운동의 🔗를 탭하면 위 운동과 슈퍼세트가 됩니다 — 연달아 수행하게 돼요.',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': '운동의 연결 버튼을 탭하면 위 운동과 슈퍼세트가 됩니다 — 연달아 수행하게 돼요.',
'Delete routine?': '루틴을 삭제할까요?',
'“{0}” and its exercises will be removed.': '"{0}"과(와) 그 운동들이 삭제됩니다.',
'Delete routine': '루틴 삭제',
@@ -207,13 +207,13 @@ export default {
'No workouts yet.': '아직 운동 기록이 없어요.',
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': '스타터 계획 불러옴 — 월 푸시 · 수 풀 · 금 레그',
'Enter a name': '이름을 입력하세요',
'Profile created — data from this device moved into it ✓': '프로필 생성됨 — 이 기기의 데이터가 이동됨 ✓',
'Profile created — data moved into it ✓': '프로필 생성됨 — 데이터 이동됨 ✓',
'Welcome, {0} 💪': '환영합니다, {0} 💪',
'Welcome back, {0} 💪': '다시 오셨네요, {0} 💪',
'Profile created — data from this device moved into it': '프로필 생성됨 — 이 기기의 데이터가 이동됨',
'Profile created — data moved into it': '프로필 생성됨 — 데이터 이동됨',
'Welcome, {0}': '환영합니다, {0}',
'Welcome back, {0}': '다시 오셨네요, {0}',
'Registration failed': '등록 실패',
'Sign-in failed': '로그인 실패',
'Create your profile ✨': '프로필 만들기 ✨',
'Create your profile': '프로필 만들기',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': '이름을 정한 뒤 {0}(으)로 확인하세요. 패스키는 기기에 저장됩니다 — 비밀번호가 필요 없어요.',
'Pick a name, then confirm with your device.': '이름을 정한 뒤 기기로 확인하세요.',
'Your name': '이름',
@@ -254,10 +254,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': '이 기기의 계획, 운동, 체중을 삭제합니다. 되돌릴 수 없어요.',
'Delete everything': '전부 삭제',
'All data reset': '모든 데이터 초기화됨',
'Backup exported ✓': '백업 내보냄 ✓',
'Backup exported': '백업 내보냄',
'Import backup?': '백업을 가져올까요?',
'This replaces all current data with the backup file.': '현재 모든 데이터가 백업 파일로 대체됩니다.',
'Backup imported ✓': '백업 가져옴 ✓',
'Backup imported': '백업 가져옴',
'Import failed: {0}': '가져오기 실패: {0}',
'Tip': '팁',
'In Chrome: ⋮ menu → Add to Home screen': 'Chrome에서: ⋮ 메뉴 → 홈 화면에 추가',
@@ -278,13 +278,22 @@ export default {
'Test sent — should arrive any second': '테스트 전송됨 — 곧 도착합니다',
'Test failed': '테스트 실패',
'Notifications off': '알림 꺼짐',
'Notifications on 🔔': '알림 켜짐 🔔',
'Notifications on': '알림 켜짐',
'Could not change notification settings': '알림 설정을 변경할 수 없었어요',
'tap to pause': '탭하여 일시정지',
'tap to play': '탭하여 재생',
'back': '등', 'cardio': '유산소', 'chest': '가슴', 'lower arms': '전완',
'lower legs': '종아리', 'neck': '목', 'shoulders': '어깨',
'upper arms': '팔', 'upper legs': '허벅지', 'waist': '복부',
'Details': '상세',
'Finish': '마치기',
'Start {0}': '{0} 시작',
'Guest mode — data lives only in this browser.': '게스트 모드 — 데이터는 이 브라우저에만 저장됩니다.',
'Keeps your data safe and separate per person.': '데이터를 안전하게, 사람별로 분리해 보관합니다.',
'Strength': '근력',
'Equipment': '장비',
'Recovery': '회복',
'Any equipment': '모든 장비',
'assisted': '보조', 'band': '밴드', 'barbell': '바벨', 'body weight': '맨몸',
'bosu ball': '보수볼', 'cable': '케이블', 'dumbbell': '덤벨',
'elliptical machine': '일립티컬', 'ez barbell': 'EZ바', 'hammer': '해머',
@@ -320,11 +329,11 @@ export default {
'Give it a name': '이름을 입력하세요',
'Pick a body part': '부위를 선택하세요',
'“{0}” already exists': '“{0}”은(는) 이미 있습니다',
'“{0}” created ✓': '“{0}” 생성됨 ✓',
'“{0}” created': '“{0}” 생성됨',
'Cardio exercises log time + speed instead of weight × reps.': '유산소 운동은 무게 × 횟수 대신 시간 + 속도를 기록합니다.',
'custom': '커스텀',
'Edit': '편집',
'Saved ✓': '저장됨 ✓',
'Saved': '저장됨',
'Delete “{0}”?': '“{0}” 삭제할까요?',
'It will be removed from your routines. Already-logged workouts keep their sets.': '루틴에서 제거됩니다. 이미 기록된 운동은 세트를 유지합니다.',
'Exercise deleted': '운동 삭제됨',
@@ -332,5 +341,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': '설명 (선택) — 세팅, 큐, 기억하고 싶은 모든 것',
'Delete exercise': '운동 삭제',
'Edit or delete this exercise': '이 운동 편집 또는 삭제',
'Remove from routine': '루틴에서 제거'
'Remove from routine': '루틴에서 제거',
'Minimize': '축소',
'Expand': '확대',
'Invite code': '초대 코드',
'This app is invite-only — enter the code you were given.': '이 앱은 초대 전용입니다 — 받은 코드를 입력하세요.',
'An invite code is required': '초대 코드가 필요합니다',
'Admin dashboard': '관리자 대시보드',
// --- muscle map ---
'Muscle balance': '근육 균형',
'by sets worked': '세트 수 기준',
'Week': '이번 주',
'not trained': '훈련 안 함',
'Not trained in this period': '이 기간에 훈련하지 않음',
'Every muscle group got some work in this period.': '이 기간에 모든 근육군을 훈련했습니다.',
'No workouts in this period yet.': '이 기간에 아직 운동이 없습니다.',
'What this session hits': '이 세션이 자극하는 부위',
'What you just trained': '방금 훈련한 부위',
'Body diagram': '신체 도해',
'Male': '남성',
'Female': '여성',
'Less': '적음',
'More': '많음',
'Traps': '승모근',
'Shoulders': '어깨',
'Chest': '가슴',
'Upper back': '등 상부',
'Serratus': '전거근',
'Biceps': '이두근',
'Triceps': '삼두근',
'Forearms': '전완근',
'Abs': '복근',
'Obliques': '복사근',
'Lower back': '허리',
'Glutes': '둔근',
'Quads': '대퇴사두근',
'Hamstrings': '햄스트링',
'Adductors': '내전근',
'Hip flexors': '고관절 굴곡근',
'Calves': '종아리',
'Shins': '정강이'
}
+83 -35
View File
@@ -43,16 +43,16 @@ export default {
'January': 'Styczeń', 'February': 'Luty', 'March': 'Marzec', 'April': 'Kwiecień',
'June': 'Czerwiec', 'July': 'Lipiec', 'August': 'Sierpień', 'September': 'Wrzesień',
'October': 'Październik', 'November': 'Listopad', 'December': 'Grudzień',
'Quick check-in ⚖️': 'Szybkie ważenie ⚖️',
'Quick check-in': 'Szybkie ważenie',
'Log body weight': 'Zapisz masę ciała',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': 'Przesuń lub dotknij, aby ustawić wagę — zapisywana przed każdym treningiem, żeby krzywa była uczciwa.',
'Save & start workout': 'Zapisz i zacznij trening',
'Skip today': 'Pomiń dziś',
'↺ Choose a different workout': '↺ Wybierz inny trening',
'Choose a different workout': 'Wybierz inny trening',
'Recent weigh-ins': 'Ostatnie ważenia',
'Enter a valid weight': 'Podaj prawidłową wagę',
'Weight saved ✓': 'Waga zapisana ✓',
'Target weight 🎯': 'Waga docelowa 🎯',
'Weight saved': 'Waga zapisana',
'Target weight': 'Waga docelowa',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': 'Twój cel jest rysowany jako linia na wykresach wagi, a zmiany są kolorowane zależnie od tego, czy się do niego zbliżają.',
'Save goal': 'Zapisz cel',
'Goal set: {0}': 'Cel ustawiony: {0}',
@@ -60,17 +60,17 @@ export default {
'Goal removed': 'Cel usunięty',
'Remove goal': 'Usuń cel',
'Body weight': 'Masa ciała',
'reached! 🎉': 'osiągnięty! 🎉',
'reached!': 'osiągnięty!',
'{0} to gain': '{0} do przybrania',
'{0} to lose': '{0} do zrzucenia',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": 'Brak wpisów — zapisz wagę, aby zacząć krzywą. Pytamy o nią też przed każdym treningiem.',
'Best:': 'Rekord:',
'+ Add to my plan': '+ Dodaj do mojego planu',
'Add to my plan': 'Dodaj do mojego planu',
'How to': 'Wykonanie',
'instructions in English': 'instrukcje po angielsku',
'New routine': 'Nowy plan treningowy',
'Add “{0}”': 'Dodaj „{0}”',
'“{0}” added to {1} ✓': '„{0}” dodano do {1} ✓',
'“{0}” added to {1}': '„{0}” dodano do {1}',
'Pick a routine — sets, reps & weight come next.': 'Wybierz plan — serie, powtórzenia i ciężar będą dalej.',
'{0} exercises': '{0} ćwiczeń',
'already in': 'już jest',
@@ -79,7 +79,7 @@ export default {
'Search {0} exercises…': 'Szukaj wśród {0} ćwiczeń…',
'Chosen': 'Wybrane',
'Nothing chosen yet — add exercises and they’ll show up here.': 'Nic nie wybrano — dodaj ćwiczenia, a pojawią się tutaj.',
'No match 🤷': 'Brak wyników 🤷',
'No match': 'Brak wyników',
'Show more': 'Pokaż więcej',
'Intervals': 'Interwały',
'Minutes': 'Minuty',
@@ -89,10 +89,10 @@ export default {
'Weight ({0})': 'Ciężar ({0})',
'Add to routine': 'Dodaj do planu',
'Remove exercise': 'Usuń ćwiczenie',
'Pick an emoji': 'Wybierz emoji',
'Pick an icon': 'Wybierz ikonę',
'Back to weekly plan': 'Wróć do planu tygodnia',
'{0} set to rest': '{0} ustawiono jako odpoczynek',
'{0} planned for {1} ✓': '{0} zaplanowano na {1} ✓',
'{0} planned for {1}': '{0} zaplanowano na {1}',
'Weekly plan:': 'Plan tygodnia:',
'changed for this day': 'zmieniono na ten dzień',
'Sick, missed a day or want a different session? Pick what to train instead.': 'Choroba, opuszczony dzień albo ochota na coś innego? Wybierz, co trenować zamiast tego.',
@@ -115,23 +115,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': 'Potwierdź ciężar, z którym pracowałeś — najwyższy będzie domyślny następnym razem.',
'Then finish the superset partner.': 'Potem dokończ drugie ćwiczenie superserii.',
'Previous best:': 'Poprzedni rekord:',
'new record! 🏆': 'nowy rekord! 🏆',
'Save ✓': 'Zapisz ✓',
'Save & next exercise ›': 'Zapisz i następne ćwiczenie ›',
'new record!': 'nowy rekord!',
'Save': 'Zapisz',
'Save & next exercise': 'Zapisz i następne ćwiczenie',
'Just close': 'Tylko zamknij',
'Save weight': 'Zapisz ciężar',
'Tracked — next time starts at {0} 📈': 'Zapisano — następnym razem zaczynasz od {0} 📈',
'Tracked — next time starts at {0}': 'Zapisano — następnym razem zaczynasz od {0}',
"That's the whole workout!": 'To cały trening!',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': 'Wszystkie ćwiczenia zrobione — świetna robota! Zakończ albo kontynuuj i dodaj kolejne ćwiczenie.',
'Finish workout 🏁': 'Zakończ trening 🏁',
'Finish workout': 'Zakończ trening',
'Continue workout': 'Kontynuuj trening',
'Keep going 💪 — tap “+ Add exercise” below': 'Tak trzymaj 💪 — dotknij „+ Dodaj ćwiczenie” poniżej',
'Keep going — tap “+ Add exercise” below': 'Tak trzymaj — dotknij „+ Dodaj ćwiczenie” poniżej',
'Workout complete!': 'Trening ukończony!',
'Duration': 'Czas',
'Volume': 'Objętość',
'PRs': 'Rekordy',
'New PR:': 'Nowy rekord:',
'Nice! 💪': 'Świetnie! 💪',
'Nice!': 'Świetnie!',
'Nothing logged yet': 'Nic nie zapisano',
'You haven’t checked off any sets. Finish the workout anyway?': 'Nie odhaczyłeś żadnej serii. Mimo to zakończyć trening?',
'Finish anyway': 'Zakończ mimo to',
@@ -151,10 +151,10 @@ export default {
'Duration (min)': 'Czas (min)',
'Last time': 'Ostatnio',
'Last time you hit all reps — try {0}': 'Ostatnio zrobiłeś wszystkie powtórzenia — spróbuj {0}',
'Weights bumped to {0} 💪': 'Ciężary podniesione do {0} 💪',
'Weights bumped to {0}': 'Ciężary podniesione do {0}',
'Remove set': 'Usuń serię',
'Add set': 'Dodaj serię',
'Cardio logged 🏃': 'Cardio zapisane 🏃',
'Cardio logged': 'Cardio zapisane',
'Discard workout?': 'Odrzucić trening?',
'The sets you logged in this session will be lost.': 'Serie zapisane w tej sesji zostaną utracone.',
'Superset {0} / {1}': 'Superseria {0} / {1}',
@@ -162,12 +162,12 @@ export default {
'Superset · do these back-to-back, rest after both': 'Superseria · rób jedno po drugim, odpocznij po obu',
'Freestyle workout — add your first exercise.': 'Trening dowolny — dodaj pierwsze ćwiczenie.',
'Finish workout early · {0} exercises': 'Zakończ wcześniej · {0} ćwiczeń',
'Rest over — next set! 💪': 'Koniec przerwy — następna seria! 💪',
'Hi {0} 💪': 'Cześć {0} 💪',
'Rest over — next set!': 'Koniec przerwy — następna seria!',
'Hi {0}': 'Cześć {0}',
'This week': 'Ten tydzień',
'{0} — in progress': '{0} — w trakcie',
'Resume ▶': 'Wznów ▶',
'Welcome! 👋': 'Witaj! 👋',
'Welcome!': 'Witaj!',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Ustaw swój tygodniowy plan — albo wczytaj gotowy plan Push / Pull / Nogi.',
'Load starter plan (PPL)': 'Wczytaj plan startowy (PPL)',
'Build my own plan': 'Utwórz własny plan',
@@ -185,7 +185,7 @@ export default {
'Exercise progress': 'Postępy w ćwiczeniach',
'Top speed per workout': 'Najwyższa prędkość na trening',
'Best set weight per workout': 'Najlepszy ciężar na trening',
'Finish your first workout to see progress curves here. 📈': 'Ukończ pierwszy trening, aby zobaczyć tu krzywe postępów. 📈',
'Finish your first workout to see progress curves here.': 'Ukończ pierwszy trening, aby zobaczyć tu krzywe postępów.',
'Recent workouts': 'Ostatnie treningi',
'Less time': 'Mniej',
'More time': 'Więcej',
@@ -198,7 +198,7 @@ export default {
'Load starter plan (Push / Pull / Legs)': 'Wczytaj plan startowy (Push / Pull / Nogi)',
'Superset with exercise above': 'Superseria z ćwiczeniem powyżej',
'No exercises yet — add your first one.': 'Brak ćwiczeń — dodaj pierwsze.',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Wskazówka: dotknij 🔗 przy ćwiczeniu, aby połączyć je w superserię z tym powyżej — zrobisz je jedno po drugim.',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Dotknij przycisku łączenia przy ćwiczeniu, aby połączyć je w superserię z tym powyżej — zrobisz je jedno po drugim.',
'Delete routine?': 'Usunąć plan?',
'“{0}” and its exercises will be removed.': '„{0}” i jego ćwiczenia zostaną usunięte.',
'Delete routine': 'Usuń plan',
@@ -207,13 +207,13 @@ export default {
'No workouts yet.': 'Brak treningów.',
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Plan startowy wczytany — Pn Push · Śr Pull · Pt Nogi',
'Enter a name': 'Podaj imię',
'Profile created — data from this device moved into it ✓': 'Profil utworzony — dane z tego urządzenia zostały przeniesione ✓',
'Profile created — data moved into it ✓': 'Profil utworzony — dane przeniesione ✓',
'Welcome, {0} 💪': 'Witaj, {0} 💪',
'Welcome back, {0} 💪': 'Witaj ponownie, {0} 💪',
'Profile created — data from this device moved into it': 'Profil utworzony — dane z tego urządzenia zostały przeniesione',
'Profile created — data moved into it': 'Profil utworzony — dane przeniesione',
'Welcome, {0}': 'Witaj, {0}',
'Welcome back, {0}': 'Witaj ponownie, {0}',
'Registration failed': 'Rejestracja nie powiodła się',
'Sign-in failed': 'Logowanie nie powiodło się',
'Create your profile ✨': 'Utwórz swój profil ✨',
'Create your profile': 'Utwórz swój profil',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': 'Wybierz imię i potwierdź przez {0}. Klucz passkey zapisze się na urządzeniu — bez hasła.',
'Pick a name, then confirm with your device.': 'Wybierz imię i potwierdź na urządzeniu.',
'Your name': 'Twoje imię',
@@ -254,10 +254,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': 'Usuwa plan, treningi i masę ciała na tym urządzeniu. Nie można tego cofnąć.',
'Delete everything': 'Usuń wszystko',
'All data reset': 'Wszystkie dane zresetowane',
'Backup exported ✓': 'Kopia wyeksportowana ✓',
'Backup exported': 'Kopia wyeksportowana',
'Import backup?': 'Importować kopię?',
'This replaces all current data with the backup file.': 'To zastąpi wszystkie obecne dane plikiem kopii.',
'Backup imported ✓': 'Kopia zaimportowana ✓',
'Backup imported': 'Kopia zaimportowana',
'Import failed: {0}': 'Import nie powiódł się: {0}',
'Tip': 'Wskazówka',
'In Chrome: ⋮ menu → Add to Home screen': 'W Chrome: menu ⋮ → Dodaj do ekranu głównego',
@@ -278,13 +278,22 @@ export default {
'Test sent — should arrive any second': 'Test wysłany — powinien dotrzeć lada moment',
'Test failed': 'Test nie powiódł się',
'Notifications off': 'Powiadomienia wyłączone',
'Notifications on 🔔': 'Powiadomienia włączone 🔔',
'Notifications on': 'Powiadomienia włączone',
'Could not change notification settings': 'Nie udało się zmienić ustawień powiadomień',
'tap to pause': 'dotknij, aby wstrzymać',
'tap to play': 'dotknij, aby odtworzyć',
'back': 'plecy', 'cardio': 'cardio', 'chest': 'klatka', 'lower arms': 'przedramiona',
'lower legs': 'łydki', 'neck': 'kark', 'shoulders': 'barki',
'upper arms': 'ramiona', 'upper legs': 'uda', 'waist': 'brzuch',
'Details': 'Szczegóły',
'Finish': 'Zakończ',
'Start {0}': 'Zacznij {0}',
'Guest mode — data lives only in this browser.': 'Tryb gościa — dane pozostają tylko w tej przeglądarce.',
'Keeps your data safe and separate per person.': 'Trzyma Twoje dane bezpiecznie i osobno dla każdej osoby.',
'Strength': 'Siła',
'Equipment': 'Sprzęt',
'Recovery': 'Regeneracja',
'Any equipment': 'Dowolny sprzęt',
'assisted': 'z asystą', 'band': 'guma', 'barbell': 'sztanga', 'body weight': 'masa ciała',
'bosu ball': 'bosu', 'cable': 'wyciąg', 'dumbbell': 'hantla',
'elliptical machine': 'orbitrek', 'ez barbell': 'sztanga łamana', 'hammer': 'młot',
@@ -320,11 +329,11 @@ export default {
'Give it a name': 'Nadaj mu nazwę',
'Pick a body part': 'Wybierz partię ciała',
'“{0}” already exists': '„{0}” już istnieje',
'“{0}” created ✓': '„{0}” utworzono ✓',
'“{0}” created': '„{0}” utworzono',
'Cardio exercises log time + speed instead of weight × reps.': 'Ćwiczenia cardio zapisują czas + prędkość zamiast ciężaru × powt.',
'custom': 'własne',
'Edit': 'Edytuj',
'Saved ✓': 'Zapisano ✓',
'Saved': 'Zapisano',
'Delete “{0}”?': 'Usunąć „{0}”?',
'It will be removed from your routines. Already-logged workouts keep their sets.': 'Zostanie usunięte z twoich planów. Zapisane treningi zachowają swoje serie.',
'Exercise deleted': 'Ćwiczenie usunięte',
@@ -332,5 +341,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': 'Opis (opcjonalnie) — ustawienie, wskazówki, co chcesz zapamiętać',
'Delete exercise': 'Usuń ćwiczenie',
'Edit or delete this exercise': 'Edytuj lub usuń to ćwiczenie',
'Remove from routine': 'Usuń z planu'
'Remove from routine': 'Usuń z planu',
'Minimize': 'Zmniejsz',
'Expand': 'Powiększ',
'Invite code': 'Kod zaproszenia',
'This app is invite-only — enter the code you were given.': 'Ta aplikacja jest tylko na zaproszenie — wpisz otrzymany kod.',
'An invite code is required': 'Wymagany jest kod zaproszenia',
'Admin dashboard': 'Panel administratora',
// --- muscle map ---
'Muscle balance': 'Równowaga mięśniowa',
'by sets worked': 'wg serii',
'Week': 'Tydzień',
'not trained': 'nietrenowane',
'Not trained in this period': 'Nietrenowane w tym okresie',
'Every muscle group got some work in this period.': 'Każda grupa mięśniowa dostała pracę w tym okresie.',
'No workouts in this period yet.': 'Brak treningów w tym okresie.',
'What this session hits': 'Co trenuje ta sesja',
'What you just trained': 'Co właśnie wytrenowałeś',
'Body diagram': 'Diagram ciała',
'Male': 'Mężczyzna',
'Female': 'Kobieta',
'Less': 'Mniej',
'More': 'Więcej',
'Traps': 'Czworoboczne',
'Shoulders': 'Barki',
'Chest': 'Klatka piersiowa',
'Upper back': 'Górne plecy',
'Serratus': 'Zębaty',
'Biceps': 'Biceps',
'Triceps': 'Triceps',
'Forearms': 'Przedramiona',
'Abs': 'Brzuch',
'Obliques': 'Skośne',
'Lower back': 'Dolne plecy',
'Glutes': 'Pośladki',
'Quads': 'Czworogłowe',
'Hamstrings': 'Dwugłowe uda',
'Adductors': 'Przywodziciele',
'Hip flexors': 'Zginacze bioder',
'Calves': 'Łydki',
'Shins': 'Piszczele'
}
+83 -35
View File
@@ -43,16 +43,16 @@ export default {
'January': 'Janeiro', 'February': 'Fevereiro', 'March': 'Março', 'April': 'Abril',
'June': 'Junho', 'July': 'Julho', 'August': 'Agosto', 'September': 'Setembro',
'October': 'Outubro', 'November': 'Novembro', 'December': 'Dezembro',
'Quick check-in ⚖️': 'Check-in rápido ⚖️',
'Quick check-in': 'Check-in rápido',
'Log body weight': 'Registar peso corporal',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': 'Desliza ou toca para definir o teu peso — registado antes de cada treino para a tua curva ser honesta.',
'Save & start workout': 'Guardar e começar treino',
'Skip today': 'Saltar hoje',
'↺ Choose a different workout': '↺ Escolher outro treino',
'Choose a different workout': 'Escolher outro treino',
'Recent weigh-ins': 'Pesagens recentes',
'Enter a valid weight': 'Introduz um peso válido',
'Weight saved ✓': 'Peso guardado ✓',
'Target weight 🎯': 'Peso alvo 🎯',
'Weight saved': 'Peso guardado',
'Target weight': 'Peso alvo',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': 'A tua meta aparece como uma linha nos gráficos de peso, e ganhos/perdas são coloridos consoante se aproximam dela.',
'Save goal': 'Guardar meta',
'Goal set: {0}': 'Meta definida: {0}',
@@ -60,17 +60,17 @@ export default {
'Goal removed': 'Meta removida',
'Remove goal': 'Remover meta',
'Body weight': 'Peso corporal',
'reached! 🎉': 'alcançado! 🎉',
'reached!': 'alcançado!',
'{0} to gain': '{0} por ganhar',
'{0} to lose': '{0} por perder',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": 'Ainda sem registos — regista o teu peso para começar a curva. Também é pedido antes de cada treino.',
'Best:': 'Melhor:',
'+ Add to my plan': '+ Adicionar ao meu plano',
'Add to my plan': 'Adicionar ao meu plano',
'How to': 'Como fazer',
'instructions in English': 'instruções em inglês',
'New routine': 'Nova rotina',
'Add “{0}”': 'Adicionar «{0}»',
'“{0}” added to {1} ✓': '«{0}» adicionado a {1} ✓',
'“{0}” added to {1}': '«{0}» adicionado a {1}',
'Pick a routine — sets, reps & weight come next.': 'Escolhe uma rotina — séries, repetições e peso vêm a seguir.',
'{0} exercises': '{0} exercícios',
'already in': 'já incluído',
@@ -79,7 +79,7 @@ export default {
'Search {0} exercises…': 'Pesquisar {0} exercícios…',
'Chosen': 'Escolhidos',
'Nothing chosen yet — add exercises and they’ll show up here.': 'Ainda nada escolhido — adiciona exercícios e eles aparecem aqui.',
'No match 🤷': 'Sem resultados 🤷',
'No match': 'Sem resultados',
'Show more': 'Mostrar mais',
'Intervals': 'Intervalos',
'Minutes': 'Minutos',
@@ -89,10 +89,10 @@ export default {
'Weight ({0})': 'Peso ({0})',
'Add to routine': 'Adicionar à rotina',
'Remove exercise': 'Remover exercício',
'Pick an emoji': 'Escolhe um emoji',
'Pick an icon': 'Escolhe um ícone',
'Back to weekly plan': 'Voltar ao plano semanal',
'{0} set to rest': '{0} marcado como descanso',
'{0} planned for {1} ✓': '{0} planeado para {1} ✓',
'{0} planned for {1}': '{0} planeado para {1}',
'Weekly plan:': 'Plano semanal:',
'changed for this day': 'alterado para este dia',
'Sick, missed a day or want a different session? Pick what to train instead.': 'Doente, falhaste um dia ou queres outra sessão? Escolhe o que treinar em vez disso.',
@@ -115,23 +115,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': 'Confirma o peso com que trabalhaste — o mais alto fica predefinido na próxima vez.',
'Then finish the superset partner.': 'Depois termina o par da supersérie.',
'Previous best:': 'Melhor anterior:',
'new record! 🏆': 'novo recorde! 🏆',
'Save ✓': 'Guardar ✓',
'Save & next exercise ›': 'Guardar e próximo exercício ›',
'new record!': 'novo recorde!',
'Save': 'Guardar',
'Save & next exercise': 'Guardar e próximo exercício',
'Just close': 'Apenas fechar',
'Save weight': 'Guardar peso',
'Tracked — next time starts at {0} 📈': 'Registado — da próxima vez começas em {0} 📈',
'Tracked — next time starts at {0}': 'Registado — da próxima vez começas em {0}',
"That's the whole workout!": 'Era o treino todo!',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': 'Todos os exercícios feitos — bom trabalho! Termina, ou continua e adiciona outro exercício.',
'Finish workout 🏁': 'Terminar treino 🏁',
'Finish workout': 'Terminar treino',
'Continue workout': 'Continuar treino',
'Keep going 💪 — tap “+ Add exercise” below': 'Continua 💪 — toca em «+ Adicionar exercício» em baixo',
'Keep going — tap “+ Add exercise” below': 'Continua — toca em «+ Adicionar exercício» em baixo',
'Workout complete!': 'Treino concluído!',
'Duration': 'Duração',
'Volume': 'Volume',
'PRs': 'Recordes',
'New PR:': 'Novo recorde:',
'Nice! 💪': 'Boa! 💪',
'Nice!': 'Boa!',
'Nothing logged yet': 'Ainda nada registado',
'You haven’t checked off any sets. Finish the workout anyway?': 'Não marcaste nenhuma série. Terminar o treino mesmo assim?',
'Finish anyway': 'Terminar mesmo assim',
@@ -151,10 +151,10 @@ export default {
'Duration (min)': 'Duração (min)',
'Last time': 'Da última vez',
'Last time you hit all reps — try {0}': 'Da última vez completaste todas as reps — tenta {0}',
'Weights bumped to {0} 💪': 'Pesos aumentados para {0} 💪',
'Weights bumped to {0}': 'Pesos aumentados para {0}',
'Remove set': 'Remover série',
'Add set': 'Adicionar série',
'Cardio logged 🏃': 'Cardio registado 🏃',
'Cardio logged': 'Cardio registado',
'Discard workout?': 'Descartar treino?',
'The sets you logged in this session will be lost.': 'As séries registadas nesta sessão vão perder-se.',
'Superset {0} / {1}': 'Supersérie {0} / {1}',
@@ -162,12 +162,12 @@ export default {
'Superset · do these back-to-back, rest after both': 'Supersérie · faz seguidos, descansa depois de ambos',
'Freestyle workout — add your first exercise.': 'Treino livre — adiciona o teu primeiro exercício.',
'Finish workout early · {0} exercises': 'Terminar mais cedo · {0} exercícios',
'Rest over — next set! 💪': 'Descanso terminado — próxima série! 💪',
'Hi {0} 💪': 'Olá {0} 💪',
'Rest over — next set!': 'Descanso terminado — próxima série!',
'Hi {0}': 'Olá {0}',
'This week': 'Esta semana',
'{0} — in progress': '{0} — em curso',
'Resume ▶': 'Retomar ▶',
'Welcome! 👋': 'Bem-vindo! 👋',
'Welcome!': 'Bem-vindo!',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Configura a tua rotina semanal — ou carrega um plano Push / Pull / Pernas já feito.',
'Load starter plan (PPL)': 'Carregar plano inicial (PPL)',
'Build my own plan': 'Criar o meu próprio plano',
@@ -185,7 +185,7 @@ export default {
'Exercise progress': 'Progresso por exercício',
'Top speed per workout': 'Velocidade máxima por treino',
'Best set weight per workout': 'Melhor peso por treino',
'Finish your first workout to see progress curves here. 📈': 'Termina o teu primeiro treino para veres aqui as curvas de progresso. 📈',
'Finish your first workout to see progress curves here.': 'Termina o teu primeiro treino para veres aqui as curvas de progresso.',
'Recent workouts': 'Treinos recentes',
'Less time': 'Menos',
'More time': 'Mais',
@@ -198,7 +198,7 @@ export default {
'Load starter plan (Push / Pull / Legs)': 'Carregar plano inicial (Push / Pull / Pernas)',
'Superset with exercise above': 'Supersérie com o exercício acima',
'No exercises yet — add your first one.': 'Ainda sem exercícios — adiciona o primeiro.',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Dica: toca em 🔗 num exercício para o juntar em supersérie com o de cima — fazes os dois seguidos.',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Toca no botão de ligação num exercício para o juntar em supersérie com o de cima — vais fazê-los seguidos.',
'Delete routine?': 'Eliminar rotina?',
'“{0}” and its exercises will be removed.': '«{0}» e os seus exercícios serão removidos.',
'Delete routine': 'Eliminar rotina',
@@ -207,13 +207,13 @@ export default {
'No workouts yet.': 'Ainda sem treinos.',
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Plano inicial carregado — Seg Push · Qua Pull · Sex Pernas',
'Enter a name': 'Introduz um nome',
'Profile created — data from this device moved into it ✓': 'Perfil criado — os dados deste dispositivo foram movidos para ele ✓',
'Profile created — data moved into it ✓': 'Perfil criado — dados movidos ✓',
'Welcome, {0} 💪': 'Bem-vindo, {0} 💪',
'Welcome back, {0} 💪': 'Bem-vindo de volta, {0} 💪',
'Profile created — data from this device moved into it': 'Perfil criado — os dados deste dispositivo foram movidos para ele',
'Profile created — data moved into it': 'Perfil criado — dados movidos',
'Welcome, {0}': 'Bem-vindo, {0}',
'Welcome back, {0}': 'Bem-vindo de volta, {0}',
'Registration failed': 'Registo falhou',
'Sign-in failed': 'Início de sessão falhou',
'Create your profile ✨': 'Cria o teu perfil ✨',
'Create your profile': 'Cria o teu perfil',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': 'Escolhe um nome e confirma com {0}. A passkey fica guardada no teu dispositivo — sem palavras-passe.',
'Pick a name, then confirm with your device.': 'Escolhe um nome e confirma com o teu dispositivo.',
'Your name': 'O teu nome',
@@ -254,10 +254,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': 'Elimina o teu plano, treinos e peso corporal neste dispositivo. Não pode ser anulado.',
'Delete everything': 'Eliminar tudo',
'All data reset': 'Todos os dados repostos',
'Backup exported ✓': 'Cópia exportada ✓',
'Backup exported': 'Cópia exportada',
'Import backup?': 'Importar cópia?',
'This replaces all current data with the backup file.': 'Isto substitui todos os dados atuais pelo ficheiro de cópia.',
'Backup imported ✓': 'Cópia importada ✓',
'Backup imported': 'Cópia importada',
'Import failed: {0}': 'Importação falhou: {0}',
'Tip': 'Dica',
'In Chrome: ⋮ menu → Add to Home screen': 'No Chrome: menu ⋮ → Adicionar ao ecrã principal',
@@ -278,13 +278,22 @@ export default {
'Test sent — should arrive any second': 'Teste enviado — deve chegar a qualquer segundo',
'Test failed': 'Teste falhou',
'Notifications off': 'Notificações desativadas',
'Notifications on 🔔': 'Notificações ativadas 🔔',
'Notifications on': 'Notificações ativadas',
'Could not change notification settings': 'Não foi possível alterar as definições de notificações',
'tap to pause': 'toca para pausar',
'tap to play': 'toca para reproduzir',
'back': 'costas', 'cardio': 'cardio', 'chest': 'peito', 'lower arms': 'antebraços',
'lower legs': 'gémeos', 'neck': 'pescoço', 'shoulders': 'ombros',
'upper arms': 'braços', 'upper legs': 'pernas', 'waist': 'abdómen',
'Details': 'Detalhes',
'Finish': 'Terminar',
'Start {0}': 'Começar {0}',
'Guest mode — data lives only in this browser.': 'Modo convidado — os dados vivem apenas neste navegador.',
'Keeps your data safe and separate per person.': 'Mantém os teus dados seguros e separados por pessoa.',
'Strength': 'Força',
'Equipment': 'Equipamento',
'Recovery': 'Recuperação',
'Any equipment': 'Qualquer equipamento',
'assisted': 'assistido', 'band': 'banda', 'barbell': 'barra', 'body weight': 'peso corporal',
'bosu ball': 'bosu', 'cable': 'cabo', 'dumbbell': 'haltere',
'elliptical machine': 'elíptica', 'ez barbell': 'barra EZ', 'hammer': 'martelo',
@@ -320,11 +329,11 @@ export default {
'Give it a name': 'Dá-lhe um nome',
'Pick a body part': 'Escolhe uma parte do corpo',
'“{0}” already exists': '«{0}» já existe',
'“{0}” created ✓': '«{0}» criado ✓',
'“{0}” created': '«{0}» criado',
'Cardio exercises log time + speed instead of weight × reps.': 'Exercícios de cardio registam tempo + velocidade em vez de peso × reps.',
'custom': 'próprio',
'Edit': 'Editar',
'Saved ✓': 'Guardado ✓',
'Saved': 'Guardado',
'Delete “{0}”?': 'Eliminar «{0}»?',
'It will be removed from your routines. Already-logged workouts keep their sets.': 'Será removido das tuas rotinas. Os treinos já registados mantêm as suas séries.',
'Exercise deleted': 'Exercício eliminado',
@@ -332,5 +341,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': 'Descrição (opcional) — preparação, dicas, o que quiseres lembrar',
'Delete exercise': 'Eliminar exercício',
'Edit or delete this exercise': 'Editar ou eliminar este exercício',
'Remove from routine': 'Remover da rotina'
'Remove from routine': 'Remover da rotina',
'Minimize': 'Minimizar',
'Expand': 'Ampliar',
'Invite code': 'Código de convite',
'This app is invite-only — enter the code you were given.': 'Esta app é só por convite — introduz o código que recebeste.',
'An invite code is required': 'É necessário um código de convite',
'Admin dashboard': 'Painel de administração',
// --- muscle map ---
'Muscle balance': 'Equilíbrio muscular',
'by sets worked': 'por séries trabalhadas',
'Week': 'Semana',
'not trained': 'sem treino',
'Not trained in this period': 'Sem treino neste período',
'Every muscle group got some work in this period.': 'Todos os grupos musculares foram trabalhados neste período.',
'No workouts in this period yet.': 'Ainda sem treinos neste período.',
'What this session hits': 'O que esta sessão trabalha',
'What you just trained': 'O que acabaste de treinar',
'Body diagram': 'Diagrama do corpo',
'Male': 'Masculino',
'Female': 'Feminino',
'Less': 'Menos',
'More': 'Mais',
'Traps': 'Trapézio',
'Shoulders': 'Ombros',
'Chest': 'Peito',
'Upper back': 'Costas superiores',
'Serratus': 'Serrátil',
'Biceps': 'Bíceps',
'Triceps': 'Tríceps',
'Forearms': 'Antebraços',
'Abs': 'Abdominais',
'Obliques': 'Oblíquos',
'Lower back': 'Lombar',
'Glutes': 'Glúteos',
'Quads': 'Quadríceps',
'Hamstrings': 'Isquiotibiais',
'Adductors': 'Adutores',
'Hip flexors': 'Flexores do quadril',
'Calves': 'Panturrilhas',
'Shins': 'Tibiais'
}
+83 -35
View File
@@ -43,16 +43,16 @@ export default {
'January': 'Январь', 'February': 'Февраль', 'March': 'Март', 'April': 'Апрель',
'June': 'Июнь', 'July': 'Июль', 'August': 'Август', 'September': 'Сентябрь',
'October': 'Октябрь', 'November': 'Ноябрь', 'December': 'Декабрь',
'Quick check-in ⚖️': 'Быстрое взвешивание ⚖️',
'Quick check-in': 'Быстрое взвешивание',
'Log body weight': 'Записать вес тела',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': 'Сдвинь или коснись, чтобы указать вес — он записывается перед каждой тренировкой, чтобы кривая была честной.',
'Save & start workout': 'Сохранить и начать тренировку',
'Skip today': 'Пропустить сегодня',
'↺ Choose a different workout': '↺ Выбрать другую тренировку',
'Choose a different workout': 'Выбрать другую тренировку',
'Recent weigh-ins': 'Последние взвешивания',
'Enter a valid weight': 'Введите корректный вес',
'Weight saved ✓': 'Вес сохранён ✓',
'Target weight 🎯': 'Целевой вес 🎯',
'Weight saved': 'Вес сохранён',
'Target weight': 'Целевой вес',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': 'Цель показана линией на графиках веса, а изменения окрашиваются в зависимости от того, приближают ли они к ней.',
'Save goal': 'Сохранить цель',
'Goal set: {0}': 'Цель установлена: {0}',
@@ -60,17 +60,17 @@ export default {
'Goal removed': 'Цель удалена',
'Remove goal': 'Удалить цель',
'Body weight': 'Вес тела',
'reached! 🎉': 'достигнута! 🎉',
'reached!': 'достигнута!',
'{0} to gain': 'набрать {0}',
'{0} to lose': 'сбросить {0}',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": 'Записей пока нет — внеси вес, чтобы начать кривую. Он также запрашивается перед каждой тренировкой.',
'Best:': 'Рекорд:',
'+ Add to my plan': '+ Добавить в мой план',
'Add to my plan': 'Добавить в мой план',
'How to': 'Техника выполнения',
'instructions in English': 'инструкции на английском',
'New routine': 'Новая программа',
'Add “{0}”': 'Добавить «{0}»',
'“{0}” added to {1} ✓': '«{0}» добавлено в {1} ✓',
'“{0}” added to {1}': '«{0}» добавлено в {1}',
'Pick a routine — sets, reps & weight come next.': 'Выбери программу — подходы, повторения и вес будут дальше.',
'{0} exercises': 'Упражнений: {0}',
'already in': 'уже есть',
@@ -79,7 +79,7 @@ export default {
'Search {0} exercises…': 'Поиск среди {0} упражнений…',
'Chosen': 'Избранные',
'Nothing chosen yet — add exercises and they’ll show up here.': 'Пока ничего нет — добавляй упражнения, и они появятся здесь.',
'No match 🤷': 'Ничего не найдено 🤷',
'No match': 'Ничего не найдено',
'Show more': 'Показать ещё',
'Intervals': 'Интервалы',
'Minutes': 'Минуты',
@@ -89,10 +89,10 @@ export default {
'Weight ({0})': 'Вес ({0})',
'Add to routine': 'Добавить в программу',
'Remove exercise': 'Убрать упражнение',
'Pick an emoji': 'Выбери эмодзи',
'Pick an icon': 'Выбери иконку',
'Back to weekly plan': 'Вернуться к недельному плану',
'{0} set to rest': '{0} — теперь день отдыха',
'{0} planned for {1} ✓': '{0} запланировано на {1} ✓',
'{0} planned for {1}': '{0} запланировано на {1}',
'Weekly plan:': 'Недельный план:',
'changed for this day': 'изменено для этого дня',
'Sick, missed a day or want a different session? Pick what to train instead.': 'Заболел, пропустил день или хочешь другую тренировку? Выбери, что делать вместо этого.',
@@ -115,23 +115,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': 'Подтверди рабочий вес — наибольший станет значением по умолчанию в следующий раз.',
'Then finish the superset partner.': 'Затем доделай второе упражнение суперсета.',
'Previous best:': 'Прежний рекорд:',
'new record! 🏆': 'новый рекорд! 🏆',
'Save ✓': 'Сохранить ✓',
'Save & next exercise ›': 'Сохранить и к следующему ›',
'new record!': 'новый рекорд!',
'Save': 'Сохранить',
'Save & next exercise': 'Сохранить и к следующему',
'Just close': 'Просто закрыть',
'Save weight': 'Сохранить вес',
'Tracked — next time starts at {0} 📈': 'Записано — в следующий раз начнёшь с {0} 📈',
'Tracked — next time starts at {0}': 'Записано — в следующий раз начнёшь с {0}',
"That's the whole workout!": 'Это была вся тренировка!',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': 'Все упражнения выполнены — отличная работа! Завершай или продолжай и добавь ещё упражнение.',
'Finish workout 🏁': 'Завершить тренировку 🏁',
'Finish workout': 'Завершить тренировку',
'Continue workout': 'Продолжить тренировку',
'Keep going 💪 — tap “+ Add exercise” below': 'Продолжай 💪 — нажми «+ Добавить упражнение» ниже',
'Keep going — tap “+ Add exercise” below': 'Продолжай — нажми «+ Добавить упражнение» ниже',
'Workout complete!': 'Тренировка завершена!',
'Duration': 'Время',
'Volume': 'Объём',
'PRs': 'Рекорды',
'New PR:': 'Новый рекорд:',
'Nice! 💪': 'Отлично! 💪',
'Nice!': 'Отлично!',
'Nothing logged yet': 'Пока ничего не записано',
'You haven’t checked off any sets. Finish the workout anyway?': 'Ни один подход не отмечен. Всё равно завершить тренировку?',
'Finish anyway': 'Всё равно завершить',
@@ -151,10 +151,10 @@ export default {
'Duration (min)': 'Время (мин)',
'Last time': 'В прошлый раз',
'Last time you hit all reps — try {0}': 'В прошлый раз все повторения сделаны — попробуй {0}',
'Weights bumped to {0} 💪': 'Веса подняты до {0} 💪',
'Weights bumped to {0}': 'Веса подняты до {0}',
'Remove set': 'Убрать подход',
'Add set': 'Добавить подход',
'Cardio logged 🏃': 'Кардио записано 🏃',
'Cardio logged': 'Кардио записано',
'Discard workout?': 'Отменить тренировку?',
'The sets you logged in this session will be lost.': 'Подходы, записанные в этой сессии, будут потеряны.',
'Superset {0} / {1}': 'Суперсет {0} / {1}',
@@ -162,12 +162,12 @@ export default {
'Superset · do these back-to-back, rest after both': 'Суперсет · выполняй подряд, отдых после обоих',
'Freestyle workout — add your first exercise.': 'Свободная тренировка — добавь первое упражнение.',
'Finish workout early · {0} exercises': 'Завершить раньше · упражнений: {0}',
'Rest over — next set! 💪': 'Отдых окончен — следующий подход! 💪',
'Hi {0} 💪': 'Привет, {0} 💪',
'Rest over — next set!': 'Отдых окончен — следующий подход!',
'Hi {0}': 'Привет, {0}',
'This week': 'Эта неделя',
'{0} — in progress': '{0} — идёт',
'Resume ▶': 'Продолжить ▶',
'Welcome! 👋': 'Добро пожаловать! 👋',
'Welcome!': 'Добро пожаловать!',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Настрой свой недельный план — или загрузи готовый план Push / Pull / Ноги.',
'Load starter plan (PPL)': 'Загрузить стартовый план (PPL)',
'Build my own plan': 'Создать свой план',
@@ -185,7 +185,7 @@ export default {
'Exercise progress': 'Прогресс упражнений',
'Top speed per workout': 'Максимальная скорость за тренировку',
'Best set weight per workout': 'Лучший вес за тренировку',
'Finish your first workout to see progress curves here. 📈': 'Заверши первую тренировку, чтобы увидеть здесь кривые прогресса. 📈',
'Finish your first workout to see progress curves here.': 'Заверши первую тренировку, чтобы увидеть здесь кривые прогресса.',
'Recent workouts': 'Недавние тренировки',
'Less time': 'Меньше',
'More time': 'Больше',
@@ -198,7 +198,7 @@ export default {
'Load starter plan (Push / Pull / Legs)': 'Загрузить стартовый план (Push / Pull / Ноги)',
'Superset with exercise above': 'Суперсет с упражнением выше',
'No exercises yet — add your first one.': 'Упражнений пока нет — добавь первое.',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Совет: нажми 🔗 у упражнения, чтобы объединить его в суперсет с тем, что выше — будешь делать их подряд.',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Нажми кнопку связи у упражнения, чтобы объединить его в суперсет с тем, что выше — сделаешь их подряд.',
'Delete routine?': 'Удалить программу?',
'“{0}” and its exercises will be removed.': '«{0}» и её упражнения будут удалены.',
'Delete routine': 'Удалить программу',
@@ -207,13 +207,13 @@ export default {
'No workouts yet.': 'Тренировок пока нет.',
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Стартовый план загружен — Пн Push · Ср Pull · Пт Ноги',
'Enter a name': 'Введите имя',
'Profile created — data from this device moved into it ✓': 'Профиль создан — данные с этого устройства перенесены в него ✓',
'Profile created — data moved into it ✓': 'Профиль создан — данные перенесены ✓',
'Welcome, {0} 💪': 'Добро пожаловать, {0} 💪',
'Welcome back, {0} 💪': 'С возвращением, {0} 💪',
'Profile created — data from this device moved into it': 'Профиль создан — данные с этого устройства перенесены в него',
'Profile created — data moved into it': 'Профиль создан — данные перенесены',
'Welcome, {0}': 'Добро пожаловать, {0}',
'Welcome back, {0}': 'С возвращением, {0}',
'Registration failed': 'Регистрация не удалась',
'Sign-in failed': 'Вход не удался',
'Create your profile ✨': 'Создай свой профиль ✨',
'Create your profile': 'Создай свой профиль',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': 'Выбери имя и подтверди через {0}. Ключ доступа сохраняется на устройстве — пароль не нужен.',
'Pick a name, then confirm with your device.': 'Выбери имя и подтверди на устройстве.',
'Your name': 'Твоё имя',
@@ -254,10 +254,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': 'Удаляет план, тренировки и вес тела на этом устройстве. Отменить нельзя.',
'Delete everything': 'Удалить всё',
'All data reset': 'Все данные сброшены',
'Backup exported ✓': 'Копия экспортирована ✓',
'Backup exported': 'Копия экспортирована',
'Import backup?': 'Импортировать копию?',
'This replaces all current data with the backup file.': 'Все текущие данные будут заменены файлом резервной копии.',
'Backup imported ✓': 'Копия импортирована ✓',
'Backup imported': 'Копия импортирована',
'Import failed: {0}': 'Импорт не удался: {0}',
'Tip': 'Совет',
'In Chrome: ⋮ menu → Add to Home screen': 'В Chrome: меню ⋮ → Добавить на главный экран',
@@ -278,13 +278,22 @@ export default {
'Test sent — should arrive any second': 'Тест отправлен — придёт с секунды на секунду',
'Test failed': 'Тест не удался',
'Notifications off': 'Уведомления выключены',
'Notifications on 🔔': 'Уведомления включены 🔔',
'Notifications on': 'Уведомления включены',
'Could not change notification settings': 'Не удалось изменить настройки уведомлений',
'tap to pause': 'нажми для паузы',
'tap to play': 'нажми для запуска',
'back': 'спина', 'cardio': 'кардио', 'chest': 'грудь', 'lower arms': 'предплечья',
'lower legs': 'голени', 'neck': 'шея', 'shoulders': 'плечи',
'upper arms': 'руки', 'upper legs': 'бёдра', 'waist': 'пресс',
'Details': 'Детали',
'Finish': 'Завершить',
'Start {0}': 'Начать {0}',
'Guest mode — data lives only in this browser.': 'Гостевой режим — данные хранятся только в этом браузере.',
'Keeps your data safe and separate per person.': 'Хранит твои данные безопасно и отдельно для каждого.',
'Strength': 'Сила',
'Equipment': 'Инвентарь',
'Recovery': 'Восстановление',
'Any equipment': 'Любой инвентарь',
'assisted': 'с поддержкой', 'band': 'лента', 'barbell': 'штанга', 'body weight': 'свой вес',
'bosu ball': 'босу', 'cable': 'блок', 'dumbbell': 'гантель',
'elliptical machine': 'эллипсоид', 'ez barbell': 'EZ-гриф', 'hammer': 'молот',
@@ -320,11 +329,11 @@ export default {
'Give it a name': 'Задайте название',
'Pick a body part': 'Выберите часть тела',
'“{0}” already exists': '«{0}» уже существует',
'“{0}” created ✓': '«{0}» создано ✓',
'“{0}” created': '«{0}» создано',
'Cardio exercises log time + speed instead of weight × reps.': 'Кардио-упражнения записывают время + скорость вместо веса × повторов.',
'custom': 'своё',
'Edit': 'Изменить',
'Saved ✓': 'Сохранено ✓',
'Saved': 'Сохранено',
'Delete “{0}”?': 'Удалить «{0}»?',
'It will be removed from your routines. Already-logged workouts keep their sets.': 'Оно будет убрано из ваших программ. Записанные тренировки сохранят свои подходы.',
'Exercise deleted': 'Упражнение удалено',
@@ -332,5 +341,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': 'Описание (необязательно) — настройка, подсказки, всё, что хотите запомнить',
'Delete exercise': 'Удалить упражнение',
'Edit or delete this exercise': 'Изменить или удалить это упражнение',
'Remove from routine': 'Убрать из программы'
'Remove from routine': 'Убрать из программы',
'Minimize': 'Свернуть',
'Expand': 'Развернуть',
'Invite code': 'Код приглашения',
'This app is invite-only — enter the code you were given.': 'Приложение только по приглашению — введите выданный вам код.',
'An invite code is required': 'Требуется код приглашения',
'Admin dashboard': 'Панель администратора',
// --- muscle map ---
'Muscle balance': 'Баланс мышц',
'by sets worked': 'по подходам',
'Week': 'Неделя',
'not trained': 'не тренировалась',
'Not trained in this period': 'Не тренировались за этот период',
'Every muscle group got some work in this period.': 'За этот период поработали все группы мышц.',
'No workouts in this period yet.': 'В этом периоде ещё нет тренировок.',
'What this session hits': 'Что задействует эта тренировка',
'What you just trained': 'Что вы только что тренировали',
'Body diagram': 'Схема тела',
'Male': 'Мужской',
'Female': 'Женский',
'Less': 'Меньше',
'More': 'Больше',
'Traps': 'Трапеции',
'Shoulders': 'Плечи',
'Chest': 'Грудь',
'Upper back': 'Верх спины',
'Serratus': 'Зубчатая мышца',
'Biceps': 'Бицепс',
'Triceps': 'Трицепс',
'Forearms': 'Предплечья',
'Abs': 'Пресс',
'Obliques': 'Косые мышцы',
'Lower back': 'Поясница',
'Glutes': 'Ягодицы',
'Quads': 'Квадрицепс',
'Hamstrings': 'Бицепс бедра',
'Adductors': 'Приводящие',
'Hip flexors': 'Сгибатели бедра',
'Calves': 'Икры',
'Shins': 'Голени'
}
+83 -35
View File
@@ -43,16 +43,16 @@ export default {
'January': 'Ocak', 'February': 'Şubat', 'March': 'Mart', 'April': 'Nisan',
'June': 'Haziran', 'July': 'Temmuz', 'August': 'Ağustos', 'September': 'Eylül',
'October': 'Ekim', 'November': 'Kasım', 'December': 'Aralık',
'Quick check-in ⚖️': 'Hızlı tartı ⚖️',
'Quick check-in': 'Hızlı tartı',
'Log body weight': 'Vücut ağırlığını kaydet',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': 'Kilonu ayarlamak için kaydır veya dokun — eğrin dürüst kalsın diye her antrenmandan önce kaydedilir.',
'Save & start workout': 'Kaydet ve antrenmana başla',
'Skip today': 'Bugün atla',
'↺ Choose a different workout': '↺ Farklı bir antrenman seç',
'Choose a different workout': 'Farklı bir antrenman seç',
'Recent weigh-ins': 'Son tartılar',
'Enter a valid weight': 'Geçerli bir ağırlık gir',
'Weight saved ✓': 'Ağırlık kaydedildi ✓',
'Target weight 🎯': 'Hedef kilo 🎯',
'Weight saved': 'Ağırlık kaydedildi',
'Target weight': 'Hedef kilo',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': 'Hedefin kilo grafiklerinde bir çizgi olarak gösterilir; artış/azalışlar hedefe yaklaşıp yaklaşmadığına göre renklendirilir.',
'Save goal': 'Hedefi kaydet',
'Goal set: {0}': 'Hedef belirlendi: {0}',
@@ -60,17 +60,17 @@ export default {
'Goal removed': 'Hedef kaldırıldı',
'Remove goal': 'Hedefi kaldır',
'Body weight': 'Vücut ağırlığı',
'reached! 🎉': 'ulaşıldı! 🎉',
'reached!': 'ulaşıldı!',
'{0} to gain': 'alınacak {0}',
'{0} to lose': 'verilecek {0}',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": 'Henüz kayıt yok — eğriyi başlatmak için kilonu gir. Her antrenmandan önce de sorulur.',
'Best:': 'Rekor:',
'+ Add to my plan': '+ Planıma ekle',
'Add to my plan': 'Planıma ekle',
'How to': 'Nasıl yapılır',
'instructions in English': 'talimatlar İngilizce',
'New routine': 'Yeni rutin',
'Add “{0}”': '“{0}” ekle',
'“{0}” added to {1} ✓': '“{0}”, {1} planına eklendi ✓',
'“{0}” added to {1}': '“{0}”, {1} planına eklendi',
'Pick a routine — sets, reps & weight come next.': 'Bir rutin seç — set, tekrar ve ağırlık sonra gelir.',
'{0} exercises': '{0} egzersiz',
'already in': 'zaten var',
@@ -79,7 +79,7 @@ export default {
'Search {0} exercises…': '{0} egzersiz içinde ara…',
'Chosen': 'Seçilenler',
'Nothing chosen yet — add exercises and they’ll show up here.': 'Henüz seçim yok — egzersiz ekledikçe burada görünecekler.',
'No match 🤷': 'Sonuç yok 🤷',
'No match': 'Sonuç yok',
'Show more': 'Daha fazla göster',
'Intervals': 'Aralıklar',
'Minutes': 'Dakika',
@@ -89,10 +89,10 @@ export default {
'Weight ({0})': 'Ağırlık ({0})',
'Add to routine': 'Rutine ekle',
'Remove exercise': 'Egzersizi kaldır',
'Pick an emoji': 'Bir emoji seç',
'Pick an icon': 'Bir simge seç',
'Back to weekly plan': 'Haftalık plana dön',
'{0} set to rest': '{0} dinlenme olarak ayarlandı',
'{0} planned for {1} ✓': '{0}, {1} için planlandı ✓',
'{0} planned for {1}': '{0}, {1} için planlandı',
'Weekly plan:': 'Haftalık plan:',
'changed for this day': 'bu gün için değiştirildi',
'Sick, missed a day or want a different session? Pick what to train instead.': 'Hasta mısın, gün mü kaçırdın ya da farklı bir seans mı istiyorsun? Yerine ne çalışacağını seç.',
@@ -115,23 +115,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': 'Çalıştığın ağırlığı onayla — en yükseği bir dahaki sefer varsayılan olur.',
'Then finish the superset partner.': 'Sonra süpersetin diğer egzersizini bitir.',
'Previous best:': 'Önceki rekor:',
'new record! 🏆': 'yeni rekor! 🏆',
'Save ✓': 'Kaydet ✓',
'Save & next exercise ›': 'Kaydet ve sonraki egzersiz ›',
'new record!': 'yeni rekor!',
'Save': 'Kaydet',
'Save & next exercise': 'Kaydet ve sonraki egzersiz',
'Just close': 'Sadece kapat',
'Save weight': 'Ağırlığı kaydet',
'Tracked — next time starts at {0} 📈': 'Kaydedildi — bir dahaki sefer {0} ile başlarsın 📈',
'Tracked — next time starts at {0}': 'Kaydedildi — bir dahaki sefer {0} ile başlarsın',
"That's the whole workout!": 'Antrenmanın tamamı buydu!',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': 'Tüm egzersizler bitti — harika iş! Bitir ya da devam edip yeni bir egzersiz ekle.',
'Finish workout 🏁': 'Antrenmanı bitir 🏁',
'Finish workout': 'Antrenmanı bitir',
'Continue workout': 'Antrenmana devam et',
'Keep going 💪 — tap “+ Add exercise” below': 'Devam 💪 — aşağıdaki “+ Egzersiz ekle”ye dokun',
'Keep going — tap “+ Add exercise” below': 'Devam — aşağıdaki “+ Egzersiz ekle”ye dokun',
'Workout complete!': 'Antrenman tamamlandı!',
'Duration': 'Süre',
'Volume': 'Hacim',
'PRs': 'Rekorlar',
'New PR:': 'Yeni rekor:',
'Nice! 💪': 'Süper! 💪',
'Nice!': 'Süper!',
'Nothing logged yet': 'Henüz kayıt yok',
'You haven’t checked off any sets. Finish the workout anyway?': 'Hiç set işaretlemedin. Yine de antrenman bitsin mi?',
'Finish anyway': 'Yine de bitir',
@@ -151,10 +151,10 @@ export default {
'Duration (min)': 'Süre (dk)',
'Last time': 'Geçen sefer',
'Last time you hit all reps — try {0}': 'Geçen sefer tüm tekrarları yaptın — {0} dene',
'Weights bumped to {0} 💪': 'Ağırlıklar {0} değerine çıkarıldı 💪',
'Weights bumped to {0}': 'Ağırlıklar {0} değerine çıkarıldı',
'Remove set': 'Set kaldır',
'Add set': 'Set ekle',
'Cardio logged 🏃': 'Kardiyo kaydedildi 🏃',
'Cardio logged': 'Kardiyo kaydedildi',
'Discard workout?': 'Antrenman iptal edilsin mi?',
'The sets you logged in this session will be lost.': 'Bu oturumda kaydettiğin setler kaybolacak.',
'Superset {0} / {1}': 'Süperset {0} / {1}',
@@ -162,12 +162,12 @@ export default {
'Superset · do these back-to-back, rest after both': 'Süperset · art arda yap, ikisinden sonra dinlen',
'Freestyle workout — add your first exercise.': 'Serbest antrenman — ilk egzersizini ekle.',
'Finish workout early · {0} exercises': 'Erken bitir · {0} egzersiz',
'Rest over — next set! 💪': 'Dinlenme bitti — sıradaki set! 💪',
'Hi {0} 💪': 'Selam {0} 💪',
'Rest over — next set!': 'Dinlenme bitti — sıradaki set!',
'Hi {0}': 'Selam {0}',
'This week': 'Bu hafta',
'{0} — in progress': '{0} — devam ediyor',
'Resume ▶': 'Devam et ▶',
'Welcome! 👋': 'Hoş geldin! 👋',
'Welcome!': 'Hoş geldin!',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Başlamak için haftalık rutinini kur — ya da hazır bir Push / Pull / Bacak planı yükle.',
'Load starter plan (PPL)': 'Başlangıç planını yükle (PPL)',
'Build my own plan': 'Kendi planımı oluştur',
@@ -185,7 +185,7 @@ export default {
'Exercise progress': 'Egzersiz ilerlemesi',
'Top speed per workout': 'Antrenman başına en yüksek hız',
'Best set weight per workout': 'Antrenman başına en iyi set ağırlığı',
'Finish your first workout to see progress curves here. 📈': 'İlerleme eğrilerini görmek için ilk antrenmanını bitir. 📈',
'Finish your first workout to see progress curves here.': 'İlerleme eğrilerini görmek için ilk antrenmanını bitir.',
'Recent workouts': 'Son antrenmanlar',
'Less time': 'Az',
'More time': 'Çok',
@@ -198,7 +198,7 @@ export default {
'Load starter plan (Push / Pull / Legs)': 'Başlangıç planını yükle (Push / Pull / Bacak)',
'Superset with exercise above': 'Üstteki egzersizle süperset',
'No exercises yet — add your first one.': 'Henüz egzersiz yok — ilkini ekle.',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': 'İpucu: bir egzersizde 🔗 simgesine dokunarak üsttekiyle süperset yap — art arda yaparsın.',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': 'Bir egzersizde bağlama düğmesine dokunarak üsttekiyle süperset yap — arka arkaya yaparsın.',
'Delete routine?': 'Rutin silinsin mi?',
'“{0}” and its exercises will be removed.': '“{0}” ve egzersizleri kaldırılacak.',
'Delete routine': 'Rutini sil',
@@ -207,13 +207,13 @@ export default {
'No workouts yet.': 'Henüz antrenman yok.',
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Başlangıç planı yüklendi — Pzt Push · Çar Pull · Cum Bacak',
'Enter a name': 'Bir isim gir',
'Profile created — data from this device moved into it ✓': 'Profil oluşturuldu — bu cihazdaki veriler profile taşındı ✓',
'Profile created — data moved into it ✓': 'Profil oluşturuldu — veriler taşındı ✓',
'Welcome, {0} 💪': 'Hoş geldin, {0} 💪',
'Welcome back, {0} 💪': 'Tekrar hoş geldin, {0} 💪',
'Profile created — data from this device moved into it': 'Profil oluşturuldu — bu cihazdaki veriler profile taşındı',
'Profile created — data moved into it': 'Profil oluşturuldu — veriler taşındı',
'Welcome, {0}': 'Hoş geldin, {0}',
'Welcome back, {0}': 'Tekrar hoş geldin, {0}',
'Registration failed': 'Kayıt başarısız',
'Sign-in failed': 'Giriş başarısız',
'Create your profile ✨': 'Profilini oluştur ✨',
'Create your profile': 'Profilini oluştur',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': 'Bir isim seç, sonra {0} ile onayla. Geçiş anahtarı cihazına kaydedilir — şifre gerekmez.',
'Pick a name, then confirm with your device.': 'Bir isim seç, sonra cihazınla onayla.',
'Your name': 'İsmin',
@@ -254,10 +254,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': 'Bu cihazdaki planını, antrenmanlarını ve vücut ağırlığını siler. Geri alınamaz.',
'Delete everything': 'Her şeyi sil',
'All data reset': 'Tüm veriler sıfırlandı',
'Backup exported ✓': 'Yedek dışa aktarıldı ✓',
'Backup exported': 'Yedek dışa aktarıldı',
'Import backup?': 'Yedek içe aktarılsın mı?',
'This replaces all current data with the backup file.': 'Bu, mevcut tüm verileri yedek dosyasıyla değiştirir.',
'Backup imported ✓': 'Yedek içe aktarıldı ✓',
'Backup imported': 'Yedek içe aktarıldı',
'Import failed: {0}': 'İçe aktarma başarısız: {0}',
'Tip': 'İpucu',
'In Chrome: ⋮ menu → Add to Home screen': 'Chrome’da: ⋮ menü → Ana ekrana ekle',
@@ -278,13 +278,22 @@ export default {
'Test sent — should arrive any second': 'Test gönderildi — her an gelebilir',
'Test failed': 'Test başarısız',
'Notifications off': 'Bildirimler kapalı',
'Notifications on 🔔': 'Bildirimler açık 🔔',
'Notifications on': 'Bildirimler açık',
'Could not change notification settings': 'Bildirim ayarları değiştirilemedi',
'tap to pause': 'duraklatmak için dokun',
'tap to play': 'oynatmak için dokun',
'back': 'sırt', 'cardio': 'kardiyo', 'chest': 'göğüs', 'lower arms': 'ön kollar',
'lower legs': 'baldırlar', 'neck': 'boyun', 'shoulders': 'omuzlar',
'upper arms': 'üst kollar', 'upper legs': 'bacaklar', 'waist': 'karın',
'Details': 'Ayrıntılar',
'Finish': 'Bitir',
'Start {0}': '{0} başlat',
'Guest mode — data lives only in this browser.': 'Misafir modu — veriler yalnızca bu tarayıcıda kalır.',
'Keeps your data safe and separate per person.': 'Verilerini güvende ve kişi başına ayrı tutar.',
'Strength': 'Kuvvet',
'Equipment': 'Ekipman',
'Recovery': 'Toparlanma',
'Any equipment': 'Tüm ekipmanlar',
'assisted': 'destekli', 'band': 'bant', 'barbell': 'halter', 'body weight': 'vücut ağırlığı',
'bosu ball': 'bosu topu', 'cable': 'kablo', 'dumbbell': 'dambıl',
'elliptical machine': 'eliptik bisiklet', 'ez barbell': 'EZ bar', 'hammer': 'çekiç',
@@ -320,11 +329,11 @@ export default {
'Give it a name': 'Bir ad ver',
'Pick a body part': 'Bir vücut bölgesi seç',
'“{0}” already exists': '“{0}” zaten var',
'“{0}” created ✓': '“{0}” oluşturuldu ✓',
'“{0}” created': '“{0}” oluşturuldu',
'Cardio exercises log time + speed instead of weight × reps.': 'Kardiyo egzersizleri ağırlık × tekrar yerine süre + hız kaydeder.',
'custom': 'özel',
'Edit': 'Düzenle',
'Saved ✓': 'Kaydedildi ✓',
'Saved': 'Kaydedildi',
'Delete “{0}”?': '“{0}” silinsin mi?',
'It will be removed from your routines. Already-logged workouts keep their sets.': 'Rutinlerinden kaldırılacak. Kayıtlı antrenmanlar setlerini korur.',
'Exercise deleted': 'Egzersiz silindi',
@@ -332,5 +341,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': 'Açıklama (isteğe bağlı) — kurulum, ipuçları, hatırlamak istediklerin',
'Delete exercise': 'Egzersizi sil',
'Edit or delete this exercise': 'Bu egzersizi düzenle veya sil',
'Remove from routine': 'Rutinden çıkar'
'Remove from routine': 'Rutinden çıkar',
'Minimize': 'Küçült',
'Expand': 'Büyüt',
'Invite code': 'Davet kodu',
'This app is invite-only — enter the code you were given.': 'Bu uygulama yalnızca davetle — sana verilen kodu gir.',
'An invite code is required': 'Bir davet kodu gerekli',
'Admin dashboard': 'Yönetici paneli',
// --- muscle map ---
'Muscle balance': 'Kas dengesi',
'by sets worked': 'çalışılan sete göre',
'Week': 'Hafta',
'not trained': 'çalışılmadı',
'Not trained in this period': 'Bu dönemde çalışılmadı',
'Every muscle group got some work in this period.': 'Bu dönemde her kas grubu çalıştı.',
'No workouts in this period yet.': 'Bu dönemde henüz antrenman yok.',
'What this session hits': 'Bu antrenman neyi çalıştırıyor',
'What you just trained': 'Az önce ne çalıştın',
'Body diagram': 'Vücut diyagramı',
'Male': 'Erkek',
'Female': 'Kadın',
'Less': 'Az',
'More': 'Çok',
'Traps': 'Trapez',
'Shoulders': 'Omuzlar',
'Chest': 'Göğüs',
'Upper back': 'Üst sırt',
'Serratus': 'Serratus',
'Biceps': 'Biseps',
'Triceps': 'Triseps',
'Forearms': 'Ön kollar',
'Abs': 'Karın',
'Obliques': 'Yan karın',
'Lower back': 'Alt sırt',
'Glutes': 'Kalça',
'Quads': 'Ön bacak',
'Hamstrings': 'Arka bacak',
'Adductors': 'Adduktörler',
'Hip flexors': 'Kalça fleksörleri',
'Calves': 'Baldırlar',
'Shins': 'İncik'
}
+83 -35
View File
@@ -43,16 +43,16 @@ export default {
'January': '一月', 'February': '二月', 'March': '三月', 'April': '四月',
'June': '六月', 'July': '七月', 'August': '八月', 'September': '九月',
'October': '十月', 'November': '十一月', 'December': '十二月',
'Quick check-in ⚖️': '快速称重 ⚖️',
'Quick check-in': '快速称重',
'Log body weight': '记录体重',
'Slide or tap to set your weight — tracked before every workout so your curve stays honest.': '滑动或点按设置体重——每次训练前记录,让你的曲线保持真实。',
'Save & start workout': '保存并开始训练',
'Skip today': '今天跳过',
'↺ Choose a different workout': '↺ 选择其他训练',
'Choose a different workout': '选择其他训练',
'Recent weigh-ins': '最近称重',
'Enter a valid weight': '请输入有效的重量',
'Weight saved ✓': '体重已保存 ✓',
'Target weight 🎯': '目标体重 🎯',
'Weight saved': '体重已保存',
'Target weight': '目标体重',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': '目标会以一条线显示在体重图表中,增减会根据是否朝目标靠近来着色。',
'Save goal': '保存目标',
'Goal set: {0}': '目标已设置:{0}',
@@ -60,17 +60,17 @@ export default {
'Goal removed': '目标已移除',
'Remove goal': '移除目标',
'Body weight': '体重',
'reached! 🎉': '已达成!🎉',
'reached!': '已达成!',
'{0} to gain': '还需增重 {0}',
'{0} to lose': '还需减重 {0}',
"No entries yet — log your weight to start the curve. It's also asked before every workout.": '还没有记录——记录体重以开始曲线。每次训练前也会询问。',
'Best:': '最佳:',
'+ Add to my plan': '+ 加入我的计划',
'Add to my plan': '加入我的计划',
'How to': '动作要领',
'instructions in English': '说明为英文',
'New routine': '新训练日',
'Add “{0}”': '添加“{0}”',
'“{0}” added to {1} ✓': '“{0}”已加入 {1} ✓',
'“{0}” added to {1}': '“{0}”已加入 {1}',
'Pick a routine — sets, reps & weight come next.': '选择一个训练日——组数、次数和重量随后设置。',
'{0} exercises': '{0} 个动作',
'already in': '已包含',
@@ -79,7 +79,7 @@ export default {
'Search {0} exercises…': '搜索 {0} 个动作…',
'Chosen': '常用',
'Nothing chosen yet — add exercises and they’ll show up here.': '还没有常用动作——添加后会显示在这里。',
'No match 🤷': '没有匹配 🤷',
'No match': '没有匹配',
'Show more': '显示更多',
'Intervals': '间歇数',
'Minutes': '分钟',
@@ -89,10 +89,10 @@ export default {
'Weight ({0})': '重量({0})',
'Add to routine': '加入训练日',
'Remove exercise': '移除动作',
'Pick an emoji': '选择表情',
'Pick an icon': '选择图标',
'Back to weekly plan': '恢复每周计划',
'{0} set to rest': '{0} 已设为休息',
'{0} planned for {1} ✓': '{0} 已安排在 {1} ✓',
'{0} planned for {1}': '{0} 已安排在 {1}',
'Weekly plan:': '每周计划:',
'changed for this day': '此日已更改',
'Sick, missed a day or want a different session? Pick what to train instead.': '生病、错过一天或想换个训练?选择改练什么。',
@@ -115,23 +115,23 @@ export default {
'Confirm the weight you worked with — your highest becomes the default next time.': '确认你使用的重量——最高值将成为下次的默认值。',
'Then finish the superset partner.': '然后完成超级组的另一个动作。',
'Previous best:': '之前最佳:',
'new record! 🏆': '新纪录!🏆',
'Save ✓': '保存 ✓',
'Save & next exercise ›': '保存并下一个动作 ›',
'new record!': '新纪录!',
'Save': '保存',
'Save & next exercise': '保存并下一个动作',
'Just close': '仅关闭',
'Save weight': '保存重量',
'Tracked — next time starts at {0} 📈': '已记录——下次从 {0} 开始 📈',
'Tracked — next time starts at {0}': '已记录——下次从 {0} 开始',
"That's the whole workout!": '训练全部完成!',
'Every exercise done — great work. Finish up, or keep going and add another exercise.': '所有动作都完成了——干得漂亮!结束训练,或继续添加新动作。',
'Finish workout 🏁': '结束训练 🏁',
'Finish workout': '结束训练',
'Continue workout': '继续训练',
'Keep going 💪 — tap “+ Add exercise” below': '继续加油 💪——点按下方“+ 添加动作”',
'Keep going — tap “+ Add exercise” below': '继续加油 ——点按下方“+ 添加动作”',
'Workout complete!': '训练完成!',
'Duration': '时长',
'Volume': '总量',
'PRs': '纪录',
'New PR:': '新纪录:',
'Nice! 💪': '太棒了!💪',
'Nice!': '太棒了!',
'Nothing logged yet': '还没有记录',
'You haven’t checked off any sets. Finish the workout anyway?': '你还没有勾选任何组。仍要结束训练吗?',
'Finish anyway': '仍然结束',
@@ -151,10 +151,10 @@ export default {
'Duration (min)': '时长(分钟)',
'Last time': '上次',
'Last time you hit all reps — try {0}': '上次完成了所有次数——试试 {0}',
'Weights bumped to {0} 💪': '重量已提升到 {0} 💪',
'Weights bumped to {0}': '重量已提升到 {0}',
'Remove set': '减一组',
'Add set': '加一组',
'Cardio logged 🏃': '有氧已记录 🏃',
'Cardio logged': '有氧已记录',
'Discard workout?': '放弃训练?',
'The sets you logged in this session will be lost.': '本次记录的组数将丢失。',
'Superset {0} / {1}': '超级组 {0} / {1}',
@@ -162,12 +162,12 @@ export default {
'Superset · do these back-to-back, rest after both': '超级组 · 连续完成,两个都做完再休息',
'Freestyle workout — add your first exercise.': '自由训练——添加你的第一个动作。',
'Finish workout early · {0} exercises': '提前结束 · {0} 个动作',
'Rest over — next set! 💪': '休息结束——下一组!💪',
'Hi {0} 💪': '你好,{0} 💪',
'Rest over — next set!': '休息结束——下一组!',
'Hi {0}': '你好,{0}',
'This week': '本周',
'{0} — in progress': '{0}——进行中',
'Resume ▶': '继续 ▶',
'Welcome! 👋': '欢迎!👋',
'Welcome!': '欢迎!',
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': '设置每周计划开始训练——或加载现成的推 / 拉 / 腿计划。',
'Load starter plan (PPL)': '加载入门计划(PPL)',
'Build my own plan': '创建自己的计划',
@@ -185,7 +185,7 @@ export default {
'Exercise progress': '动作进度',
'Top speed per workout': '每次训练最高速度',
'Best set weight per workout': '每次训练最佳组重量',
'Finish your first workout to see progress curves here. 📈': '完成第一次训练后,这里会显示进度曲线。📈',
'Finish your first workout to see progress curves here.': '完成第一次训练后,这里会显示进度曲线。',
'Recent workouts': '最近训练',
'Less time': '少',
'More time': '多',
@@ -198,7 +198,7 @@ export default {
'Load starter plan (Push / Pull / Legs)': '加载入门计划(推 / 拉 / 腿)',
'Superset with exercise above': '与上面的动作组成超级组',
'No exercises yet — add your first one.': '还没有动作——添加第一个吧。',
'Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.': '提示:点按动作上的 🔗 可与上面的动作组成超级组——你将连续完成它们。',
'Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.': '点击动作上的链接按钮,可与上面的动作组成超级组——你将连续完成它们。',
'Delete routine?': '删除训练日?',
'“{0}” and its exercises will be removed.': '“{0}”及其动作将被移除。',
'Delete routine': '删除训练日',
@@ -207,13 +207,13 @@ export default {
'No workouts yet.': '还没有训练。',
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': '入门计划已加载——周一推 · 周三拉 · 周五腿',
'Enter a name': '请输入名字',
'Profile created — data from this device moved into it ✓': '档案已创建——本设备数据已转入 ✓',
'Profile created — data moved into it ✓': '档案已创建——数据已转入 ✓',
'Welcome, {0} 💪': '欢迎,{0} 💪',
'Welcome back, {0} 💪': '欢迎回来,{0} 💪',
'Profile created — data from this device moved into it': '档案已创建——本设备数据已转入',
'Profile created — data moved into it': '档案已创建——数据已转入',
'Welcome, {0}': '欢迎,{0}',
'Welcome back, {0}': '欢迎回来,{0}',
'Registration failed': '注册失败',
'Sign-in failed': '登录失败',
'Create your profile ✨': '创建你的档案 ✨',
'Create your profile': '创建你的档案',
'Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.': '取个名字,然后用{0}确认。通行密钥保存在你的设备上——无需密码。',
'Pick a name, then confirm with your device.': '取个名字,然后用设备确认。',
'Your name': '你的名字',
@@ -254,10 +254,10 @@ export default {
'Deletes your plan, workouts and body weight on this device. This cannot be undone.': '删除本设备上的计划、训练和体重。无法撤销。',
'Delete everything': '全部删除',
'All data reset': '所有数据已重置',
'Backup exported ✓': '备份已导出 ✓',
'Backup exported': '备份已导出',
'Import backup?': '导入备份?',
'This replaces all current data with the backup file.': '这将用备份文件替换当前所有数据。',
'Backup imported ✓': '备份已导入 ✓',
'Backup imported': '备份已导入',
'Import failed: {0}': '导入失败:{0}',
'Tip': '提示',
'In Chrome: ⋮ menu → Add to Home screen': '在 Chrome 中:⋮ 菜单 → 添加到主屏幕',
@@ -278,13 +278,22 @@ export default {
'Test sent — should arrive any second': '测试已发送——马上就到',
'Test failed': '测试失败',
'Notifications off': '通知已关闭',
'Notifications on 🔔': '通知已开启 🔔',
'Notifications on': '通知已开启',
'Could not change notification settings': '无法更改通知设置',
'tap to pause': '点按暂停',
'tap to play': '点按播放',
'back': '背部', 'cardio': '有氧', 'chest': '胸部', 'lower arms': '前臂',
'lower legs': '小腿', 'neck': '颈部', 'shoulders': '肩部',
'upper arms': '上臂', 'upper legs': '大腿', 'waist': '腰腹',
'Details': '详情',
'Finish': '结束',
'Start {0}': '开始 {0}',
'Guest mode — data lives only in this browser.': '访客模式——数据仅保存在此浏览器中。',
'Keeps your data safe and separate per person.': '让你的数据安全,并按人分开保存。',
'Strength': '力量',
'Equipment': '器械',
'Recovery': '恢复',
'Any equipment': '所有器械',
'assisted': '辅助', 'band': '弹力带', 'barbell': '杠铃', 'body weight': '自重',
'bosu ball': '波速球', 'cable': '绳索', 'dumbbell': '哑铃',
'elliptical machine': '椭圆机', 'ez barbell': '曲杆杠铃', 'hammer': '锤',
@@ -320,11 +329,11 @@ export default {
'Give it a name': '请输入名称',
'Pick a body part': '请选择身体部位',
'“{0}” already exists': '「{0}」已存在',
'“{0}” created ✓': '「{0}」已创建 ✓',
'“{0}” created': '「{0}」已创建',
'Cardio exercises log time + speed instead of weight × reps.': '有氧动作记录时间 + 速度,而不是重量 × 次数。',
'custom': '自定义',
'Edit': '编辑',
'Saved ✓': '已保存 ✓',
'Saved': '已保存',
'Delete “{0}”?': '删除「{0}」?',
'It will be removed from your routines. Already-logged workouts keep their sets.': '将从你的计划中移除。已记录的训练会保留其组数。',
'Exercise deleted': '动作已删除',
@@ -332,5 +341,44 @@ export default {
'Description (optional) — setup, cues, anything you want to remember': '描述(可选)——设置、要点,任何你想记住的内容',
'Delete exercise': '删除动作',
'Edit or delete this exercise': '编辑或删除此动作',
'Remove from routine': '从计划中移除'
'Remove from routine': '从计划中移除',
'Minimize': '缩小',
'Expand': '放大',
'Invite code': '邀请码',
'This app is invite-only — enter the code you were given.': '此应用仅限邀请——请输入你收到的邀请码。',
'An invite code is required': '需要邀请码',
'Admin dashboard': '管理后台',
// --- muscle map ---
'Muscle balance': '肌肉平衡',
'by sets worked': '按训练组数',
'Week': '本周',
'not trained': '未训练',
'Not trained in this period': '此期间未训练',
'Every muscle group got some work in this period.': '此期间每个肌群都得到了训练。',
'No workouts in this period yet.': '此期间还没有训练。',
'What this session hits': '这次训练练到哪里',
'What you just trained': '你刚刚练了什么',
'Body diagram': '身体图示',
'Male': '男性',
'Female': '女性',
'Less': '更少',
'More': '更多',
'Traps': '斜方肌',
'Shoulders': '肩部',
'Chest': '胸部',
'Upper back': '上背部',
'Serratus': '前锯肌',
'Biceps': '肱二头肌',
'Triceps': '肱三头肌',
'Forearms': '前臂',
'Abs': '腹肌',
'Obliques': '腹斜肌',
'Lower back': '下背部',
'Glutes': '臀部',
'Quads': '股四头肌',
'Hamstrings': '腘绳肌',
'Adductors': '内收肌',
'Hip flexors': '髋屈肌',
'Calves': '小腿',
'Shins': '胫前肌'
}
+136 -100
View File
@@ -1,14 +1,20 @@
import { useEffect, useState } from 'react'
import { useStore } from './store/useStore.js'
import { useUI } from './store/useUI.js'
import { EXDB, EXIDX, BODYPARTS, isCardio, allExercises } from './lib/exercises.js'
import { EXDB, EXIDX, BODYPARTS, isCardio, allExercises, equipmentOf } from './lib/exercises.js'
import { fmtDate, fmtNum, fmtVol, fmtDur, todayISO, uid, DAYN, MONTHS_LONG, ACCENTS } from './lib/format.js'
import { lastEntryFor, bestWeightFor, buildSets, effectiveRoutineId, workoutVolume, setsDone, setsDoneActive, lastBW, supersetUnits, unitOf, setLabel, defaultConfig, cleanupSg } from './lib/history.js'
import { beep, vibrate } from './lib/sound.js'
import { t, instrFor, getLang, INSTR_LANGS } from './lib/i18n.js'
import { nav } from './lib/nav.js'
import { starterRoutines } from './lib/starter.js'
import Media, { Thumb } from './components/Media.jsx'
import Stepper from './components/Stepper.jsx'
import Icon from './components/Icon.jsx'
import { Button, Slider } from './components/ui.jsx'
import { glyphOf, GLYPH_GROUPS, DEFAULT_GLYPH } from './lib/glyphs.js'
import BodyMap from './components/BodyMap.jsx'
import { loadOfWorkouts } from './lib/muscles.js'
const S = () => useStore.getState().S
const update = (...a) => useStore.getState().update(...a)
@@ -23,7 +29,7 @@ function ConfirmDialog({ title, message, confirmText, cancelText, danger, onConf
<div className="muted" style={{ marginBottom: 18, lineHeight: 1.5 }}>{message}</div>
<button className={'btn ' + (danger ? 'danger' : 'primary')} onClick={() => { close(); onConfirm && onConfirm() }}>{confirmText || t('Confirm')}</button>
<div style={{ height: 8 }} />
<button className="btn ghost dim" onClick={close}>{cancelText || t('Cancel')}</button>
<Button variant="ghost" className="dim" onClick={close}>{cancelText || t('Cancel')}</Button>
</div>
}
// Themed replacement for window.confirm — callback-based (no blocking).
@@ -33,11 +39,8 @@ export function confirmSheet(opts) {
/* ============================ starter plan ============================ */
export function loadStarterPlan() {
const mk = (name, emoji, list) => ({ id: uid(), name, emoji, ex: list.map(([id, sets, reps]) => ({ id, sets, reps, weight: 0 })) })
const [push, pull, legs] = starterRoutines()
update(st => {
const push = mk('Push Day', '🫸', [['0025', 4, 8], ['0047', 3, 10], ['0426', 3, 10], ['0334', 3, 12], ['0241', 3, 12], ['0251', 3, 10]])
const pull = mk('Pull Day', '🫷', [['2330', 4, 10], ['0027', 4, 8], ['1323', 3, 10], ['0031', 3, 10], ['0313', 3, 12]])
const legs = mk('Leg Day', '🦵', [['0043', 4, 8], ['0085', 3, 10], ['0739', 3, 12], ['0585', 3, 12], ['0586', 3, 12], ['0605', 4, 15]])
st.routines.push(push, pull, legs)
st.week[1] = push.id; st.week[3] = pull.id; st.week[5] = legs.id
})
@@ -53,13 +56,12 @@ const W_LO = 1, W_HI = 300
function WeightInput({ value, setValue, unit }) {
const clamp = x => Math.max(W_LO, Math.min(W_HI, Math.round((x || 0) * 10) / 10))
const sv = Math.max(W_LO, Math.min(W_HI, value))
const pct = ((sv - W_LO) / (W_HI - W_LO)) * 100
const onSlide = v => setValue(clamp(v))
return <>
<div className="bwstep">
<button className="bw-pm" onClick={() => onSlide(value - 0.1)} aria-label="minus 0.1">−</button>
<button className="bw-pm" onClick={() => onSlide(value - 0.1)} aria-label="minus 0.1"><Icon name="minus" /></button>
<div className="bw-read">{fmtNum(value)}<span className="u"> {unit}</span></div>
<button className="bw-pm" onClick={() => onSlide(value + 0.1)} aria-label="plus 0.1">+</button>
<button className="bw-pm" onClick={() => onSlide(value + 0.1)} aria-label="plus 0.1"><Icon name="plus" /></button>
</div>
<div className="chips" style={{ justifyContent: 'center', margin: '8px 0' }}>
<button className="chip" onClick={() => onSlide(value - 1)}>−1</button>
@@ -67,9 +69,7 @@ function WeightInput({ value, setValue, unit }) {
<button className="chip" onClick={() => onSlide(value + 0.5)}>+0.5</button>
<button className="chip" onClick={() => onSlide(value + 1)}>+1</button>
</div>
<input className="bw-slider" type="range" min={W_LO} max={W_HI} step="0.5" value={sv}
onChange={e => onSlide(parseFloat(e.target.value))}
style={{ '--track': `linear-gradient(90deg, var(--acc) ${pct}%, var(--bg2) ${pct}%)` }} />
<Slider value={sv} min={W_LO} max={W_HI} step={0.5} onChange={onSlide} />
</>
}
@@ -89,27 +89,27 @@ function BwSheet({ required, onDone, close }) {
s.bodyweight.sort((a, b) => (a.d < b.d ? -1 : 1))
})
close()
if (onDone) onDone(n); else toast(t('Weight saved ✓'))
if (onDone) onDone(n); else toast(t('Weight saved'))
}
const recent = [...st.bodyweight].reverse().slice(0, 3)
const delEntry = d => update(s => { s.bodyweight = s.bodyweight.filter(b => b.d !== d) })
return <>
<h3>{required ? t('Quick check-in ⚖️') : t('Log body weight')}</h3>
<h3>{required ? t('Quick check-in') : t('Log body weight')}</h3>
<div className="muted small">{required ? t('Slide or tap to set your weight — tracked before every workout so your curve stays honest.') : t('Today') + ', ' + fmtDate(todayISO(), true)}</div>
<WeightInput value={v} setValue={setV} unit={unit} />
<div style={{ height: 14 }} />
<button className="btn primary" onClick={save}>{required ? t('Save & start workout') : t('Save')}</button>
<Button variant="primary" onClick={save}>{required ? t('Save & start workout') : t('Save')}</Button>
{required && <>
<div style={{ height: 8 }} /><button className="btn ghost dim" onClick={() => { close(); onDone && onDone(null) }}>{t('Skip today')}</button>
<div style={{ height: 2 }} /><button className="btn ghost dim" onClick={() => { close(); nav('/workout') }}>{t('↺ Choose a different workout')}</button>
<div style={{ height: 8 }} /><Button variant="ghost" className="dim" onClick={() => { close(); onDone && onDone(null) }}>{t('Skip today')}</Button>
<div style={{ height: 2 }} /><Button variant="ghost" className="dim" icon="reset" onClick={() => { close(); nav('/workout') }}>{t('Choose a different workout')}</Button>
</>}
{!required && recent.length > 0 && <>
<h4 className="sec">{t('Recent weigh-ins')}</h4>
<div className="list" style={{ gap: 0 }}>
{recent.map(b => <div key={b.d} className="row between" style={{ padding: '9px 2px', borderBottom: '1px solid var(--bg2)' }}>
{recent.map(b => <div key={b.d} className="row between" style={{ padding: '9px 2px', borderBottom: '1px solid var(--sep)' }}>
<span className="small muted">{fmtDate(b.d, true)}</span>
<span className="row" style={{ gap: 12 }}><b>{fmtNum(b.w)} {unit}</b>
<button className="iconbtn" style={{ width: 34, height: 30, fontSize: '.9rem' }} onClick={() => delEntry(b.d)} aria-label="delete">🗑</button></span>
<button className="iconbtn" style={{ width: 32, height: 30, borderRadius: 8, fontSize: 15, color: 'var(--red)' }} onClick={() => delEntry(b.d)} aria-label="delete"><Icon name="trash" /></button></span>
</div>)}
</div>
</>}
@@ -122,8 +122,8 @@ export function bwSheet(opts = {}) {
/* ============================ target weight ============================ */
export function bwDeltaColor(delta, currentW) {
if (!delta) return 'var(--mut)'
if (!S().targetW) return 'var(--txt)'
if (!delta) return 'var(--label-2)'
if (!S().targetW) return 'var(--label)'
const up = S().targetW > currentW
return (delta > 0) === up ? 'var(--acc)' : 'var(--red)'
}
@@ -132,17 +132,17 @@ function GoalSheet({ close }) {
const bw = lastBW(st)
const [v, setV] = useState(st.targetW || (bw ? bw.w : 70))
return <>
<h3>{t('Target weight 🎯')}</h3>
<h3>{t('Target weight')}</h3>
<div className="muted small">{t('Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.')}</div>
<WeightInput value={v} setValue={setV} unit={st.unit} />
<div style={{ height: 14 }} />
<button className="btn primary" onClick={() => {
<Button variant="primary" onClick={() => {
const n = Math.round((v || 0) * 10) / 10
if (!n || n <= 0) { toast(t('Enter a valid weight')); return }
update(s => { s.targetW = n }); close()
const b = lastBW(S()); toast(t('Goal set: {0}', fmtNum(n) + ' ' + st.unit) + (b ? ' (' + t('{0} to go', fmtNum(Math.abs(n - b.w))) + ')' : ''))
}}>{t('Save goal')}</button>
{st.targetW && <><div style={{ height: 8 }} /><button className="btn danger" onClick={() => { update(s => { s.targetW = null }); close(); toast(t('Goal removed')) }}>{t('Remove goal')}</button></>}
}}>{t('Save goal')}</Button>
{st.targetW && <><div style={{ height: 8 }} /><Button variant="danger" onClick={() => { update(s => { s.targetW = null }); close(); toast(t('Goal removed')) }}>{t('Remove goal')}</Button></>}
</>
}
export const goalSheet = () => ui().openSheet(close => <GoalSheet close={close} />)
@@ -157,16 +157,16 @@ function ExerciseDetail({ ex, close }) {
<Media ex={ex} />
<div className="row" style={{ gap: 6, flexWrap: 'wrap', margin: '10px 0' }}>
<span className="tag acc">{t(ex.bp)}</span>
{ex.tg && <span className="tag">🎯 {t(ex.tg)}</span>}
<span className="tag">🛠 {t(ex.eq)}</span>
{ex.tg && <span className="tag"><Icon name="target" />{t(ex.tg)}</span>}
<span className="tag"><Icon name="dumbbell" />{t(ex.eq)}</span>
{(ex.sm || []).slice(0, 3).map((s, i) => <span key={i} className="tag">{t(s)}</span>)}
</div>
{ex.desc && <div className="exnote">{ex.desc}</div>}
{best > 0 && <div className="small" style={{ marginBottom: 6 }}>🏆 {t('Best:')} <b className="accent">{fmtNum(best)} {st.unit}</b>{last ? ` · ${t('last')} ${fmtDate(last.d)}: ${last.sets.map(s => setLabel(ex.id, s)).join(', ')}` : ''}</div>}
<button className="btn primary" style={{ margin: '10px 0 4px' }} onClick={() => addToRoutineSheet(ex)}>{t('+ Add to my plan')}</button>
{best > 0 && <div className="small row" style={{ marginBottom: 6, gap: 5 }}><Icon name="trophy" style={{ fontSize: 14, color: 'var(--yellow)' }} />{t('Best:')} <b className="accent">{fmtNum(best)} {st.unit}</b>{last ? ` · ${t('last')} ${fmtDate(last.d)}: ${last.sets.map(s => setLabel(ex.id, s)).join(', ')}` : ''}</div>}
<Button variant="primary" icon="plus" style={{ margin: '10px 0 4px' }} onClick={() => addToRoutineSheet(ex)}>{t('Add to my plan')}</Button>
{ex.custom && <div className="row" style={{ gap: 8, marginTop: 8 }}>
<button className="btn" style={{ flex: 1 }} onClick={() => { close(); customExSheet(ex) }}>✏️ {t('Edit')}</button>
<button className="btn danger" style={{ flex: 1 }} onClick={() => deleteCustomEx(ex, close)}>🗑 {t('Delete')}</button>
<Button icon="pencil" style={{ flex: 1 }} onClick={() => { close(); customExSheet(ex) }}>{t('Edit')}</Button>
<Button variant="danger" icon="trash" style={{ flex: 1 }} onClick={() => deleteCustomEx(ex, close)}>{t('Delete')}</Button>
</div>}
{instrFor(ex).length > 0 && <><h4 className="sec">{t('How to')}{!INSTR_LANGS.includes(getLang()) && <span className="dim" style={{ textTransform: 'none', letterSpacing: 0 }}> · {t('instructions in English')}</span>}</h4><ol className="steps-list">{instrFor(ex).map((s, i) => <li key={i}>{s}</li>)}</ol></>}
</>
@@ -181,12 +181,12 @@ function AddToRoutine({ ex, close }) {
const isNew = rid === '_new'
exConfigSheet(ex, null, cfg => {
update(s => {
let r = isNew ? { id: uid(), name: t('New routine'), emoji: '💪', ex: [] } : s.routines.find(x => x.id === rid)
let r = isNew ? { id: uid(), name: t('New routine'), emoji: DEFAULT_GLYPH, ex: [] } : s.routines.find(x => x.id === rid)
if (isNew) s.routines.push(r)
if (r) r.ex.push({ id: ex.id, ...cfg })
})
const r = isNew ? S().routines[S().routines.length - 1] : st.routines.find(x => x.id === rid)
toast(t('“{0}” added to {1} ✓', ex.n, r ? r.name : t('routine')))
toast(t('“{0}” added to {1}', ex.n, r ? r.name : t('routine')))
if (isNew && r) nav('/plan/r/' + r.id)
})
}
@@ -195,12 +195,12 @@ function AddToRoutine({ ex, close }) {
<div className="muted small" style={{ marginBottom: 12 }}>{t('Pick a routine — sets, reps & weight come next.')}</div>
<div className="list">
{st.routines.map(r => <div key={r.id} className="item" onClick={() => pick(r.id)}>
<div style={{ fontSize: '1.3rem', flex: 'none' }}>{r.emoji || '💪'}</div>
<span className="lrow-i"><Icon name={glyphOf(r.emoji)} /></span>
<div className="grow"><div className="tt">{r.name}</div><div className="ss">{t('{0} exercises', r.ex.length)}</div></div>
{r.ex.some(e => e.id === ex.id) && <span className="tag">{t('already in')}</span>}<span className="chev">+</span>
{r.ex.some(e => e.id === ex.id) && <span className="tag">{t('already in')}</span>}<Icon name="plus" className="chev" />
</div>)}
<div className="item" onClick={() => pick('_new')}><div style={{ fontSize: '1.3rem', flex: 'none' }}>✨</div>
<div className="grow"><div className="tt">{t('New routine')}</div><div className="ss">{t('Create one and start with this exercise')}</div></div><span className="chev">+</span></div>
<div className="item" onClick={() => pick('_new')}><span className="lrow-i" style={{ background: 'var(--surface-3)' }}><Icon name="sparkles" /></span>
<div className="grow"><div className="tt">{t('New routine')}</div><div className="ss">{t('Create one and start with this exercise')}</div></div><Icon name="plus" className="chev" /></div>
</div>
</>
}
@@ -227,7 +227,7 @@ function CustomExForm({ existing, prefill, onDone, close }) {
update(s => { (s.customEx = s.customEx || []).push({ id, n: name, bp, desc: d, tg: '', eq: 'custom', custom: true }) })
}
close()
toast(existing ? t('Saved ✓') : t('“{0}” created ✓', name))
toast(existing ? t('Saved') : t('“{0}” created', name))
onDone && onDone(EXIDX[id])
}
return <>
@@ -237,12 +237,12 @@ function CustomExForm({ existing, prefill, onDone, close }) {
<div className="chips" style={{ margin: '12px 0' }}>
{BODYPARTS.map(b => <button key={b} className={'chip' + (bp === b ? ' on' : '')} onClick={() => setBp(b)}>{t(b)}</button>)}
</div>
{bp === 'cardio' && <div className="small dim" style={{ marginBottom: 10 }}>🏃 {t('Cardio exercises log time + speed instead of weight × reps.')}</div>}
{bp === 'cardio' && <div className="small dim row" style={{ marginBottom: 10, gap: 5 }}><Icon name="figureRun" style={{ fontSize: 13 }} />{t('Cardio exercises log time + speed instead of weight × reps.')}</div>}
<textarea className="input" rows={4} maxLength={1000} placeholder={t('Description (optional) — setup, cues, anything you want to remember')}
value={desc} onChange={e => setDesc(e.target.value)} />
<div style={{ height: 14 }} />
<button className="btn primary" onClick={save}>{existing ? t('Save') : t('Create exercise')}</button>
{existing && <><div style={{ height: 8 }} /><button className="btn danger" onClick={() => { close(); deleteCustomEx(existing) }}>🗑 {t('Delete exercise')}</button></>}
<Button variant="primary" onClick={save}>{existing ? t('Save') : t('Create exercise')}</Button>
{existing && <><div style={{ height: 8 }} /><Button variant="danger" icon="trash" onClick={() => { close(); deleteCustomEx(existing) }}>{t('Delete exercise')}</Button></>}
</>
}
export const customExSheet = (existing, onDone, prefill) => ui().openSheet(close => <CustomExForm existing={existing} prefill={prefill} onDone={onDone} close={close} />)
@@ -280,35 +280,44 @@ function ExercisePicker({ onPick, close }) {
const usage = usageMap(st)
const [q, setQ] = useState('')
const [bp, setBp] = useState('') // '' = all, '★' = chosen, else a body part
const [eq, setEq] = useState('') // '' = any equipment
const [shown, setShown] = useState(50)
const ql = q.toLowerCase().trim()
const all = allExercises(st)
let f = all.filter(e =>
let base = all.filter(e =>
(bp === '★' ? usage[e.id] : (!bp || e.bp === bp)) &&
(!ql || e.n.toLowerCase().includes(ql) || e.tg.includes(ql) || e.eq.includes(ql) || (e.desc || '').toLowerCase().includes(ql)))
if (bp === '★') f = [...f].sort((a, b) => (usage[b.id] - usage[a.id]) || (a.n < b.n ? -1 : 1))
if (bp === '★') base = [...base].sort((a, b) => (usage[b.id] - usage[a.id]) || (a.n < b.n ? -1 : 1))
const eqOpts = equipmentOf(base)
// Drop the equipment filter if the search narrowed it away, so you never hit a dead end.
const eqOn = eqOpts.includes(eq) ? eq : ''
const f = eqOn ? base.filter(e => e.eq === eqOn) : base
const chosenCount = Object.keys(usage).length
return <>
<h3>{t('Add exercise')}</h3>
<div className="search"><svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="7" /><path d="m21 21-4.3-4.3" /></svg>
<input className="input" placeholder={t('Search {0} exercises…', all.length)} value={q} onChange={e => { setQ(e.target.value); setShown(50) }} /></div>
<div className="chips" style={{ margin: '10px 0' }}>
{chosenCount > 0 && <button className={'chip' + (bp === '★' ? ' on' : '')} onClick={() => { setBp('★'); setShown(50) }}>⭐ {t('Chosen')} ({chosenCount})</button>}
<button className={'chip' + (!bp ? ' on' : '')} onClick={() => { setBp(''); setShown(50) }}>{t('All')}</button>
{BODYPARTS.map(b => <button key={b} className={'chip' + (bp === b ? ' on' : '')} onClick={() => { setBp(b); setShown(50) }}>{t(b)}</button>)}
<div className="chips" style={{ margin: eqOpts.length > 1 ? '10px 0 6px' : '10px 0' }}>
{chosenCount > 0 && <button className={'chip' + (bp === '★' ? ' on' : '')} onClick={() => { setBp('★'); setEq(''); setShown(50) }}><Icon name="starFill" style={{ fontSize: 12, display: 'inline-block', marginRight: 4, verticalAlign: '-1px' }} />{t('Chosen')} ({chosenCount})</button>}
<button className={'chip nocap' + (!bp ? ' on' : '')} onClick={() => { setBp(''); setEq(''); setShown(50) }}>{t('All')}</button>
{BODYPARTS.map(b => <button key={b} className={'chip' + (bp === b ? ' on' : '')} onClick={() => { setBp(b); setEq(''); setShown(50) }}>{t(b)}</button>)}
</div>
{eqOpts.length > 1 && <div className="chips" style={{ marginBottom: 10 }}>
<button className={'chip nocap' + (!eqOn ? ' on' : '')} onClick={() => { setEq(''); setShown(50) }}>{t('Any equipment')}</button>
{eqOpts.map(x => <button key={x} className={'chip' + (eqOn === x ? ' on' : '')} onClick={() => { setEq(x); setShown(50) }}>{t(x)}</button>)}
</div>}
<div className="list">
{bp !== '★' && <div className="item" onClick={() => customExSheet(null, ex => onPick(ex), q.trim())}>
<div className="thumb thumb-x">✨</div>
<div className="grow"><div className="tt">{t('Create your own exercise')}</div><div className="ss">{t('name + body part, no animation')}</div></div><span className="chev">+</span>
<div className="thumb thumb-x"><Icon name="sparkles" /></div>
<div className="grow"><div className="tt">{t('Create your own exercise')}</div><div className="ss">{t('name + body part, no animation')}</div></div><Icon name="plus" className="chev" />
</div>}
{f.slice(0, shown).map(e => <div key={e.id} className="item" onClick={() => onPick(e)}>
<Thumb ex={e} /><div className="grow"><div className="tt">{e.n}</div><div className="ss">{t(e.tg || e.bp)} · {t(e.eq)}</div></div>
{usage[e.id] && <span className="tag acc">⭐</span>}<span className="chev">+</span>
<Thumb ex={e} /><div className="grow"><div className="tt capitalize">{e.n}</div><div className="ss capitalize">{t(e.tg || e.bp)} · {t(e.eq)}</div></div>
{usage[e.id] && <span className="tag acc"><Icon name="starFill" /></span>}<Icon name="plus" className="chev" />
</div>)}
{f.length === 0 && bp === '★' && <div className="empty">{t('Nothing chosen yet — add exercises and they’ll show up here.')}</div>}
</div>
{f.length > shown && <><div style={{ height: 8 }} /><button className="btn" onClick={() => setShown(s => s + 50)}>{t('Show more')}</button></>}
{f.length > shown && <><div style={{ height: 8 }} /><Button onClick={() => setShown(s => s + 50)}>{t('Show more')}</Button></>}
</>
}
export const exercisePicker = onPick => ui().openSheet(close => <ExercisePicker onPick={onPick} close={close} />)
@@ -327,7 +336,7 @@ function ExConfig({ ex, existing, onSave, onDelete, close }) {
<h3 className="capitalize">{ex.n}</h3>
<Media ex={ex} />
<div className="row" style={{ gap: 6, flexWrap: 'wrap', margin: '10px 0 14px' }}>
{cardio && <span className="tag acc">🏃 {t('Cardio')}</span>}
{cardio && <span className="tag acc"><Icon name="figureRun" />{t('Cardio')}</span>}
<span className="tag">{t(ex.tg || ex.bp)}</span><span className="tag">{t(ex.eq)}</span>
</div>
{ex.desc && <div className="exnote">{ex.desc}</div>}
@@ -342,19 +351,36 @@ function ExConfig({ ex, existing, onSave, onDelete, close }) {
<Stepper label={t('Weight ({0})', st.unit)} value={c.weight} step={2.5} onChange={v => setC(x => ({ ...x, weight: v }))} />
</>}
</div>
<button className="btn primary" onClick={save}>{existing ? t('Save') : t('Add to routine')}</button>
{ex.custom && <><div style={{ height: 8 }} /><button className="btn" onClick={() => { close(); customExSheet(ex) }}>✏️ {t('Edit or delete this exercise')}</button></>}
{onDelete && <><div style={{ height: 8 }} /><button className="btn danger" onClick={() => { close(); onDelete() }}>{t('Remove from routine')}</button></>}
<Button variant="primary" onClick={save}>{existing ? t('Save') : t('Add to routine')}</Button>
{ex.custom && <><div style={{ height: 8 }} /><Button icon="pencil" onClick={() => { close(); customExSheet(ex) }}>{t('Edit or delete this exercise')}</Button></>}
{onDelete && <><div style={{ height: 8 }} /><Button variant="danger" onClick={() => { close(); onDelete() }}>{t('Remove from routine')}</Button></>}
</>
}
export const exConfigSheet = (ex, existing, onSave, onDelete) => ui().openSheet(close => <ExConfig ex={ex} existing={existing} onSave={onSave} onDelete={onDelete} close={close} />)
/* ============================ emoji picker ============================ */
const ROUTINE_EMOJIS = ['💪', '🏋️', '🏋️‍♀️', '🦵', '🦾', '🫸', '🫷', '🔥', '⚡', '💥', '🏃', '🏃‍♀️', '🚴', '🏊', '🤸', '🥊', '🧗', '⛰️', '🏔️', '🚀', '🧘', '🧘‍♀️', '🎯', '🏆', '🥇', '⭐', '🌟', '👑', '🛡️', '⚔️', '🦍', '🐂', '🐻', '🦁', '🐺', '🦈', '😤', '🤖', '🧨', '❤️‍🔥']
export const emojiPicker = (current, onPick) => ui().openSheet(close => <>
<h3>{t('Pick an emoji')}</h3>
<div className="emoji-grid">{ROUTINE_EMOJIS.map(e => <button key={e} className={'emoji-cell' + (e === current ? ' on' : '')} onClick={() => { close(); onPick(e) }}>{e}</button>)}</div>
</>)
/* ============================ glyph picker ============================ */
// Grouped by what the glyph means for a training day, so picking one is a scan
// of four short rows rather than a hunt through twenty loose icons.
export const glyphPicker = (current, onPick) => {
const cur = glyphOf(current)
return ui().openSheet(close => <>
<h3>{t('Pick an icon')}</h3>
{GLYPH_GROUPS.map(g => (
<div key={g.key} style={{ marginBottom: 14 }}>
<div className="sect-t" style={{ padding: '0 2px 7px' }}>{t(g.key)}</div>
<div className="glyph-grid">
{g.items.map(n => (
<button key={n} className={'glyph-cell' + (n === cur ? ' on' : '')}
onClick={() => { close(); onPick(n) }} aria-label={n}>
<Icon name={n} />
</button>
))}
</div>
</div>
))}
<div style={{ height: 4 }} />
</>)
}
/* ============================ day override / assign ============================ */
function DayOverride({ iso, close }) {
@@ -366,18 +392,18 @@ function DayOverride({ iso, close }) {
const set = v => {
update(s => { if (!v) delete s.dayPlan[iso]; else s.dayPlan[iso] = v })
close()
toast(v === '' ? t('Back to weekly plan') : v === 'rest' ? t('{0} set to rest', fmtDate(iso)) : t('{0} planned for {1} ✓', (st.routines.find(r => r.id === v) || {}).name, fmtDate(iso)))
toast(v === '' ? t('Back to weekly plan') : v === 'rest' ? t('{0} set to rest', fmtDate(iso)) : t('{0} planned for {1}', (st.routines.find(r => r.id === v) || {}).name, fmtDate(iso)))
}
return <>
<h3>{fmtDate(iso, true)}</h3>
<div className="muted small" style={{ marginBottom: 12 }}>{t('Weekly plan:')} {weeklyR ? weeklyR.name : t('Rest')}{hasOvr && <span style={{ color: 'var(--orange)' }}> · {t('changed for this day')}</span>}<br />{t('Sick, missed a day or want a different session? Pick what to train instead.')}</div>
<div className="list">
{st.routines.map(r => <div key={r.id} className="item" onClick={() => set(r.id)}>
<div style={{ fontSize: '1.3rem', flex: 'none' }}>{r.emoji || '💪'}</div>
<span className="lrow-i"><Icon name={glyphOf(r.emoji)} /></span>
<div className="grow"><div className="tt">{r.name}</div><div className="ss">{t('{0} exercises', r.ex.length)}</div></div>
{effId === r.id && <span className="accent">✓</span>}</div>)}
<div className="item" onClick={() => set('rest')}><div className="grow"><div className="tt">😌 {t('Rest / skip this day')}</div></div>{effId === null && <span className="accent">✓</span>}</div>
{hasOvr && <div className="item" onClick={() => set('')}><div className="grow"><div className="tt">↺ {t('Back to weekly plan')}</div></div></div>}
{effId === r.id && <Icon name="check" className="accent" />}</div>)}
<div className="item" onClick={() => set('rest')}><span className="lrow-i" style={{ background: 'var(--surface-3)' }}><Icon name="moon" /></span><div className="grow"><div className="tt">{t('Rest / skip this day')}</div></div>{effId === null && <Icon name="check" className="accent" />}</div>
{hasOvr && <div className="item" onClick={() => set('')}><span className="lrow-i" style={{ background: 'var(--surface-3)' }}><Icon name="reset" /></span><div className="grow"><div className="tt">{t('Back to weekly plan')}</div></div></div>}
</div>
</>
}
@@ -389,11 +415,11 @@ function DayAssign({ day, close }) {
return <>
<h3>{t(DAYN[day])}</h3>
<div className="list">
<div className="item" onClick={() => set('')}><div className="grow"><div className="tt">😌 {t('Rest day')}</div></div>{!st.week[day] && <span className="accent">✓</span>}</div>
<div className="item" onClick={() => set('')}><span className="lrow-i" style={{ background: 'var(--surface-3)' }}><Icon name="moon" /></span><div className="grow"><div className="tt">{t('Rest day')}</div></div>{!st.week[day] && <Icon name="check" className="accent" />}</div>
{st.routines.map(r => <div key={r.id} className="item" onClick={() => set(r.id)}>
<div style={{ fontSize: '1.3rem', flex: 'none' }}>{r.emoji || '💪'}</div>
<span className="lrow-i"><Icon name={glyphOf(r.emoji)} /></span>
<div className="grow"><div className="tt">{r.name}</div><div className="ss">{t('{0} exercises', r.ex.length)}</div></div>
{st.week[day] === r.id && <span className="accent">✓</span>}</div>)}
{st.week[day] === r.id && <Icon name="check" className="accent" />}</div>)}
</div>
</>
}
@@ -404,16 +430,16 @@ function WorkoutDetail({ w, close }) {
const st = useStore(s => s.S)
return <>
<h3>{w.name}</h3>
<div className="muted small" style={{ marginBottom: 12 }}>{fmtDate(w.d, true)} · {fmtDur(w.end - w.start)} · {fmtVol(w.vol, st.unit)}{w.bw ? ' · ⚖️ ' + fmtNum(w.bw) + ' ' + st.unit : ''}</div>
<div className="muted small" style={{ marginBottom: 12 }}>{fmtDate(w.d, true)} · {fmtDur(w.end - w.start)} · {fmtVol(w.vol, st.unit)}{w.bw ? ' · ' + fmtNum(w.bw) + ' ' + st.unit : ''}</div>
{w.entries.map((e, i) => {
const ex = EXIDX[e.id]
return <div key={i} className="row" style={{ marginBottom: 12, alignItems: 'flex-start' }}>
{ex && <Thumb ex={ex} />}
<div className="grow"><div className="tt capitalize" style={{ fontWeight: 700 }}>{ex ? ex.n : (e.n || e.id)} {w.prs && w.prs.includes(e.id) && <span className="pr">🏆 PR</span>}</div>
<div className="grow"><div className="tt capitalize" style={{ fontWeight: 600 }}>{ex ? ex.n : (e.n || e.id)} {w.prs && w.prs.includes(e.id) && <span className="pr"><Icon name="trophy" />PR</span>}</div>
<div className="ss">{e.sets.filter(s => s.done).map(s => setLabel(e.id, s)).join(' · ') || t('no sets')}</div></div>
</div>
})}
<button className="btn danger" onClick={() => confirmSheet({ title: t('Delete workout?'), message: t('This removes it from your history for good.'), confirmText: t('Delete'), danger: true, onConfirm: () => { update(s => { s.workouts = s.workouts.filter(x => x.id !== w.id) }); close(); toast(t('Workout deleted')) } })}>{t('Delete workout')}</button>
<Button variant="danger" onClick={() => confirmSheet({ title: t('Delete workout?'), message: t('This removes it from your history for good.'), confirmText: t('Delete'), danger: true, onConfirm: () => { update(s => { s.workouts = s.workouts.filter(x => x.id !== w.id) }); close(); toast(t('Workout deleted')) } })}>{t('Delete workout')}</Button>
</>
}
export const workoutDetailSheet = w => ui().openSheet(close => <WorkoutDetail w={w} close={close} />)
@@ -444,9 +470,9 @@ function Calendar({ start, close }) {
}
return <>
<div className="row between" style={{ marginBottom: 2 }}>
<button className="iconbtn" onClick={() => setCur(new Date(y, mo - 1, 1))}>‹</button>
<button className="iconbtn" onClick={() => setCur(new Date(y, mo - 1, 1))} aria-label="Previous month"><Icon name="chevronLeft" /></button>
<h3 style={{ margin: 0 }}>{t(MONTHS_LONG[mo])} {y}</h3>
<button className="iconbtn" onClick={() => setCur(new Date(y, mo + 1, 1))}>›</button>
<button className="iconbtn" onClick={() => setCur(new Date(y, mo + 1, 1))} aria-label="Next month"><Icon name="chevronRight" /></button>
</div>
<div className="small muted" style={{ textAlign: 'center' }}>{monthWs.length ? `${t(monthWs.length === 1 ? '{0} workout' : '{0} workouts', monthWs.length)} · ${fmtDur(monthMs)} · ${fmtVol(monthVol, st.unit)}` : t('No workouts this month')}</div>
<div className="cal-grid">{['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'].map(l => <div key={l} className="cal-h">{t(l)}</div>)}{cells}</div>
@@ -463,13 +489,13 @@ export const calendarSheet = start => ui().openSheet(close => <Calendar start={s
/* shared small workout row (used in lists) */
export function WorkoutRow({ w, onClick }) {
const st = useStore(s => s.S)
const emoji = (st.routines.find(r => r.id === w.routineId) || {}).emoji || '💪'
const glyph = glyphOf((st.routines.find(r => r.id === w.routineId) || {}).emoji)
return <div className="item" onClick={onClick}>
<div style={{ fontSize: '1.5rem', flex: 'none' }}>{emoji}</div>
<span className="lrow-i" style={{ width: 34, height: 34, borderRadius: 8, fontSize: 19 }}><Icon name={glyph} /></span>
<div className="grow"><div className="tt">{w.name}</div>
<div className="ss">{fmtDate(w.d, true)} · {fmtDur(w.end - w.start)} · {t('{0} sets', setsDone(w))} · {fmtVol(w.vol, st.unit)}</div></div>
{w.prs && w.prs.length > 0 && <span className="pr">🏆 {w.prs.length} PR</span>}
<span className="chev">›</span>
{w.prs && w.prs.length > 0 && <span className="pr"><Icon name="trophy" />{w.prs.length} PR</span>}
<Icon name="chevronRight" className="chev" />
</div>
}
@@ -490,17 +516,24 @@ export function beginWorkout(routineId, bw) {
function TopWeight({ entryIdx, close }) {
const st = useStore(s => s.S)
const A = st.active
const entry = A.entries[entryIdx]
const ex = EXIDX[entry.id]
const maxSet = Math.max(0, ...entry.sets.filter(s => s.done).map(s => s.w || 0))
const prevBest = Math.max((st.exWeights[entry.id] || {}).w || 0, bestWeightFor(st, entry.id))
const [v, setV] = useState(Math.max(maxSet, prevBest) || entry.target.weight || 0)
// The workout can end underneath this sheet: finishing from the last exercise clears
// `active`, and this re-renders before the sheet is torn down. Everything below is
// read defensively and the sheet dismisses itself — reading A.entries straight took
// the whole app down with it. Hooks still run unconditionally, so the bail-out has
// to sit after every one of them.
const entry = A ? A.entries[entryIdx] : null
const ex = entry && EXIDX[entry.id]
const maxSet = entry ? Math.max(0, ...entry.sets.filter(s => s.done).map(s => s.w || 0)) : 0
const prevBest = entry ? Math.max((st.exWeights[entry.id] || {}).w || 0, bestWeightFor(st, entry.id)) : 0
const [v, setV] = useState(entry ? (Math.max(maxSet, prevBest) || entry.target.weight || 0) : 0)
useEffect(() => { if (!entry) close() }, [!entry])
const units = supersetUnits(A.entries)
const unit = unitOf(units, entryIdx)
const unitDone = unit.every(i => A.entries[i].sets.every(s => s.done))
const units = supersetUnits(A ? A.entries : [])
const unit = entry ? unitOf(units, entryIdx) : []
const unitDone = !!entry && unit.every(i => A.entries[i].sets.every(s => s.done))
const unitIdx = units.findIndex(u => u === unit)
const isLastUnit = unitIdx === units.length - 1
if (!entry || !ex) return null
const commit = advance => {
const n = Math.round((v || 0) * 10) / 10
@@ -514,18 +547,18 @@ function TopWeight({ entryIdx, close }) {
if (advance && unitDone) {
if (isLastUnit) workoutCompleteSheet() // whole workout done → finish/continue prompt
else update(s => { s.active.cur = units[unitIdx + 1][0] })
} else toast(t('Tracked — next time starts at {0} 📈', fmtNum(S().exWeights[entry.id].w) + ' ' + st.unit))
} else toast(t('Tracked — next time starts at {0}', fmtNum(S().exWeights[entry.id].w) + ' ' + st.unit))
}
return <>
<h3 className="capitalize">✅ {t('{0} done', ex.n)}</h3>
<h3 className="capitalize row" style={{ gap: 8 }}><Icon name="checkCircle" style={{ color: 'var(--acc)' }} />{t('{0} done', ex.n)}</h3>
<div className="muted small">{t('Confirm the weight you worked with — your highest becomes the default next time.')}{!unitDone && unit.length > 1 ? ' ' + t('Then finish the superset partner.') : ''}</div>
<WeightInput value={v} setValue={setV} unit={st.unit} />
<div style={{ height: 10 }} />
{prevBest > 0 ? <div className="small dim" style={{ textAlign: 'center', marginBottom: 12 }}>{t('Previous best:')} {fmtNum(prevBest)} {st.unit}{maxSet > prevBest && <span style={{ color: 'var(--gold)' }}> — {t('new record! 🏆')}</span>}</div> : <div style={{ height: 4 }} />}
{prevBest > 0 ? <div className="small dim" style={{ textAlign: 'center', marginBottom: 12 }}>{t('Previous best:')} {fmtNum(prevBest)} {st.unit}{maxSet > prevBest && <span style={{ color: 'var(--yellow)' }}> — {t('new record!')}</span>}</div> : <div style={{ height: 4 }} />}
{unitDone ? <>
<button className="btn primary" onClick={() => commit(true)}>{isLastUnit ? t('Save ✓') : t('Save & next exercise ›')}</button>
<div style={{ height: 8 }} /><button className="btn ghost dim" onClick={() => commit(false)}>{t('Just close')}</button>
</> : <button className="btn primary" onClick={() => commit(false)}>{t('Save weight')}</button>}
<Button variant="primary" trailingIcon={isLastUnit ? null : 'chevronRight'} onClick={() => commit(true)}>{isLastUnit ? t('Save') : t('Save & next exercise')}</Button>
<div style={{ height: 8 }} /><Button variant="ghost" className="dim" onClick={() => commit(false)}>{t('Just close')}</Button>
</> : <Button variant="primary" onClick={() => commit(false)}>{t('Save weight')}</Button>}
</>
}
export const topWeightSheet = entryIdx => ui().openSheet(close => <TopWeight entryIdx={entryIdx} close={close} />)
@@ -533,12 +566,12 @@ export const topWeightSheet = entryIdx => ui().openSheet(close => <TopWeight ent
// Shown when the last exercise's last set is checked — finish, or keep going.
function WorkoutComplete({ close }) {
return <div style={{ textAlign: 'center', padding: '8px 0' }}>
<div style={{ fontSize: '3rem' }}>🎉</div>
<div style={{ fontSize: 44, display: 'flex', justifyContent: 'center', color: 'var(--acc)' }}><Icon name="checkCircle" /></div>
<h3 style={{ margin: '8px 0' }}>{t("That's the whole workout!")}</h3>
<div className="muted small" style={{ marginBottom: 16 }}>{t('Every exercise done — great work. Finish up, or keep going and add another exercise.')}</div>
<button className="btn primary" onClick={() => { close(); finishWorkout() }}>{t('Finish workout 🏁')}</button>
<Button variant="primary" icon="flag" onClick={() => { close(); finishWorkout() }}>{t('Finish workout')}</Button>
<div style={{ height: 8 }} />
<button className="btn" onClick={() => { close(); useUI.getState().toast(t('Keep going 💪 — tap “+ Add exercise” below')) }}>{t('Continue workout')}</button>
<Button onClick={() => { close(); useUI.getState().toast(t('Keep going — tap “+ Add exercise” below')) }}>{t('Continue workout')}</Button>
</div>
}
export const workoutCompleteSheet = () => ui().openSheet(close => <WorkoutComplete close={close} />, { kind: 'center' })
@@ -546,16 +579,19 @@ export const workoutCompleteSheet = () => ui().openSheet(close => <WorkoutComple
function FinishSummary({ w, prs, close }) {
const st = useStore(s => s.S)
return <div style={{ textAlign: 'center', padding: '8px 0' }}>
<div style={{ fontSize: '3rem' }}>🎉</div>
<div style={{ fontSize: 44, display: 'flex', justifyContent: 'center', color: 'var(--acc)' }}><Icon name="trophy" /></div>
<h3 style={{ margin: '8px 0' }}>{t('Workout complete!')}</h3>
<div className="tiles" style={{ textAlign: 'left' }}>
<div className="tile"><div className="l">{t('Duration')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fmtDur(w.end - w.start)}</div></div>
<div className="tile"><div className="l">{t('Volume')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fmtVol(w.vol, st.unit)}</div></div>
<div className="tile"><div className="l">{t('Sets')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{setsDone(w)}</div></div>
<div className="tile"><div className="l">{t('PRs')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{prs.length ? '🏆 ' + prs.length : '—'}</div></div>
<div className="tile"><div className="l">{t('PRs')}</div><div className="v" style={{ fontSize: 20 }}>{prs.length || '—'}</div></div>
</div>
{prs.length > 0 && <div style={{ textAlign: 'left', marginBottom: 12 }}>{prs.map(id => <div key={id} className="small accent capitalize">🏆 {t('New PR:')} {(EXIDX[id] || {}).n || id}</div>)}</div>}
<button className="btn primary" onClick={() => { close(); nav('/home') }}>{t('Nice! 💪')}</button>
{prs.length > 0 && <div style={{ textAlign: 'left', marginBottom: 12 }}>{prs.map(id => <div key={id} className="small accent capitalize row" style={{ gap: 5 }}><Icon name="trophy" style={{ fontSize: 13 }} />{t('New PR:')} {(EXIDX[id] || {}).n || id}</div>)}</div>}
<h4 className="sec" style={{ textAlign: 'left' }}>{t('What you just trained')}</h4>
<BodyMap load={loadOfWorkouts([w])} body={st.body} />
<div style={{ height: 14 }} />
<Button variant="primary" onClick={() => { close(); nav('/home') }}>{t('Nice!')}</Button>
</div>
}
export function finishWorkout() {
+21 -2
View File
@@ -2,13 +2,14 @@ import { create } from 'zustand'
import { api } from '../lib/api.js'
import { localTZ } from '../lib/format.js'
import { registerCustom } from '../lib/exercises.js'
import { DEMO, DEMO_SEEDED } from '../lib/demo.js'
const KEY = 'gym_state_v1'
export const DEF = {
unit: 'kg', restSec: 90, sound: true, lang: 'en',
theme: 'dark', accent: 'lime', targetW: null,
theme: 'dark', accent: 'lime', body: 'male', targetW: null,
bodyweight: [], routines: [], week: {}, dayPlan: {},
exWeights: {}, workouts: [], active: null, customEx: [],
exWeights: {}, workouts: [], active: null, customEx: [], gifSize: 'full',
reminder: { on: false, time: '08:00', tz: null }
}
const clone = o => JSON.parse(JSON.stringify(o))
@@ -98,8 +99,26 @@ export const useStore = create((set, get) => {
persist(clone(DEF), false)
},
// Demo build only: drop the seeded example profile back in (Settings → "Reset demo data").
// Dynamic import so the generator never ships in a self-hosted bundle.
async resetDemo() {
const { buildDemoState } = await import('../lib/demoSeed.js')
localStorage.removeItem('gym_dirty')
persist(Object.assign(clone(DEF), buildDemoState()), false)
},
// Boot: ask the server who we are, then pull.
async boot() {
// Demo build (GitHub Pages): no backend at all — seed once, stay in guest mode.
if (DEMO) {
if (!localStorage.getItem(DEMO_SEEDED)) {
localStorage.setItem(DEMO_SEEDED, '1')
await get().resetDemo()
}
get().setGuest(true)
set({ ready: true })
return
}
try {
const me = await api('/api/me')
get().setUser(me.user)
+10 -10
View File
@@ -40,26 +40,26 @@ export const useUI = create((set, get) => ({
set({ timer: { left: sec, total: sec, endsAt } })
pushRestTimer(sec)
timerTick = () => {
const t = get().timer
if (!t) return
const left = Math.max(0, Math.round((t.endsAt - Date.now()) / 1000))
if (left === t.left) return
const tm = get().timer
if (!tm) return
const left = Math.max(0, Math.round((tm.endsAt - Date.now()) / 1000))
if (left === tm.left) return
const snd = useStore.getState().S.sound
if (left <= 0) {
beep(snd, 880, 0.15); beep(snd, 880, 0.15, 0.25); beep(snd, 1320, 0.4, 0.5)
vibrate([200, 100, 200]); get().toast(t('Rest over — next set! 💪')); get().stopRest(); return
vibrate([200, 100, 200]); get().toast(t('Rest over — next set!')); get().stopRest(); return
}
if (left <= 3) beep(snd, 660, 0.1)
set({ timer: { ...t, left } })
set({ timer: { ...tm, left } })
}
timerInt = setInterval(timerTick, 1000)
document.addEventListener('visibilitychange', timerTick)
},
addRest(sec) {
const t = get().timer
if (!t) return
const left = t.left + sec
set({ timer: { ...t, left, total: t.total + sec, endsAt: t.endsAt + sec * 1000 } })
const tm = get().timer
if (!tm) return
const left = tm.left + sec
set({ timer: { ...tm, left, total: tm.total + sec, endsAt: tm.endsAt + sec * 1000 } })
pushRestTimer(left)
},
stopRest() {
+147
View File
@@ -0,0 +1,147 @@
import { useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { useStore } from '../store/useStore.js'
import { useUI } from '../store/useUI.js'
import { api } from '../lib/api.js'
import { fmtDate, fmtNum, fmtVol, fmtDur } from '../lib/format.js'
import { workoutVolume, setsDone } from '../lib/history.js'
import { confirmSheet } from '../sheets.jsx'
import Icon from '../components/Icon.jsx'
import { Button } from '../components/ui.jsx'
// Admin-only operator dashboard (owner passkey + admin flag; guarded again server-side).
// Deliberately English-only — it isn't part of the translated end-user surface, so it stays
// out of the per-language string packs.
const rel = ts => {
if (!ts) return 'never'
const s = Math.max(0, (Date.now() - ts) / 1000)
if (s < 60) return 'just now'
if (s < 3600) return Math.floor(s / 60) + 'm ago'
if (s < 86400) return Math.floor(s / 3600) + 'h ago'
return Math.floor(s / 86400) + 'd ago'
}
const dur = ms => { const m = Math.max(0, Math.floor(ms / 60000)); return m < 60 ? m + 'm' : Math.floor(m / 60) + 'h' + (m % 60) + 'm' }
function UserDetail({ id, onChanged, close }) {
const [d, setD] = useState(null)
const toast = useUI(s => s.toast)
useEffect(() => { api('/api/admin/user?id=' + encodeURIComponent(id)).then(setD).catch(e => toast(e.message)) }, [id])
if (!d) return <div className="muted small">Loading…</div>
const u = d.user
const setDisabled = disabled => {
api('/api/admin/user/disable', { method: 'POST', body: JSON.stringify({ id: u.id, disabled }) })
.then(() => { toast(disabled ? 'User disabled' : 'User enabled'); onChanged(); close() })
.catch(e => toast(e.message))
}
return <>
<h3 className="capitalize">{u.name}</h3>
<div className="row" style={{ gap: 6, flexWrap: 'wrap', margin: '8px 0 12px' }}>
{u.admin && <span className="tag acc">admin</span>}
{u.disabled && <span className="tag" style={{ color: 'var(--red)' }}>disabled</span>}
{u.invitedBy && <span className="tag">invite {u.invitedBy}</span>}
<span className="tag">joined {u.created ? fmtDate(u.created.slice(0, 10)) : '—'}</span>
</div>
<div className="tiles" style={{ textAlign: 'left' }}>
<div className="tile"><div className="l">Workouts</div><div className="v" style={{ fontSize: '1.1rem' }}>{d.workouts.length}</div></div>
<div className="tile"><div className="l">Weigh-ins</div><div className="v" style={{ fontSize: '1.1rem' }}>{d.bodyweight.length}</div></div>
<div className="tile"><div className="l">Routines</div><div className="v" style={{ fontSize: '1.1rem' }}>{d.routines.length}</div></div>
<div className="tile"><div className="l">Last sync</div><div className="v" style={{ fontSize: '.95rem' }}>{rel(d.lastSync)}</div></div>
</div>
{!u.admin && <button className={'btn ' + (u.disabled ? 'primary' : 'danger')} style={{ margin: '12px 0 4px' }}
onClick={() => u.disabled ? setDisabled(false)
: confirmSheet({ title: 'Disable ' + u.name + '?', message: 'They are signed out everywhere and can no longer sync or log in until re-enabled.', confirmText: 'Disable', danger: true, onConfirm: () => setDisabled(true) })}>
{u.disabled ? 'Enable account' : 'Disable account'}</button>}
<h4 className="sec">Workout history</h4>
{d.workouts.length ? <div className="list" style={{ gap: 0 }}>
{d.workouts.slice(0, 60).map(w => <div key={w.id} className="row between" style={{ padding: '9px 2px', borderBottom: '1px solid var(--sep)' }}>
<div><div className="small" style={{ fontWeight: 600 }}>{w.name}</div>
<div className="dim" style={{ fontSize: '.72rem' }}>{fmtDate(w.d, true)} · {fmtDur((w.end || w.start) - w.start)} · {setsDone(w)} sets{w.prs?.length ? ' · ' + w.prs.length + ' PR' : ''}</div></div>
<span className="small muted">{fmtVol(w.vol ?? workoutVolume(w), d.unit)}</span>
</div>)}
</div> : <div className="empty small">No workouts logged.</div>}
</>
}
function InvitesCard({ invites, reload }) {
const toast = useUI(s => s.toast)
const gen = () => api('/api/admin/invites/new', { method: 'POST', body: '{}' })
.then(({ invite }) => { navigator.clipboard?.writeText(invite.code).catch(() => {}); toast('Code ' + invite.code + ' created & copied'); reload() })
.catch(e => toast(e.message))
const revoke = code => api('/api/admin/invites/revoke', { method: 'POST', body: JSON.stringify({ code }) })
.then(() => { toast('Code revoked'); reload() }).catch(e => toast(e.message))
const open = (invites || []).filter(i => !i.usedBy)
const used = (invites || []).filter(i => i.usedBy)
return <div className="card">
<div className="row between"><h2 style={{ margin: 0 }}>Invite codes</h2>
<Button variant="primary" size="sm" onClick={gen} icon="plus">Generate</Button></div>
<div className="small muted" style={{ margin: '6px 0 10px' }}>{open.length} unused · {used.length} redeemed</div>
{open.map(i => <div key={i.code} className="row between" style={{ padding: '7px 2px', borderBottom: '1px solid var(--sep)' }}>
<span style={{ fontFamily: 'ui-monospace,SFMono-Regular,Menlo,monospace', fontWeight: 500, letterSpacing: '.06em' }}
onClick={() => { navigator.clipboard?.writeText(i.code).catch(() => {}); toast('Copied ' + i.code) }}>{i.code}</span>
<button className="iconbtn" style={{ width: 32, height: 30, borderRadius: 8, fontSize: 15, color: 'var(--red)' }} onClick={() => revoke(i.code)} aria-label="revoke"><Icon name="trash" /></button>
</div>)}
{used.map(i => <div key={i.code} className="row between dim" style={{ padding: '7px 2px', fontSize: '.8rem' }}>
<span style={{ fontFamily: 'monospace' }}>{i.code}</span><span>→ {i.usedByName || 'used'}</span>
</div>)}
{!open.length && !used.length && <div className="dim small">No codes yet — generate one to invite someone.</div>}
</div>
}
export default function Admin() {
const nav = useNavigate()
const user = useStore(s => s.user)
const toast = useUI(s => s.toast)
const openSheet = useUI(s => s.openSheet)
const [users, setUsers] = useState(null)
const [invites, setInvites] = useState(null)
const [inviteOnly, setInviteOnly] = useState(false)
const loadUsers = () => api('/api/admin/users').then(d => { setUsers(d.users); setInviteOnly(d.invite_only) }).catch(e => toast(e.message || 'Failed to load'))
const loadInvites = () => api('/api/admin/invites').then(d => setInvites(d.invites)).catch(() => {})
// poll every 15s so the "training now" section stays live without a manual refresh
useEffect(() => { if (!user?.admin) return; loadUsers(); loadInvites(); const iv = setInterval(loadUsers, 15000); return () => clearInterval(iv) }, [])
if (!user?.admin) return null
const openUser = id => openSheet(close => <UserDetail id={id} onChanged={loadUsers} close={close} />)
const liveUsers = (users || []).filter(u => u.live)
const activeCount = (users || []).filter(u => u.lastSync && Date.now() - u.lastSync < 7 * 86400000).length
const disabledCount = (users || []).filter(u => u.disabled).length
return <div className="narrow">
<div className="hdr">
<button className="iconbtn" onClick={() => nav('/settings')} aria-label="Back"><Icon name="chevronLeft" /></button>
<div style={{ flex: 1, marginLeft: 8 }}><h1 style={{ margin: 0 }}>Admin</h1>
<div className="sub">{users ? users.length + ' users · ' + activeCount + ' active this week' : 'Loading…'}</div></div>
<button className="iconbtn" onClick={() => { loadUsers(); loadInvites() }} aria-label="refresh">↻</button>
</div>
<div className="tiles" style={{ marginBottom: 12 }}>
<div className="tile"><div className="l">Users</div><div className="v">{users ? users.length : '—'}</div></div>
<div className="tile"><div className="l">Training now</div><div className="v" style={{ color: liveUsers.length ? 'var(--acc)' : undefined }}>{users ? liveUsers.length : '—'}</div></div>
<div className="tile"><div className="l">Active 7d</div><div className="v">{users ? activeCount : '—'}</div></div>
<div className="tile"><div className="l">Disabled</div><div className="v">{users ? disabledCount : '—'}</div></div>
</div>
{liveUsers.length > 0 && <div className="card" style={{ borderColor: 'var(--acc)' }}>
<h2 className="row" style={{ margin: '0 0 8px', gap: 6 }}><Icon name="dot" style={{ fontSize: 10, color: 'var(--green)' }} />Training now</h2>
{liveUsers.map(u => <div key={u.id} className="row between" style={{ padding: '8px 2px', borderBottom: '1px solid var(--sep)' }} onClick={() => openUser(u.id)}>
<div><div className="small" style={{ fontWeight: 600 }}>{u.name}</div>
<div className="dim" style={{ fontSize: '.72rem' }}>{u.live.name} · ex {u.live.exIdx}/{u.live.exTotal} · {u.live.setsDone}/{u.live.setsTotal} sets</div></div>
<span className="tag acc">{dur(Date.now() - u.live.startedAt)}</span>
</div>)}
</div>}
<InvitesCard invites={invites} reload={loadInvites} />
<h4 className="sec">Users</h4>
<div className="list">
{(users || []).map(u => <div key={u.id} className="item" onClick={() => openUser(u.id)} style={u.disabled ? { opacity: .55 } : null}>
<div className="grow"><div className="tt">{u.live && <Icon name="dot" style={{ fontSize: 9, color: 'var(--green)', display: 'inline-block', marginRight: 5 }} />}{u.name} {u.admin && <span className="tag acc" style={{ marginLeft: 4 }}>admin</span>}{u.disabled && <span className="tag" style={{ marginLeft: 4, color: 'var(--red)' }}>off</span>}</div>
<div className="ss">{u.live ? 'training now · ' + u.live.name : u.workouts + ' workouts' + (u.lastWorkout ? ' · last ' + fmtDate(u.lastWorkout) : '') + ' · synced ' + rel(u.lastSync)}</div></div>
{u.hasPush && <Icon name="bell" title="push enabled" style={{ fontSize: 15, color: 'var(--label-3)' }} />}<Icon name="chevronRight" className="chev" />
</div>)}
{users && !users.length && <div className="empty">No users yet.</div>}
</div>
</div>
}
+3 -2
View File
@@ -2,14 +2,15 @@ import { useNavigate } from 'react-router-dom'
import { useStore } from '../store/useStore.js'
import { t } from '../lib/i18n.js'
import { WorkoutRow, workoutDetailSheet } from '../sheets.jsx'
import Icon from '../components/Icon.jsx'
export default function History() {
const nav = useNavigate()
const S = useStore(s => s.S)
return <>
<div className="hdr"><button className="iconbtn" onClick={() => nav('/stats')}>‹</button>
<div className="hdr"><button className="iconbtn" onClick={() => nav('/stats')} aria-label={t('Stats')}><Icon name="chevronLeft" /></button>
<div style={{ flex: 1, marginLeft: 12 }}><h1>{t('History')}</h1><div className="sub">{t('{0} workouts', S.workouts.length)}</div></div></div>
{S.workouts.length ? <div className="list">{[...S.workouts].reverse().map(w => <WorkoutRow key={w.id} w={w} onClick={() => workoutDetailSheet(w)} />)}</div>
: <div className="empty"><div className="ico">🗂</div>{t('No workouts yet.')}</div>}
: <div className="empty"><div className="ico"><Icon name="history" /></div>{t('No workouts yet.')}</div>}
</>
}
+39 -18
View File
@@ -6,6 +6,9 @@ import { fmtNum, fmtDate, todayISO, isoOf, weekKey, DAYS } from '../lib/format.j
import { t, dateLocale } from '../lib/i18n.js'
import { bwSheet, goalSheet, dayOverrideSheet, calendarSheet, startFlow, loadStarterPlan, bwDeltaColor } from '../sheets.jsx'
import LineChart from '../components/LineChart.jsx'
import Icon from '../components/Icon.jsx'
import { Button } from '../components/ui.jsx'
import { glyphOf } from '../lib/glyphs.js'
// Home = what to do now + a quick glance. Deep charts & history live in Stats.
export default function Home() {
@@ -44,37 +47,42 @@ export default function Home() {
return <div className="narrow">
<div className="hdr">
<div><h1>{user ? t('Hi {0} 💪', user.name) : 'openGym 🏋️'}</h1><div className="sub">{today.toLocaleDateString(dateLocale(), { weekday: 'long', day: 'numeric', month: 'long' })}</div></div>
<button className="iconbtn" onClick={() => nav('/settings')}>⚙️</button>
<div><h1>{user ? t('Hi {0}', user.name) : 'openGym'}</h1><div className="sub">{today.toLocaleDateString(dateLocale(), { weekday: 'long', day: 'numeric', month: 'long' })}</div></div>
<button className="iconbtn" onClick={() => nav('/settings')} aria-label={t('Settings')}><Icon name="gear" /></button>
</div>
<div className="card">
<div className="row between" style={{ marginBottom: 8 }}>
<button className="iconbtn" style={{ width: 32, height: 32 }} onClick={() => setWeekOffset(w => w - 1)}>‹</button>
<div className="small muted" style={{ fontWeight: 600 }}>{wkLabel}</div>
<button className="iconbtn" style={{ width: 32, height: 32 }} onClick={() => setWeekOffset(w => w + 1)}>›</button>
<button className="iconbtn" style={{ width: 30, height: 30, fontSize: 15 }} onClick={() => setWeekOffset(w => w - 1)} aria-label="Previous week"><Icon name="chevronLeft" /></button>
<div className="small muted" style={{ fontWeight: 500 }}>{wkLabel}</div>
<button className="iconbtn" style={{ width: 30, height: 30, fontSize: 15 }} onClick={() => setWeekOffset(w => w + 1)} aria-label="Next week"><Icon name="chevronRight" /></button>
</div>
<div className="week">{strip}</div>
<div className="today-row" onClick={onToday}>
<div className="row" style={{ gap: 9, minWidth: 0 }}>
<span style={{ fontSize: '1.35rem', flex: 'none' }}>{S.active ? '⏱️' : routine ? (routine.emoji || '💪') : '😌'}</span>
<span className="lrow-i" style={{ background: S.active ? 'var(--orange)' : routine ? 'var(--acc)' : 'var(--surface-3)' }}>
<Icon name={S.active ? 'timer' : routine ? glyphOf(routine.emoji) : 'moon'} />
</span>
<div style={{ minWidth: 0 }}>
<div className="lbl2">{t('Today')}</div>
<div className="ttl">{S.active ? t('{0} — in progress', S.active.name) : routine ? routine.name : t('Rest day')}{todayOvr && routine ? ' · ' + t('rescheduled') : ''}</div>
</div>
</div>
{S.active ? <span className="tag" style={{ color: 'var(--orange)', borderColor: 'var(--orange)' }}>{t('Resume ▶')}</span>
: routine ? <span className="tag acc">{t('Start ▶')}</span>
: <span className="chev">+</span>}
{S.active ? <span className="tag" style={{ color: 'var(--orange)', background: 'color-mix(in srgb,var(--orange) 16%,transparent)' }}>{t('Resume')}</span>
: routine ? <span className="tag acc">{t('Start')}</span>
: <Icon name="plus" className="chev" />}
</div>
</div>
{!S.routines.length && !S.active && (
<div className="card">
<div className="big" style={{ marginBottom: 4 }}>{t('Welcome! 👋')}</div>
<div className="row" style={{ gap: 10, marginBottom: 6 }}>
<span className="lrow-i"><Icon name="sparkles" /></span>
<div className="big" style={{ fontSize: 22 }}>{t('Welcome!')}</div>
</div>
<div className="muted small" style={{ marginBottom: 12 }}>{t('Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.')}</div>
<button className="btn primary" onClick={loadStarterPlan}>{t('Load starter plan (PPL)')}</button>
<div style={{ height: 8 }} /><button className="btn" onClick={() => nav('/plan')}>{t('Build my own plan')}</button>
<Button variant="primary" icon="sparkles" onClick={loadStarterPlan}>{t('Load starter plan (PPL)')}</Button>
<div style={{ height: 8 }} /><Button onClick={() => nav('/plan')}>{t('Build my own plan')}</Button>
</div>
)}
@@ -82,17 +90,27 @@ export default function Home() {
<div className="row between" style={{ marginBottom: 6 }}>
<h2 style={{ margin: 0 }}>{t('Body weight')}</h2>
<div className="row" style={{ gap: 8 }}>
<button className="btn sm" style={S.targetW ? { color: 'var(--gold)' } : undefined} onClick={goalSheet}>🎯 {S.targetW ? fmtNum(S.targetW) : t('Goal')}</button>
<button className="btn sm" onClick={() => bwSheet()}>+ {t('Log')}</button>
<Button size="sm" icon="target" style={S.targetW ? { color: 'var(--yellow)' } : undefined} onClick={goalSheet}>{S.targetW ? fmtNum(S.targetW) : t('Goal')}</Button>
<Button size="sm" icon="plus" onClick={() => bwSheet()}>{t('Log')}</Button>
</div>
</div>
{bw ? <>
<div className="row" style={{ gap: 8, alignItems: 'baseline' }}>
<div className="big">{fmtNum(bw.w)} <span className="muted" style={{ fontSize: '1rem' }}>{S.unit}</span></div>
{delta !== null && <span className="small" style={{ fontWeight: 700, color: bwDeltaColor(delta, bw.w) }}>{delta > 0 ? '▲' : delta < 0 ? '▼' : '•'} {fmtNum(Math.abs(delta))}</span>}
{delta !== null && (
<span className="small row" style={{ gap: 2, fontWeight: 500, color: bwDeltaColor(delta, bw.w) }}>
<Icon name={delta > 0 ? 'arrowUp' : delta < 0 ? 'arrowDown' : 'minus'} style={{ fontSize: 12 }} />
{fmtNum(Math.abs(delta))}
</span>
)}
<span className="dim small" style={{ marginLeft: 'auto' }}>{fmtDate(bw.d, true)}</span>
</div>
{S.targetW && <div className="small" style={{ color: 'var(--gold)', marginTop: 2 }}>🎯 {t('Goal')} {fmtNum(S.targetW)} {S.unit} · {Math.abs(S.targetW - bw.w) < 0.05 ? t('reached! 🎉') : t(S.targetW > bw.w ? '{0} to gain' : '{0} to lose', fmtNum(Math.abs(S.targetW - bw.w)) + ' ' + S.unit)}</div>}
{S.targetW && (
<div className="small row" style={{ color: 'var(--yellow)', marginTop: 4, gap: 5 }}>
<Icon name="target" style={{ fontSize: 13 }} />
<span>{t('Goal')} {fmtNum(S.targetW)} {S.unit} · {Math.abs(S.targetW - bw.w) < 0.05 ? t('reached!') : t(S.targetW > bw.w ? '{0} to gain' : '{0} to lose', fmtNum(Math.abs(S.targetW - bw.w)) + ' ' + S.unit)}</span>
</div>
)}
<div className="chart" style={{ marginTop: 8 }}><LineChart points={bwPoints} h={130} unit={S.unit} goal={S.targetW} /></div>
</> : <div className="muted small">{t("No entries yet — log your weight to start the curve. It's also asked before every workout.")}</div>}
</div>
@@ -100,10 +118,13 @@ export default function Home() {
<div className="card tappable" style={{ cursor: 'pointer' }} onClick={() => calendarSheet()}>
<div className="row between">
<div>
<div style={{ fontSize: '1.35rem', fontWeight: 800 }}>🔥 {t('{0} week streak', streakWeeks(S))}</div>
<div className="row" style={{ gap: 7, fontSize: 22, fontWeight: 600, letterSpacing: '-.021em' }}>
<Icon name="flame" style={{ color: 'var(--orange)' }} />
{t('{0} week streak', streakWeeks(S))}
</div>
<div className="muted small" style={{ marginTop: 2 }}>{wThisWeek}{plannedPerWeek ? ' / ' + plannedPerWeek : ''} {t('this week')} · {t(S.workouts.length === 1 ? '{0} workout total' : '{0} workouts total', S.workouts.length)}</div>
</div>
<span className="chev" style={{ fontSize: '1.4rem' }}>📅</span>
<Icon name="calendar" className="chev" style={{ fontSize: 20 }} />
</div>
</div>
</div>
+22 -11
View File
@@ -1,44 +1,55 @@
import { useState } from 'react'
import { useStore } from '../store/useStore.js'
import { EXDB, BODYPARTS, allExercises } from '../lib/exercises.js'
import { EXDB, BODYPARTS, allExercises, equipmentOf } from '../lib/exercises.js'
import { bestWeightFor } from '../lib/history.js'
import { fmtNum } from '../lib/format.js'
import { t } from '../lib/i18n.js'
import { Thumb } from '../components/Media.jsx'
import { exerciseDetailSheet, addToRoutineSheet, customExSheet } from '../sheets.jsx'
import Icon from '../components/Icon.jsx'
import { Button } from '../components/ui.jsx'
export default function Library() {
const S = useStore(s => s.S)
const [q, setQ] = useState('')
const [bp, setBp] = useState('')
const [eq, setEq] = useState('')
const [shown, setShown] = useState(40)
const ql = q.toLowerCase().trim()
const f = allExercises(S).filter(e => (!bp || e.bp === bp) && (!ql || e.n.toLowerCase().includes(ql) || e.tg.includes(ql) || e.eq.includes(ql) || (e.desc || '').toLowerCase().includes(ql)))
const base = allExercises(S).filter(e => (!bp || e.bp === bp) && (!ql || e.n.toLowerCase().includes(ql) || e.tg.includes(ql) || e.eq.includes(ql) || (e.desc || '').toLowerCase().includes(ql)))
const eqOpts = equipmentOf(base)
// Drop the equipment filter if the search narrowed it away, so you never hit a dead end.
const eqOn = eqOpts.includes(eq) ? eq : ''
const f = eqOn ? base.filter(e => e.eq === eqOn) : base
return <>
<div className="hdr"><div><h1>{t('Exercises')}</h1><div className="sub">{t('{0} exercises with animations', EXDB.length)}</div></div></div>
<div className="search" style={{ marginBottom: 10 }}><svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="7" /><path d="m21 21-4.3-4.3" /></svg>
<input className="input" placeholder={t('Search…')} value={q} onChange={e => { setQ(e.target.value); setShown(40) }} /></div>
<div className="chips" style={{ marginBottom: 12 }}>
<button className={'chip' + (!bp ? ' on' : '')} onClick={() => { setBp(''); setShown(40) }}>{t('All')}</button>
{BODYPARTS.map(b => <button key={b} className={'chip' + (bp === b ? ' on' : '')} onClick={() => { setBp(b); setShown(40) }}>{t(b)}</button>)}
<div className="chips" style={{ marginBottom: eqOpts.length > 1 ? 8 : 12 }}>
<button className={'chip nocap' + (!bp ? ' on' : '')} onClick={() => { setBp(''); setEq(''); setShown(40) }}>{t('All')}</button>
{BODYPARTS.map(b => <button key={b} className={'chip' + (bp === b ? ' on' : '')} onClick={() => { setBp(b); setEq(''); setShown(40) }}>{t(b)}</button>)}
</div>
{eqOpts.length > 1 && <div className="chips" style={{ marginBottom: 12 }}>
<button className={'chip nocap' + (!eqOn ? ' on' : '')} onClick={() => { setEq(''); setShown(40) }}>{t('Any equipment')}</button>
{eqOpts.map(x => <button key={x} className={'chip' + (eqOn === x ? ' on' : '')} onClick={() => { setEq(x); setShown(40) }}>{t(x)}</button>)}
</div>}
<div className="list">
<div className="item" onClick={() => customExSheet(null, ex => exerciseDetailSheet(ex), q.trim())}>
<div className="thumb thumb-x">✨</div>
<div className="grow"><div className="tt">{t('Create your own exercise')}</div><div className="ss">{t('name + body part, no animation')}</div></div><span className="chev">+</span>
<div className="thumb thumb-x"><Icon name="sparkles" /></div>
<div className="grow"><div className="tt">{t('Create your own exercise')}</div><div className="ss">{t('name + body part, no animation')}</div></div><Icon name="plus" className="chev" />
</div>
{f.slice(0, shown).map(e => {
const best = bestWeightFor(S, e.id)
return <div key={e.id} className="item" onClick={() => exerciseDetailSheet(e)}>
<Thumb ex={e} />
<div className="grow"><div className="tt">{e.n}</div><div className="ss">{t(e.tg || e.bp)} · {t(e.eq)}</div></div>
<div className="grow"><div className="tt capitalize">{e.n}</div><div className="ss capitalize">{t(e.tg || e.bp)} · {t(e.eq)}</div></div>
{best > 0 && <span className="tag acc">{fmtNum(best)}</span>}
<button className="btn sm primary" onClick={ev => { ev.stopPropagation(); addToRoutineSheet(e) }}>+ {t('Plan')}</button>
<Button size="sm" variant="tinted" icon="plus" onClick={ev => { ev.stopPropagation(); addToRoutineSheet(e) }}>{t('Plan')}</Button>
</div>
})}
{f.length === 0 && <div className="empty">{t('No match 🤷')}</div>}
{f.length === 0 && <div className="empty"><div className="ico"><Icon name="magnifier" /></div>{t('No match')}</div>}
</div>
{f.length > shown && <><div style={{ height: 10 }} /><button className="btn" onClick={() => setShown(s => s + 40)}>{t('Show more')}</button></>}
{f.length > shown && <><div style={{ height: 10 }} /><Button onClick={() => setShown(s => s + 40)}>{t('Show more')}</Button></>}
</>
}
+46 -13
View File
@@ -1,52 +1,85 @@
import { useStore } from '../store/useStore.js'
import { useUI } from '../store/useUI.js'
import { webauthnOK, passkeyLogin, passkeyRegister, BIO } from '../lib/api.js'
import { webauthnOK, passkeyLogin, passkeyRegister, api, BIO } from '../lib/api.js'
import { hasData } from '../store/useStore.js'
import { t } from '../lib/i18n.js'
import { DEMO, REPO } from '../lib/demo.js'
import { useState, useRef, useEffect } from 'react'
import Icon from '../components/Icon.jsx'
import { Button } from '../components/ui.jsx'
function RegisterSheet({ close }) {
const { setUser, pushState, pullState } = useStore()
const [name, setName] = useState('')
const [code, setCode] = useState('')
const [inviteOnly, setInviteOnly] = useState(false)
const ref = useRef(null)
useEffect(() => { setTimeout(() => ref.current?.focus(), 250) }, [])
useEffect(() => { api('/api/config').then(c => setInviteOnly(!!c.invite_only)).catch(() => {}) }, [])
const go = async () => {
const n = name.trim()
if (!n) { useUI.getState().toast(t('Enter a name')); return }
if (inviteOnly && !code.trim()) { useUI.getState().toast(t('An invite code is required')); return }
try {
const u = await passkeyRegister(n)
const u = await passkeyRegister(n, code.trim())
setUser(u); close()
if (hasData(useStore.getState().S)) { await pushState(); useUI.getState().toast(t('Profile created — data from this device moved into it ✓')) }
else { await pullState(); useUI.getState().toast(t('Welcome, {0} 💪', u.name)) }
if (hasData(useStore.getState().S)) { await pushState(); useUI.getState().toast(t('Profile created — data from this device moved into it')) }
else { await pullState(); useUI.getState().toast(t('Welcome, {0}', u.name)) }
} catch (e) { if (e.name !== 'NotAllowedError' && e.name !== 'AbortError') useUI.getState().toast(e.message || t('Registration failed')) }
}
return <>
<h3>{t('Create your profile ✨')}</h3>
<h3>{t('Create your profile')}</h3>
<div className="muted small" style={{ marginBottom: 14 }}>{t('Pick a name, then confirm with {0}. The passkey is saved in your device — no password needed.', BIO)}</div>
<input ref={ref} className="input" placeholder={t('Your name')} maxLength={40} value={name} onChange={e => setName(e.target.value)} />
{inviteOnly && <>
<div style={{ height: 10 }} />
<input className="input" placeholder={t('Invite code')} maxLength={40} value={code}
onChange={e => setCode(e.target.value.toUpperCase())} style={{ letterSpacing: '.14em', fontWeight: 600, textAlign: 'center' }} />
<div className="dim small" style={{ marginTop: 6 }}>{t('This app is invite-only — enter the code you were given.')}</div>
</>}
<div style={{ height: 12 }} />
<button className="btn primary" onClick={go}>{t('Create passkey')}</button>
<Button variant="primary" onClick={go}>{t('Create passkey')}</Button>
</>
}
export default function Login() {
const { setUser, pullState, setGuest } = useStore()
const signIn = async () => {
try { const u = await passkeyLogin(); setUser(u); await pullState(); useUI.getState().toast(t('Welcome back, {0} 💪', u.name)) }
try { const u = await passkeyLogin(); setUser(u); await pullState(); useUI.getState().toast(t('Welcome back, {0}', u.name)) }
catch (e) { if (e.name !== 'NotAllowedError' && e.name !== 'AbortError') useUI.getState().toast(e.message || t('Sign-in failed')) }
}
const head = <>
<div style={{ fontSize: 54, display: 'flex', justifyContent: 'center', color: 'var(--acc)' }}><Icon name="dumbbell" /></div>
<h1 style={{ fontSize: 34, fontWeight: 700, letterSpacing: '-.028em', margin: '10px 0 4px' }}>openGym</h1>
</>
const wrap = { display: 'flex', flexDirection: 'column', justifyContent: 'center', minHeight: '78vh', textAlign: 'center' }
// Demo build: no backend to sign in against — the only way in is the local guest profile.
if (DEMO) return (
<div className="narrow" style={wrap}>
{head}
<div className="muted" style={{ marginBottom: 30 }}>{t('Live demo — everything stays in this browser.')}</div>
<Button variant="primary" icon="sparkles" onClick={() => setGuest(true)}>{t('Start the demo')}</Button>
<div className="card small muted" style={{ textAlign: 'left', marginTop: 16 }}>
{t('This demo runs entirely in your browser on example data — nothing is sent anywhere. Passkey sign-in and sync across your devices come with the openGym server, which you get by self-hosting it.')}
</div>
<div className="dim small" style={{ marginTop: 22, lineHeight: 1.6 }}>
<a href={REPO} target="_blank" rel="noopener">{t('Self-host it in a minute →')}</a>
</div>
</div>
)
return (
<div className="narrow" style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', minHeight: '78vh', textAlign: 'center' }}>
<div style={{ fontSize: '4rem' }}>🏋️</div>
<h1 style={{ fontSize: '2.2rem', fontWeight: 800, letterSpacing: '-.02em', margin: '8px 0 4px' }}>openGym</h1>
<div className="narrow" style={wrap}>
{head}
<div className="muted" style={{ marginBottom: 34 }}>{t('Your workouts. Your weights. Your profile.')}</div>
{webauthnOK() ? <>
<button className="btn primary" onClick={signIn}>👤 {t('Sign in with passkey')}</button>
<Button variant="primary" icon="person" onClick={signIn}>{t('Sign in with passkey')}</Button>
<div style={{ height: 10 }} />
<button className="btn" onClick={() => useUI.getState().openSheet(close => <RegisterSheet close={close} />)}>✨ {t('Create new profile')}</button>
<Button icon="sparkles" onClick={() => useUI.getState().openSheet(close => <RegisterSheet close={close} />)}>{t('Create new profile')}</Button>
<div style={{ height: 10 }} />
</> : <div className="card small muted" style={{ textAlign: 'left' }}>{t("This browser doesn't support passkeys — you can still use openGym locally on this device.")}</div>}
<button className="btn ghost dim" onClick={() => setGuest(true)}>{t('Continue without account')}</button>
<Button variant="ghost" className="dim" onClick={() => setGuest(true)}>{t('Continue without account')}</Button>
<div className="dim small" style={{ marginTop: 26, lineHeight: 1.5 }}>{t('Passkeys use {0} — no passwords.', BIO)}<br />{t('Each profile keeps its own plan, workouts & body weight.')}</div>
</div>
)
+11 -8
View File
@@ -3,6 +3,9 @@ import { useStore } from '../store/useStore.js'
import { DAYN, uid } from '../lib/format.js'
import { t } from '../lib/i18n.js'
import { dayAssignSheet, loadStarterPlan } from '../sheets.jsx'
import Icon from '../components/Icon.jsx'
import { Button } from '../components/ui.jsx'
import { glyphOf, DEFAULT_GLYPH } from '../lib/glyphs.js'
export default function Plan() {
const nav = useNavigate()
@@ -10,7 +13,7 @@ export default function Plan() {
const update = useStore(s => s.update)
const addRoutine = () => {
const r = { id: uid(), name: t('New routine'), emoji: '💪', ex: [] }
const r = { id: uid(), name: t('New routine'), emoji: DEFAULT_GLYPH, ex: [] }
update(s => { s.routines.push(r) })
nav('/plan/r/' + r.id)
}
@@ -24,21 +27,21 @@ export default function Plan() {
const r = S.routines.find(x => x.id === S.week[d])
return <div key={d} className="item" onClick={() => dayAssignSheet(d)}>
<div className="grow"><div className="tt">{t(DAYN[d])}</div></div>
{r ? <span className="tag acc">{(r.emoji || '') + ' ' + r.name}</span> : <span className="tag">{t('Rest')}</span>}
<span className="chev">›</span></div>
{r ? <span className="tag acc"><Icon name={glyphOf(r.emoji)} />{r.name}</span> : <span className="tag">{t('Rest')}</span>}
<Icon name="chevronRight" className="chev" /></div>
})}
</div>
</div><div>
<div className="row between" style={{ marginTop: 22, marginBottom: 10 }}>
<h4 className="sec" style={{ margin: 0 }}>{t('Routines')}</h4>
<button className="btn sm primary" onClick={addRoutine}>+ {t('New')}</button>
<Button size="sm" variant="tinted" icon="plus" onClick={addRoutine}>{t('New')}</Button>
</div>
{S.routines.length ? <div className="list">{S.routines.map(r => <div key={r.id} className="item" onClick={() => nav('/plan/r/' + r.id)}>
<div style={{ fontSize: '1.5rem', flex: 'none' }}>{r.emoji || '💪'}</div>
<span className="lrow-i"><Icon name={glyphOf(r.emoji)} /></span>
<div className="grow"><div className="tt">{r.name}</div><div className="ss">{t('{0} exercises', r.ex.length)}</div></div>
<span className="chev">›</span></div>)}</div> : <>
<div className="empty"><div className="ico">📋</div>{t('No routines yet.')}<br />{t('Create one or load the starter plan.')}</div>
<button className="btn" onClick={loadStarterPlan}>{t('Load starter plan (Push / Pull / Legs)')}</button>
<Icon name="chevronRight" className="chev" /></div>)}</div> : <>
<div className="empty"><div className="ico"><Icon name="clipboard" /></div>{t('No routines yet.')}<br />{t('Create one or load the starter plan.')}</div>
<Button icon="sparkles" onClick={loadStarterPlan}>{t('Load starter plan (Push / Pull / Legs)')}</Button>
</>}
</div></div>
</>
+33 -14
View File
@@ -6,7 +6,12 @@ import { fmtNum, uid } from '../lib/format.js'
import { t } from '../lib/i18n.js'
import { supersetUnits, cleanupSg } from '../lib/history.js'
import { Thumb } from '../components/Media.jsx'
import { emojiPicker, exercisePicker, exConfigSheet, confirmSheet } from '../sheets.jsx'
import { glyphPicker, exercisePicker, exConfigSheet, confirmSheet } from '../sheets.jsx'
import Icon from '../components/Icon.jsx'
import { glyphOf } from '../lib/glyphs.js'
import { Button } from '../components/ui.jsx'
import BodyMap from '../components/BodyMap.jsx'
import { loadOfRoutine, rankOf, MUSCLE_NAME } from '../lib/muscles.js'
export default function RoutineEdit() {
const nav = useNavigate()
@@ -33,39 +38,53 @@ export default function RoutineEdit() {
return <div className="narrow">
<div className="hdr">
<button className="iconbtn" onClick={() => nav('/plan')}>‹</button>
<button className="iconbtn" onClick={() => nav('/plan')} aria-label={t('Plan')}><Icon name="chevronLeft" /></button>
<div style={{ flex: 1, margin: '0 12px' }}>
<input className="input" defaultValue={r.name} style={{ fontWeight: 800, fontSize: '1.1rem' }}
<input className="input" defaultValue={r.name} style={{ fontWeight: 600, fontSize: 20, letterSpacing: '-.021em' }}
onChange={e => update(s => { s.routines.find(x => x.id === id).name = e.target.value.trim() || t('Routine') })} />
</div>
<button className="iconbtn" onClick={() => emojiPicker(r.emoji, emo => update(s => { s.routines.find(x => x.id === id).emoji = emo }))}>{r.emoji || '💪'}</button>
<button className="iconbtn" aria-label={t('Pick an icon')} onClick={() => glyphPicker(r.emoji, g => update(s => { s.routines.find(x => x.id === id).emoji = g }))}><Icon name={glyphOf(r.emoji)} /></button>
</div>
{r.ex.length ? <div className="list">{r.ex.map((e, i) => {
const ex = EXIDX[e.id]; if (!ex) return null
const linkedPrev = i > 0 && e.sg && r.ex[i - 1].sg === e.sg
return <div key={i}>
{unitFirst.has(i) && <div className="ss-label">🔗 {t('Superset')}</div>}
{unitFirst.has(i) && <div className="ss-label"><Icon name="link" />{t('Superset')}</div>}
<div className={'item' + (inSS.has(i) ? ' in-ss' : '')} onClick={() => {
exConfigSheet(ex, e, cfg => edit(x => { Object.assign(x[i], cfg) }), () => edit(x => { x.splice(i, 1); cleanupSg(x) }))
}}>
<Thumb ex={ex} />
<div className="grow"><div className="tt">{ex.n}</div><div className="ss">{isCardio(e.id) ? `${e.sets} × ${e.min || 20} min @ ${fmtNum(e.speed || 8)} km/h` : `${e.sets} × ${e.reps}${e.weight ? ' · ' + fmtNum(e.weight) + ' ' + S.unit : ''}`}</div></div>
<div className="grow"><div className="tt capitalize">{ex.n}</div><div className="ss">{isCardio(e.id) ? `${e.sets} × ${e.min || 20} min @ ${fmtNum(e.speed || 8)} km/h` : `${e.sets} × ${e.reps}${e.weight ? ' · ' + fmtNum(e.weight) + ' ' + S.unit : ''}`}</div></div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 'none', alignItems: 'center' }}>
{i > 0 && <button className={'iconbtn' + (linkedPrev ? ' on-ss' : '')} title={t('Superset with exercise above')} style={{ width: 34, height: 28, fontSize: '.85rem' }} onClick={ev => { ev.stopPropagation(); toggleLink(i) }}>🔗</button>}
{i > 0 && <button className={'iconbtn' + (linkedPrev ? ' on-ss' : '')} title={t('Superset with exercise above')} style={{ width: 32, height: 28, borderRadius: 8, fontSize: 15 }} onClick={ev => { ev.stopPropagation(); toggleLink(i) }}><Icon name="link" /></button>}
<div style={{ display: 'flex', gap: 2 }}>
<button className="iconbtn" style={{ width: 28, height: 26, fontSize: '.7rem' }} onClick={ev => { ev.stopPropagation(); move(i, -1) }}>▲</button>
<button className="iconbtn" style={{ width: 28, height: 26, fontSize: '.7rem' }} onClick={ev => { ev.stopPropagation(); move(i, 1) }}>▼</button>
<button className="iconbtn" aria-label="Move up" style={{ width: 28, height: 24, borderRadius: 7, fontSize: 12 }} onClick={ev => { ev.stopPropagation(); move(i, -1) }}><Icon name="chevronUp" /></button>
<button className="iconbtn" aria-label="Move down" style={{ width: 28, height: 24, borderRadius: 7, fontSize: 12 }} onClick={ev => { ev.stopPropagation(); move(i, 1) }}><Icon name="chevronDown" /></button>
</div>
</div>
</div>
</div>
})}</div> : <div className="empty"><div className="ico">🏋️</div>{t('No exercises yet — add your first one.')}</div>}
})}</div> : <div className="empty"><div className="ico"><Icon name="dumbbell" /></div>{t('No exercises yet — add your first one.')}</div>}
<div className="small dim" style={{ margin: '10px 2px' }}>{t('Tip: tap 🔗 on an exercise to superset it with the one above — you’ll do them back-to-back.')}</div>
<button className="btn primary" onClick={() => exercisePicker(ex => exConfigSheet(ex, null, cfg => edit(x => { x.push({ id: ex.id, ...cfg }) })))}>+ {t('Add exercise')}</button>
{/* Coverage of the routine as planned, so a gap shows up while you're building it
rather than after a month of training around it. */}
{r.ex.length > 0 && (() => {
const load = loadOfRoutine(r)
const { worked } = rankOf(load)
return <div className="card" style={{ marginTop: 12 }}>
<h2>{t('What this session hits')}</h2>
<BodyMap load={load} body={S.body} />
<div className="mchips">
{worked.slice(0, 6).map(m => <span key={m} className="mchip">{t(MUSCLE_NAME[m])}</span>)}
</div>
</div>
})()}
<div className="small dim row" style={{ margin: '10px 2px', gap: 5 }}><Icon name="link" style={{ fontSize: 13 }} />{t('Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.')}</div>
<Button variant="primary" onClick={() => exercisePicker(ex => exConfigSheet(ex, null, cfg => edit(x => { x.push({ id: ex.id, ...cfg }) })))} icon="plus">{t('Add exercise')}</Button>
<div style={{ height: 10 }} />
<button className="btn danger" onClick={() => confirmSheet({
<Button variant="danger" onClick={() => confirmSheet({
title: t('Delete routine?'), message: t('“{0}” and its exercises will be removed.', r.name), confirmText: t('Delete'), danger: true,
onConfirm: () => {
update(s => {
@@ -75,6 +94,6 @@ export default function RoutineEdit() {
})
nav('/plan')
}
})}>{t('Delete routine')}</button>
})}>{t('Delete routine')}</Button>
</div>
}
+133 -92
View File
@@ -6,20 +6,23 @@ import { ACCENTS, todayISO, localTZ } from '../lib/format.js'
import { webauthnOK, passkeyLogin, passkeyRegister, IS_ANDROID } from '../lib/api.js'
import { pushSupported, enablePush, disablePush, sendTestPush } from '../lib/push.js'
import { t, LANGS, INSTR_LANGS } from '../lib/i18n.js'
import { DEMO, REPO } from '../lib/demo.js'
import { loadStarterPlan, confirmSheet } from '../sheets.jsx'
import Icon from '../components/Icon.jsx'
import { Section, Row, SelectRow, Switch, Segmented, Button, TextField } from '../components/ui.jsx'
export default function Settings() {
const nav = useNavigate()
const S = useStore(s => s.S)
const user = useStore(s => s.user)
const { update, replaceState, setUser, pullState, pushState, signOut } = useStore()
const { update, replaceState, setUser, pullState, pushState, signOut, resetDemo } = useStore()
const toast = useUI(s => s.toast)
const fileRef = useRef(null)
const doExport = () => {
const blob = new Blob([JSON.stringify(S, null, 2)], { type: 'application/json' })
const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = 'opengym-backup-' + todayISO() + '.json'; a.click(); URL.revokeObjectURL(a.href)
toast(t('Backup exported ✓'))
toast(t('Backup exported'))
}
const doImport = ev => {
const f = ev.target.files[0]; if (!f) return
@@ -28,83 +31,115 @@ export default function Settings() {
try {
const data = JSON.parse(rd.result)
if (!data.workouts || !data.routines) throw new Error('not an openGym backup')
confirmSheet({ title: t('Import backup?'), message: t('This replaces all current data with the backup file.'), confirmText: t('Import'), danger: true, onConfirm: () => { replaceState(Object.assign(JSON.parse(JSON.stringify(DEF)), data), true); toast(t('Backup imported ✓')) } })
confirmSheet({ title: t('Import backup?'), message: t('This replaces all current data with the backup file.'), confirmText: t('Import'), danger: true, onConfirm: () => { replaceState(Object.assign(JSON.parse(JSON.stringify(DEF)), data), true); toast(t('Backup imported')) } })
} catch (e) { toast(t('Import failed: {0}', e.message)) }
}
rd.readAsText(f)
}
const signInHere = async () => {
try { const u = await passkeyLogin(); setUser(u); await pullState(); toast(t('Welcome back, {0} 💪', u.name)) }
try { const u = await passkeyLogin(); setUser(u); await pullState(); toast(t('Welcome back, {0}', u.name)) }
catch (e) { if (e.name !== 'NotAllowedError' && e.name !== 'AbortError') toast(e.message || t('Sign-in failed')) }
}
const registerHere = () => useUI.getState().openSheet(close => <RegisterInline close={close} setUser={setUser} pushState={pushState} pullState={pullState} toast={toast} />)
return <div className="narrow">
<div className="hdr"><button className="iconbtn" onClick={() => nav('/home')}>‹</button><div style={{ flex: 1, marginLeft: 12 }}><h1>{t('Settings')}</h1></div></div>
<div className="card">
<h2>{t('Account')}</h2>
{user ? <div className="row between">
<div><b>{user.name}</b><div className="small muted">{t('Signed in with passkey — data syncs to this profile.')}</div></div>
<button className="btn sm danger" onClick={() => confirmSheet({ title: t('Sign out?'), message: t('Your data is synced to your profile first, then cleared from this device.'), confirmText: t('Sign out'), danger: true, onConfirm: () => { signOut(); nav('/home') } })}>{t('Sign out')}</button>
</div> : <>
<div className="small muted" style={{ marginBottom: 10 }}>{t('Guest mode — data lives only in this browser. Create a passkey profile to keep it safe and separate per person.')}</div>
{webauthnOK() ? <>
<button className="btn primary" onClick={registerHere}>✨ {t('Create passkey profile')}</button>
<div style={{ height: 8 }} /><button className="btn" onClick={signInHere}>👤 {t('Sign in with passkey')}</button>
</> : <div className="small dim">{t('Passkeys not supported in this browser.')}</div>}
</>}
<div className="hdr">
<button className="iconbtn" onClick={() => nav('/home')} aria-label={t('Home')}><Icon name="chevronLeft" /></button>
<div style={{ flex: 1, marginLeft: 10 }}><h1>{t('Settings')}</h1></div>
</div>
<div className="card">
<h2>{t('Appearance')} <span className="dim" style={{ textTransform: 'none', letterSpacing: 0 }}>· {t('synced with your profile')}</span></h2>
<div className="row between" style={{ padding: '8px 0' }}>
<span>{t('Language')}</span>
<select className="input" style={{ width: 150 }} value={S.lang || 'en'} onChange={e => update(s => { s.lang = e.target.value })}>
{Object.entries(LANGS).map(([k, name]) => <option key={k} value={k}>{name}</option>)}
</select>
</div>
{!INSTR_LANGS.includes(S.lang || 'en') && <div className="small dim" style={{ marginBottom: 6 }}>{t("Exercise instructions aren't available in this language yet — they stay in English.")}</div>}
<div className="row between" style={{ padding: '8px 0' }}>
<span>{t('Theme')}</span>
<div className="chips">
<button className={'chip' + (S.theme !== 'light' ? ' on' : '')} onClick={() => update(s => { s.theme = 'dark' })}>🌙 {t('Dark')}</button>
<button className={'chip' + (S.theme === 'light' ? ' on' : '')} onClick={() => update(s => { s.theme = 'light' })}>☀️ {t('Light')}</button>
{/* ---------- account (demo builds have nothing to sign in to) ---------- */}
<Section title={DEMO ? t('Demo') : t('Account')}>
{DEMO ? <>
<Row icon="sparkles" iconTint="var(--acc)" title={t('You’re in the demo')} subtitle={t('Example data, stored only in this browser — change anything you like.')} />
<Row icon="reset" iconTint="var(--blue)" title={t('Reset demo data')} accessory="chevron"
onClick={() => confirmSheet({ title: t('Reset demo data?'), message: t('Puts the example plan, workouts and weigh-ins back the way they started.'), confirmText: t('Reset'), onConfirm: () => { resetDemo(); nav('/home'); toast(t('Demo data reset')) } })} />
<Row icon="rocket" iconTint="var(--indigo)" title={t('Self-host openGym')} subtitle={t('Passkey sign-in, sync across your devices, your own data.')} accessory="chevron"
onClick={() => window.open(REPO, '_blank', 'noopener')} />
</> : user ? <>
<Row icon="personCircle" iconTint="var(--grey)" title={user.name} subtitle={t('Signed in with passkey — data syncs to this profile.')} />
{user.admin && <Row icon="wrench" iconTint="var(--indigo)" title={t('Admin dashboard')} accessory="chevron" onClick={() => nav('/admin')} />}
<Row icon="signOut" iconTint="var(--red)" title={t('Sign out')} danger onClick={() => confirmSheet({ title: t('Sign out?'), message: t('Your data is synced to your profile first, then cleared from this device.'), confirmText: t('Sign out'), danger: true, onConfirm: () => { signOut(); nav('/home') } })} />
</> : webauthnOK() ? <>
<Row icon="sparkles" iconTint="var(--acc)" title={t('Create passkey profile')} subtitle={t('Keeps your data safe and separate per person.')} accessory="chevron" onClick={registerHere} />
<Row icon="person" iconTint="var(--blue)" title={t('Sign in with passkey')} accessory="chevron" onClick={signInHere} />
</> : (
<Row icon="lock" iconTint="var(--grey)" title={t('Passkeys not supported in this browser.')} />
)}
</Section>
{!user && !DEMO && <p className="sect-f" style={{ marginTop: -18, marginBottom: 22 }}>{t('Guest mode — data lives only in this browser.')}</p>}
{/* ---------- appearance ---------- */}
<Section title={t('Appearance')} footer={DEMO ? undefined : t('synced with your profile')}>
<SelectRow
icon="globe" iconTint="var(--blue)" title={t('Language')}
value={S.lang || 'en'} onChange={v => update(s => { s.lang = v })}
options={Object.entries(LANGS).map(([k, name]) => ({
value: k, label: name,
subtitle: INSTR_LANGS.includes(k) ? null : t("Exercise instructions aren't available in this language yet — they stay in English."),
}))}
/>
<Row icon="moon" iconTint="var(--indigo)" title={t('Theme')}>
<Segmented
className="seg-inline"
options={[{ value: 'dark', icon: 'moon', label: t('Dark') }, { value: 'light', icon: 'sun', label: t('Light') }]}
value={S.theme === 'light' ? 'light' : 'dark'}
onChange={v => update(s => { s.theme = v })}
/>
</Row>
{/* Purely how the muscle map is drawn — nothing else in the app reads this. */}
<Row icon="figureStrength" iconTint="var(--teal)" title={t('Body diagram')}>
<Segmented
className="seg-inline"
options={[{ value: 'male', label: t('Male') }, { value: 'female', label: t('Female') }]}
value={S.body === 'female' ? 'female' : 'male'}
onChange={v => update(s => { s.body = v })}
/>
</Row>
<div className="lrow" style={{ flexDirection: 'column', alignItems: 'stretch', gap: 12, paddingTop: 13, paddingBottom: 14 }}>
<span className="lrow-t">{t('Accent color')}</span>
<div className="swatches">
{Object.entries(ACCENTS).map(([k, c]) => (
<button key={k} className={'swatch' + ((S.accent || 'lime') === k ? ' on' : '')}
style={{ background: c }} onClick={() => update(s => { s.accent = k })} aria-label={k} />
))}
</div>
</div>
<div style={{ padding: '8px 0' }}>
<div style={{ marginBottom: 10 }}>{t('Accent color')}</div>
<div className="swatches">{Object.entries(ACCENTS).map(([k, c]) => <button key={k} className={'swatch' + ((S.accent || 'lime') === k ? ' on' : '')} style={{ background: c }} onClick={() => update(s => { s.accent = k })} />)}</div>
</div>
</div>
</Section>
<div className="card">
<h2>{t('Units & timer')}</h2>
<div className="row between" style={{ padding: '8px 0' }}><span>{t('Weight unit')}</span>
<div className="chips"><button className={'chip' + (S.unit === 'kg' ? ' on' : '')} onClick={() => update(s => { s.unit = 'kg' })}>kg</button>
<button className={'chip' + (S.unit === 'lb' ? ' on' : '')} onClick={() => update(s => { s.unit = 'lb' })}>lb</button></div></div>
<div className="row between" style={{ padding: '8px 0' }}><span>{t('Rest timer')}</span>
<select className="input" style={{ width: 120 }} value={S.restSec} onChange={e => update(s => { s.restSec = +e.target.value })}>
{[60, 90, 120, 150, 180].map(v => <option key={v} value={v}>{v}s</option>)}</select></div>
<div className="row between" style={{ padding: '8px 0' }}><span>{t('Sounds')}</span>
<button className={'chip' + (S.sound ? ' on' : '')} onClick={() => update(s => { s.sound = !s.sound })}>{S.sound ? t('On 🔔') : t('Off 🔕')}</button></div>
<div className="small dim" style={{ marginTop: 6 }}>{t('Note: switching units only changes the label — logged numbers are not converted.')}</div>
</div>
{/* ---------- units & timer ---------- */}
<Section title={t('Units & timer')} footer={t('Note: switching units only changes the label — logged numbers are not converted.')}>
<Row icon="scale" iconTint="var(--teal)" title={t('Weight unit')}>
<Segmented className="seg-inline"
options={[{ value: 'kg', label: 'kg' }, { value: 'lb', label: 'lb' }]}
value={S.unit} onChange={v => update(s => { s.unit = v })} />
</Row>
<SelectRow icon="timer" iconTint="var(--orange)" title={t('Rest timer')}
value={S.restSec} onChange={v => update(s => { s.restSec = v })}
options={[60, 90, 120, 150, 180].map(v => ({ value: v, label: v + 's' }))} />
<Row icon="bell" iconTint="var(--pink)" title={t('Sounds')}>
<Switch checked={!!S.sound} onChange={v => update(s => { s.sound = v })} />
</Row>
</Section>
{user && <NotificationsCard S={S} update={update} toast={toast} />}
<div className="card">
<h2>{t('Data')}</h2>
<button className="btn" onClick={doExport}>⬇️ {t('Export backup (JSON)')}</button>
<div style={{ height: 8 }} /><button className="btn" onClick={() => fileRef.current.click()}>⬆️ {t('Import backup')}</button>
<input ref={fileRef} type="file" accept=".json,application/json" style={{ display: 'none' }} onChange={doImport} />
<div style={{ height: 8 }} /><button className="btn" onClick={loadStarterPlan}>{t('Load starter plan (PPL)')}</button>
<div style={{ height: 8 }} /><button className="btn danger" onClick={() => confirmSheet({ title: t('Reset everything?'), message: t('Deletes your plan, workouts and body weight on this device. This cannot be undone.'), confirmText: t('Delete everything'), danger: true, onConfirm: () => { replaceState(JSON.parse(JSON.stringify(DEF)), true); nav('/home'); toast(t('All data reset')) } })}>{t('Reset everything')}</button>
</div>
{/* ---------- data ---------- */}
<Section title={t('Data')}>
<Row icon="download" iconTint="var(--blue)" title={t('Export backup (JSON)')} accessory="chevron" onClick={doExport} />
<Row icon="upload" iconTint="var(--blue)" title={t('Import backup')} accessory="chevron" onClick={() => fileRef.current.click()} />
<Row icon="sparkles" iconTint="var(--acc)" title={t('Load starter plan (PPL)')} accessory="chevron" onClick={loadStarterPlan} />
<Row icon="trash" iconTint="var(--red)" title={t('Reset everything')} danger onClick={() => confirmSheet({ title: t('Reset everything?'), message: t('Deletes your plan, workouts and body weight on this device. This cannot be undone.'), confirmText: t('Delete everything'), danger: true, onConfirm: () => { replaceState(JSON.parse(JSON.stringify(DEF)), true); nav('/home'); toast(t('All data reset')) } })} />
</Section>
<input ref={fileRef} type="file" accept=".json,application/json" style={{ display: 'none' }} onChange={doImport} />
<div className="card"><h2>{t('Tip')}</h2>
<div className="small muted" style={{ lineHeight: 1.5 }}>📱 {IS_ANDROID ? t('In Chrome: ⋮ menu → Add to Home screen') : t('In Safari: Share → Add to Home Screen')} {t('to install openGym as a full-screen app.')} {user ? t('Your data syncs with your profile — sign in anywhere to see it.') : t('Guest data stays on this device — export a backup now and then!')}</div></div>
<div className="dim small" style={{ textAlign: 'center', marginTop: 8, lineHeight: 1.6 }}>
<Section title={t('Tip')}>
<Row icon="lightbulb" iconTint="var(--yellow)"
title={IS_ANDROID ? t('In Chrome: ⋮ menu → Add to Home screen') : t('In Safari: Share → Add to Home Screen')}
subtitle={t('to install openGym as a full-screen app.') + ' ' + (user ? t('Your data syncs with your profile — sign in anywhere to see it.') : t('Guest data stays on this device — export a backup now and then!'))} />
</Section>
<div className="dim small" style={{ textAlign: 'center', marginTop: 4, lineHeight: 1.6 }}>
openGym · {t('free & open source (AGPL v3)')}<br />
<a href="https://github.com/DuarteSantos8/openGym" target="_blank" rel="noopener">source code</a> · exercise data: hasaneyldrm/exercises-dataset (CC)
</div>
@@ -121,11 +156,11 @@ function NotificationsCard({ S, update, toast }) {
navigator.serviceWorker.ready.then(reg => reg.pushManager.getSubscription()).then(sub => setOn(!!sub)).catch(() => {})
}, [supported])
const toggle = async () => {
const toggle = async v => {
setBusy(true)
try {
if (on) { await disablePush(); setOn(false); toast(t('Notifications off')) }
else { await enablePush(); setOn(true); toast(t('Notifications on 🔔')) }
if (!v) { await disablePush(); setOn(false); toast(t('Notifications off')) }
else { await enablePush(); setOn(true); toast(t('Notifications on')) }
} catch (e) { toast(e.message || t('Could not change notification settings')) }
setBusy(false)
}
@@ -134,31 +169,37 @@ function NotificationsCard({ S, update, toast }) {
catch (e) { toast(e.message || t('Test failed')) }
}
return <div className="card">
<h2>{t('Notifications')}</h2>
{!supported ? <div className="small dim">{t('Not supported in this browser.')}</div> : <>
<div className="row between" style={{ padding: '8px 0' }}>
<div><span>{t('Push notifications')}</span><div className="small muted">{t('Rest-timer alerts, even if openGym is closed.')}</div></div>
<button className={'chip' + (on ? ' on' : '')} disabled={busy} onClick={toggle}>{on ? t('On 🔔') : t('Off 🔕')}</button>
</div>
{on && <>
<div className="row between" style={{ padding: '8px 0' }}>
<span>{t('Workout day reminder')}</span>
<button className={'chip' + (S.reminder?.on ? ' on' : '')} onClick={() => update(s => { s.reminder = { ...(s.reminder || DEF.reminder), on: !s.reminder?.on, tz: localTZ() } })}>{S.reminder?.on ? t('On') : t('Off')}</button>
</div>
{S.reminder?.on && <div className="row between" style={{ padding: '8px 0' }}>
<span>{t('Reminder time')}</span>
<input type="time" className="input" style={{ width: 120 }} value={S.reminder?.time || DEF.reminder.time}
if (!supported) return (
<Section title={t('Notifications')}>
<Row icon="bellSlash" iconTint="var(--grey)" title={t('Not supported in this browser.')} />
</Section>
)
return <>
<Section
title={t('Notifications')}
footer={on && S.reminder?.on
? t("Only sent on days you have a routine planned and haven't logged a workout yet.") +
(S.reminder?.tz ? ' ' + t('Timezone: {0} (auto-detected, updates if you travel).', S.reminder.tz) : '')
: null}
>
<Row icon="bell" iconTint="var(--red)" title={t('Push notifications')} subtitle={t('Rest-timer alerts, even if openGym is closed.')}>
<Switch checked={on} disabled={busy} onChange={toggle} />
</Row>
{on && (
<Row icon="calendar" iconTint="var(--orange)" title={t('Workout day reminder')}>
<Switch checked={!!S.reminder?.on} onChange={() => update(s => { s.reminder = { ...(s.reminder || DEF.reminder), on: !s.reminder?.on, tz: localTZ() } })} />
</Row>
)}
{on && S.reminder?.on && (
<Row icon="clock" iconTint="var(--purple)" title={t('Reminder time')}>
<input type="time" className="timef" value={S.reminder?.time || DEF.reminder.time}
onChange={e => update(s => { s.reminder = { ...(s.reminder || DEF.reminder), time: e.target.value, tz: localTZ() } })} />
</div>}
<div className="small dim" style={{ margin: '6px 0' }}>
{t("Only sent on days you have a routine planned and haven't logged a workout yet.")}
{S.reminder?.on && S.reminder?.tz && <> {t('Timezone: {0} (auto-detected, updates if you travel).', S.reminder.tz)}</>}
</div>
<button className="btn sm" onClick={test}>{t('Send test notification')}</button>
</>}
</>}
</div>
</Row>
)}
</Section>
{on && <div style={{ marginTop: -12, marginBottom: 22 }}><Button size="sm" icon="bell" onClick={test}>{t('Send test notification')}</Button></div>}
</>
}
function RegisterInline({ close, setUser, pushState, pullState, toast }) {
@@ -168,14 +209,14 @@ function RegisterInline({ close, setUser, pushState, pullState, toast }) {
if (!n) { toast(t('Enter a name')); return }
try {
const u = await passkeyRegister(n); setUser(u); close()
if (hasData(useStore.getState().S)) { await pushState(); toast(t('Profile created — data moved into it ✓')) }
else { await pullState(); toast(t('Welcome, {0} 💪', u.name)) }
if (hasData(useStore.getState().S)) { await pushState(); toast(t('Profile created — data moved into it')) }
else { await pullState(); toast(t('Welcome, {0}', u.name)) }
} catch (e) { if (e.name !== 'NotAllowedError' && e.name !== 'AbortError') toast(e.message || t('Registration failed')) }
}
return <>
<h3>{t('Create your profile ✨')}</h3>
<h3>{t('Create your profile')}</h3>
<div className="muted small" style={{ marginBottom: 14 }}>{t('Pick a name, then confirm with your device.')}</div>
<input ref={nameRef} className="input" placeholder={t('Your name')} maxLength={40} />
<div style={{ height: 12 }} /><button className="btn primary" onClick={go}>{t('Create passkey')}</button>
<TextField ref={nameRef} placeholder={t('Your name')} maxLength={40} />
<div style={{ height: 12 }} /><Button variant="primary" onClick={go}>{t('Create passkey')}</Button>
</>
}
+66 -17
View File
@@ -3,11 +3,58 @@ import { useNavigate } from 'react-router-dom'
import { useStore } from '../store/useStore.js'
import { EXIDX, isCardio } from '../lib/exercises.js'
import { bestWeightFor, lastBW, streakWeeks, setLabel } from '../lib/history.js'
import { fmtNum, fmtDate, fmtVol, todayISO } from '../lib/format.js'
import { fmtNum, fmtDate, fmtVol, todayISO, weekKey } from '../lib/format.js'
import { t } from '../lib/i18n.js'
import { bwSheet, goalSheet, calendarSheet, workoutDetailSheet, WorkoutRow, bwDeltaColor } from '../sheets.jsx'
import LineChart from '../components/LineChart.jsx'
import Heatmap from '../components/Heatmap.jsx'
import Icon from '../components/Icon.jsx'
import BodyMap, { BodyMapLegend } from '../components/BodyMap.jsx'
import { loadOfWorkouts, rankOf, MUSCLE_NAME } from '../lib/muscles.js'
import { Button, Segmented, SelectRow } from '../components/ui.jsx'
// Which muscles the training in a window actually hit — and, the point of the card,
// which ones it keeps missing. Shading is relative within the window (lib/muscles.js).
function MuscleBalance({ S }) {
const [win, setWin] = useState(7)
const [sel, setSel] = useState(null)
const now = Date.now()
const inWin = S.workouts.filter(w =>
win === 0 ? true
: win === 7 ? weekKey(w.d) === weekKey(todayISO())
: (w.start || new Date(w.d).getTime()) > now - win * 86400000)
const load = loadOfWorkouts(inWin)
const { worked, missed } = rankOf(load)
const top = worked.slice(0, 4)
const max = worked.length ? load[worked[0]] : 0
const sets = m => Math.round((load[m] || 0) * 10) / 10
return <div className="card">
<h2>{t('Muscle balance')} <span className="dim" style={{ textTransform: 'none', letterSpacing: 0 }}>· {t('by sets worked')}</span></h2>
<Segmented className="seg-range" value={win} onChange={v => { setWin(v); setSel(null) }}
options={[{ value: 7, label: t('Week') }, { value: 30, label: '30d' }, { value: 90, label: '90d' }, { value: 0, label: t('All') }]} />
{inWin.length ? <>
<BodyMap className="tappable" load={load} body={S.body} selected={sel}
onMuscle={m => setSel(s => (s === m ? null : m))} />
<BodyMapLegend />
{sel && <div className="mrow" style={{ borderTop: 'var(--hair) solid var(--sep)', marginTop: 4, paddingTop: 10 }}>
<span className="nm"><b>{t(MUSCLE_NAME[sel])}</b></span>
<span className="v">{sets(sel) ? t('{0} sets', sets(sel)) : t('not trained')}</span>
</div>}
{!sel && top.map(m => <div key={m} className="mrow">
<span className="nm">{t(MUSCLE_NAME[m])}</span>
<span className="bar"><i style={{ width: Math.round(load[m] / max * 100) + '%' }} /></span>
<span className="v">{t('{0} sets', sets(m))}</span>
</div>)}
{missed.length > 0 && <>
<h4 className="sec" style={{ marginTop: 12 }}>{t('Not trained in this period')}</h4>
<div className="mchips">{missed.map(m => <span key={m} className="mchip miss">{t(MUSCLE_NAME[m])}</span>)}</div>
</>}
{!missed.length && worked.length > 0 &&
<div className="muted small" style={{ marginTop: 10 }}>{t('Every muscle group got some work in this period.')}</div>}
</> : <div className="muted small">{t('No workouts in this period yet.')}</div>}
</div>
}
// Stats = the analytics hub: all charts, progress and history live here.
export default function Stats() {
@@ -39,13 +86,13 @@ export default function Stats() {
return <>
<div className="hdr"><div><h1>{t('Stats')}</h1><div className="sub">{t('Progress & history')}</div></div>
<button className="iconbtn" onClick={() => nav('/history')}>🗂</button></div>
<button className="iconbtn" onClick={() => nav('/history')} aria-label={t('History')}><Icon name="history" /></button></div>
<div className="tiles">
<div className="tile"><div className="l">{t('Workouts')}</div><div className="v">{S.workouts.length}</div></div>
<div className="tile"><div className="l">{t('This month')}</div><div className="v">{monthW}</div></div>
<div className="tile"><div className="l">{t('Week streak')}</div><div className="v">{streakWeeks(S)} 🔥</div></div>
<div className="tile"><div className="l">{t('Weight 30d')}</div><div className="v" style={{ fontSize: '1.15rem', color: bwDelta30 === null ? 'inherit' : bwDeltaColor(bwDelta30, (lastBW(S) || {}).w || 0) }}>{bwDelta30 === null ? '—' : (bwDelta30 > 0 ? '+' : '') + fmtNum(bwDelta30) + ' ' + S.unit}</div></div>
<div className="tile"><div className="l"><Icon name="dumbbell" />{t('Workouts')}</div><div className="v">{S.workouts.length}</div></div>
<div className="tile"><div className="l"><Icon name="calendar" />{t('This month')}</div><div className="v">{monthW}</div></div>
<div className="tile"><div className="l"><Icon name="flame" />{t('Week streak')}</div><div className="v">{streakWeeks(S)}</div></div>
<div className="tile"><div className="l"><Icon name="scale" />{t('Weight 30d')}</div><div className="v" style={{ fontSize: 22, color: bwDelta30 === null ? 'inherit' : bwDeltaColor(bwDelta30, (lastBW(S) || {}).w || 0) }}>{bwDelta30 === null ? '—' : (bwDelta30 > 0 ? '+' : '') + fmtNum(bwDelta30) + ' ' + S.unit}</div></div>
</div>
<div className="card">
@@ -53,39 +100,41 @@ export default function Stats() {
<Heatmap S={S} onDay={iso => { const ws = S.workouts.filter(w => w.d === iso); if (ws.length === 1) workoutDetailSheet(ws[0]); else if (ws.length) calendarSheet(iso) }} />
</div>
{S.workouts.length > 0 && <MuscleBalance S={S} />}
<div className="cols">
<div className="card">
<div className="row between" style={{ marginBottom: 8 }}>
<h2 style={{ margin: 0 }}>{t('Body weight')}</h2>
<div className="row" style={{ gap: 8 }}>
<button className="btn sm" style={S.targetW ? { color: 'var(--gold)' } : undefined} onClick={goalSheet}>🎯 {S.targetW ? fmtNum(S.targetW) : t('Goal')}</button>
<button className="btn sm" onClick={() => bwSheet()}>+ {t('Log')}</button>
<Button size="sm" icon="target" style={S.targetW ? { color: 'var(--yellow)' } : undefined} onClick={goalSheet}>{S.targetW ? fmtNum(S.targetW) : t('Goal')}</Button>
<Button size="sm" icon="plus" onClick={() => bwSheet()}>{t('Log')}</Button>
</div>
</div>
<div className="chips" style={{ marginBottom: 8 }}>
{[[30, '1M'], [90, '3M'], [365, '1Y'], [0, t('All')]].map(([d, l]) => <button key={l} className={'chip' + (range === d ? ' on' : '')} onClick={() => setRange(d)}>{l}</button>)}
</div>
<Segmented className="seg-range" value={range} onChange={setRange}
options={[{ value: 30, label: '1M' }, { value: 90, label: '3M' }, { value: 365, label: '1Y' }, { value: 0, label: t('All') }]} />
<div className="chart"><LineChart points={bwPts} h={160} unit={S.unit} goal={S.targetW} /></div>
</div>
<div className="card">
<h2>{t('Exercise progress')}</h2>
{exHist.length ? <>
<select className="input capitalize" style={{ marginBottom: 10 }} value={curEx} onChange={e => setExId(e.target.value)}>
{exHist.map(id => <option key={id} value={id}>{EXIDX[id].n}{isCardio(id) ? ' 🏃' : ''}</option>)}
</select>
<div className="sect-b" style={{ marginBottom: 10 }}>
<SelectRow title={t('Exercise')} sheetTitle={t('Exercise progress')} value={curEx} onChange={setExId}
options={exHist.map(id => ({ value: id, label: EXIDX[id].n }))} />
</div>
<div className="chart"><LineChart points={exPts.map(p => ({ t: p.t, y: p.y, d: p.d }))} h={150} unit={exUnit} color="var(--blue)" /></div>
<div style={{ marginTop: 8 }}>{exList.map((p, i) => <div key={i} className="row between small" style={{ padding: '6px 0', borderBottom: '1px solid var(--bg2)' }}>
<div style={{ marginTop: 8 }}>{exList.map((p, i) => <div key={i} className="row between small" style={{ padding: '6px 0', borderBottom: 'var(--hair) solid var(--sep)' }}>
<span className="muted">{fmtDate(p.d, true)}</span><span>{p.sets.map(s => setLabel(curEx, s)).join(' ')}</span></div>)}</div>
<div className="small dim" style={{ marginTop: 8 }}>{curCardio ? t('Top speed per workout') : t('Best set weight per workout')} · {t('Best:')} <b className="accent">{fmtNum(exBest)} {exUnit}</b></div>
</> : <div className="muted small">{t('Finish your first workout to see progress curves here. 📈')}</div>}
</> : <div className="muted small">{t('Finish your first workout to see progress curves here.')}</div>}
</div>
</div>
{S.workouts.length > 0 && <>
<div className="row between" style={{ marginBottom: 10 }}>
<h4 className="sec" style={{ margin: 0 }}>{t('Recent workouts')}</h4>
<button className="btn sm ghost accent" onClick={() => nav('/history')}>{t('All')} {S.workouts.length} ›</button>
<Button size="sm" variant="ghost" trailingIcon="chevronRight" onClick={() => nav('/history')}>{t('All')} {S.workouts.length}</Button>
</div>
<div className="list">{[...S.workouts].reverse().slice(0, 6).map(w => <WorkoutRow key={w.id} w={w} onClick={() => workoutDetailSheet(w)} />)}</div>
</>}
+62 -30
View File
@@ -7,9 +7,12 @@ import { effectiveRoutine, lastEntryFor, bestWeightFor, buildSets, setsDoneActiv
import { fmtNum, fmtDate, todayISO, DAYN } from '../lib/format.js'
import { beep, vibrate } from '../lib/sound.js'
import { t } from '../lib/i18n.js'
import { api } from '../lib/api.js'
import Media from '../components/Media.jsx'
import NumField from '../components/NumField.jsx'
import { startFlow, exercisePicker, exConfigSheet, exerciseDetailSheet, topWeightSheet, finishWorkout, workoutCompleteSheet, confirmSheet } from '../sheets.jsx'
import Icon from '../components/Icon.jsx'
import { Button, Check, NumberField } from '../components/ui.jsx'
import { glyphOf } from '../lib/glyphs.js'
/* ---------- start chooser (no active workout) ---------- */
function StartChooser() {
@@ -24,18 +27,18 @@ function StartChooser() {
<h2 className="accent">{t("Today's plan")}{todayOvr ? ' · ' + t('rescheduled') : ''}</h2>
<div className="row between" style={{ marginBottom: 12 }}>
<div><div className="big">{todayR.name}</div><div className="muted small">{t('{0} exercises', todayR.ex.length)}</div></div>
<div style={{ fontSize: '2rem' }}>{todayR.emoji || '💪'}</div>
<span className="lrow-i" style={{ width: 38, height: 38, borderRadius: 9, fontSize: 22 }}><Icon name={glyphOf(todayR.emoji)} /></span>
</div>
<button className="btn primary" onClick={() => startFlow(todayR.id)}>{t('Start {0} ▶', todayR.name)}</button>
<Button variant="primary" icon="play" onClick={() => startFlow(todayR.id)}>{t('Start {0}', todayR.name)}</Button>
</div>}
{others.length > 0 && <><h4 className="sec">{t('Other routines')}</h4>
<div className="list">{others.map(r => <div key={r.id} className="item" onClick={() => startFlow(r.id)}>
<div style={{ fontSize: '1.5rem', flex: 'none' }}>{r.emoji || '💪'}</div>
<span className="lrow-i"><Icon name={glyphOf(r.emoji)} /></span>
<div className="grow"><div className="tt">{r.name}</div><div className="ss">{t('{0} exercises', r.ex.length)}</div></div>
<span className="tag acc">{t('Start ▶')}</span></div>)}</div></>}
<span className="tag acc">{t('Start')}</span></div>)}</div></>}
<div style={{ height: 14 }} />
<button className="btn" onClick={() => startFlow(null)}>🎯 {t('Freestyle workout (pick as you go)')}</button>
{!S.routines.length && <><div style={{ height: 10 }} /><button className="btn primary" onClick={() => nav('/plan')}>{t('Build a plan first')}</button></>}
<Button icon="shuffle" onClick={() => startFlow(null)}>{t('Freestyle workout (pick as you go)')}</Button>
{!S.routines.length && <><div style={{ height: 10 }} /><Button variant="primary" onClick={() => nav('/plan')}>{t('Build a plan first')}</Button></>}
</div>
}
@@ -61,38 +64,40 @@ function ExerciseBlock({ entryIdx, compact, onToggle, onField, onBumpAll, onAddS
? Math.max(...last.sets.map(s => s.w)) + 2.5 : null
const col1 = cardio ? { f: 'min', step: 1, dec: false, hd: t('Duration (min)') } : { f: 'w', step: 2.5, dec: true, hd: t('Weight ({0})', S.unit) }
const col2 = cardio ? { f: 'speed', step: 0.5, dec: true, hd: t('Speed (km/h)') } : { f: 'r', step: 1, dec: false, hd: t('Reps') }
// Uses the shared stepper markup so a set row picks up the same control styling
// as every other +/- field in the app.
const cell = (s, i, col, cls) => (
<div className={'step ' + cls}>
<button onClick={() => onField(i, col.f, Math.max(0, Math.round(((s[col.f] || 0) - col.step) * 100) / 100))}>−</button>
<NumField decimal={col.dec} value={s[col.f] ?? ''} onChange={v => onField(i, col.f, v)} />
<button onClick={() => onField(i, col.f, Math.max(0, Math.round(((s[col.f] || 0) + col.step) * 100) / 100))}>+</button>
<div className={'stp ' + cls}>
<button aria-label="Decrease" onClick={() => onField(i, col.f, Math.max(0, Math.round(((s[col.f] || 0) - col.step) * 100) / 100))}><Icon name="minus" /></button>
<span className="val"><NumberField decimal={col.dec} value={s[col.f] ?? ''} onChange={v => onField(i, col.f, v)} /></span>
<button aria-label="Increase" onClick={() => onField(i, col.f, Math.max(0, Math.round(((s[col.f] || 0) + col.step) * 100) / 100))}><Icon name="plus" /></button>
</div>
)
return <>
<Media ex={ex} key={entry.id} compact={compact} />
<Media ex={ex} key={entry.id} compact={compact} minimizable />
<div className="row between" style={{ marginBottom: 6 }}>
<div style={{ fontSize: compact ? '1.05rem' : '1.2rem', fontWeight: 800, textTransform: 'capitalize', lineHeight: 1.2 }}>{ex.n}</div>
<button className="iconbtn" onClick={() => exerciseDetailSheet(ex)}>ℹ️</button>
<div style={{ fontSize: compact ? 17 : 20, fontWeight: 600, letterSpacing: '-.02em', textTransform: 'capitalize', lineHeight: 1.2 }}>{ex.n}</div>
<button className="iconbtn" aria-label={t('Details')} onClick={() => exerciseDetailSheet(ex)}><Icon name="info" /></button>
</div>
<div className="row" style={{ gap: 6, flexWrap: 'wrap', marginBottom: 8 }}>
{cardio && <span className="tag acc">🏃 {t('Cardio')}</span>}
{cardio && <span className="tag acc"><Icon name="figureRun" />{t('Cardio')}</span>}
<span className="tag">{t(ex.tg || ex.bp)}</span><span className="tag">{t(ex.eq)}</span>
{best > 0 && <span className="tag">{t('Best:')} {fmtNum(best)} {S.unit}</span>}
</div>
{last && <div className="small dim" style={{ marginBottom: 4 }}>{t('Last time')} ({fmtDate(last.d)}): {last.sets.map(s => setLabel(entry.id, s)).join(', ')}</div>}
{hint && <button className="tag acc" style={{ border: 'none' }} onClick={() => { onBumpAll('w', hint); useUI.getState().toast(t('Weights bumped to {0} 💪', fmtNum(hint) + ' ' + S.unit)) }}>💡 {t('Last time you hit all reps — try {0}', fmtNum(hint) + ' ' + S.unit)}</button>}
{hint && <button className="tag acc" style={{ border: 'none', textAlign: 'left' }} onClick={() => { onBumpAll('w', hint); useUI.getState().toast(t('Weights bumped to {0}', fmtNum(hint) + ' ' + S.unit)) }}><Icon name="lightbulb" />{t('Last time you hit all reps — try {0}', fmtNum(hint) + ' ' + S.unit)}</button>}
<div className="card" style={{ marginTop: 10, marginBottom: 0 }}>
<div className="sethead"><span className="n-sp" /><span className="w-sp">{col1.hd}</span><span className="r-sp">{col2.hd}</span><span className="ck-sp" /></div>
{entry.sets.map((s, i) => <div key={i} className={'setrow' + (s.done ? ' done' : '')}>
<div className="n">{i + 1}</div>
{cell(s, i, col1, 'w')}
{cell(s, i, col2, 'r')}
<button className={'ck' + (s.done ? ' on' : '')} onClick={() => onToggle(i)}><svg viewBox="0 0 24 24"><path d="m4.5 12.5 5 5 10-11" /></svg></button>
<Check checked={s.done} onChange={() => onToggle(i)} />
</div>)}
<div style={{ height: 8 }} />
<div className="row">
<button className="btn sm" disabled={entry.sets.length <= 1} onClick={onRemoveSet}>− {t('Remove set')}</button>
<button className="btn sm" onClick={onAddSet}>+ {t('Add set')}</button>
<Button size="sm" icon="minus" disabled={entry.sets.length <= 1} onClick={onRemoveSet}>{t('Remove set')}</Button>
<Button size="sm" icon="plus" onClick={onAddSet}>{t('Add set')}</Button>
</div>
</div>
</>
@@ -144,14 +149,41 @@ function ActiveWorkout() {
// cardio or already-confirmed: go straight to the prompt.
if (askTop) topWeightSheet(idx)
else if (workoutDone) workoutCompleteSheet()
else if (exJustDone && cardioEntry) useUI.getState().toast(t('Cardio logged 🏃'))
else if (exJustDone && cardioEntry) useUI.getState().toast(t('Cardio logged'))
}
// Live-presence heartbeat so the admin dashboard can show who's training now. Signed-in only —
// guests have no server session. Reads fresh state each tick so progress stays current.
useEffect(() => {
if (!useStore.getState().user) return
let stopped = false
const ping = active => {
const A2 = useStore.getState().S.active
if (!A2) return
const u = supersetUnits(A2.entries)
const c = Math.min(A2.cur, Math.max(0, A2.entries.length - 1))
const ui = u.findIndex(x => x.includes(c))
const tot = A2.entries.reduce((n, e) => n + e.sets.length, 0)
api('/api/activity', { method: 'POST', body: JSON.stringify({
active, name: A2.name, exIdx: ui + 1, exTotal: u.length,
setsDone: setsDoneActive(A2), setsTotal: tot, startedAt: A2.start
}) }).catch(() => {})
}
ping(true)
const iv = setInterval(() => { if (!stopped) ping(true) }, 20000)
return () => {
stopped = true; clearInterval(iv)
// best-effort "left" signal: sendBeacon survives a tab close, fetch covers in-app nav
try { navigator.sendBeacon?.('/api/activity', new Blob([JSON.stringify({ active: false })], { type: 'application/json' })) } catch { /* */ }
api('/api/activity', { method: 'POST', body: JSON.stringify({ active: false }) }).catch(() => {})
}
}, [])
return <div className="narrow">
<div className="hdr">
<button className="iconbtn" onClick={() => confirmSheet({ title: t('Discard workout?'), message: t('The sets you logged in this session will be lost.'), confirmText: t('Discard'), danger: true, onConfirm: () => { update(s => { s.active = null }); stopRest(); nav('/home') } })}>✕</button>
<div style={{ textAlign: 'center' }}><div style={{ fontWeight: 800 }}>{A.name}</div><div className="sub"><Elapsed start={A.start} /> · {t('{0} sets', done + '/' + total)}</div></div>
<button className="iconbtn" style={{ color: 'var(--acc)' }} onClick={finishWorkout}>✓</button>
<button className="iconbtn" aria-label={t('Discard')} onClick={() => confirmSheet({ title: t('Discard workout?'), message: t('The sets you logged in this session will be lost.'), confirmText: t('Discard'), danger: true, onConfirm: () => { update(s => { s.active = null }); stopRest(); nav('/home') } })}><Icon name="xmark" /></button>
<div style={{ textAlign: 'center' }}><div style={{ fontWeight: 600 }}>{A.name}</div><div className="sub"><Elapsed start={A.start} /> · {t('{0} sets', done + '/' + total)}</div></div>
<button className="iconbtn" style={{ color: 'var(--acc)' }} aria-label={t('Finish')} onClick={finishWorkout}><Icon name="check" /></button>
</div>
<div className="wprog"><i style={{ width: (total ? done / total * 100 : 0) + '%' }} /></div>
@@ -159,7 +191,7 @@ function ActiveWorkout() {
<div className="muted small" style={{ marginBottom: 6 }}>{isSuperset ? t('Superset {0} / {1}', unitIdx + 1, units.length) : t('Exercise {0} / {1}', unitIdx + 1, units.length)}</div>
{isSuperset ? (
<div className="ss-card">
<div className="ss-hd">🔗 {t('Superset · do these back-to-back, rest after both')}</div>
<div className="ss-hd"><Icon name="link" />{t('Superset · do these back-to-back, rest after both')}</div>
{unit.map((idx, k) => <div key={idx} className="ss-ex">
{k > 0 && <div className="ss-amp">+</div>}
<ExerciseBlock entryIdx={idx} compact
@@ -169,24 +201,24 @@ function ActiveWorkout() {
) : (
<ExerciseBlock entryIdx={cur} onToggle={i => toggle(cur, i)} onField={(i, f, v) => setField(cur, i, f, v)} onBumpAll={(f, v) => bumpAll(cur, f, v)} onAddSet={() => addSet(cur)} onRemoveSet={() => removeSet(cur)} />
)}
</> : <div className="empty"><div className="ico">🎯</div>{t('Freestyle workout — add your first exercise.')}</div>}
</> : <div className="empty"><div className="ico"><Icon name="shuffle" /></div>{t('Freestyle workout — add your first exercise.')}</div>}
<div style={{ height: 12 }} />
<div className="row">
<button className="btn" disabled={unitIdx <= 0} onClick={() => update(s => { s.active.cur = units[unitIdx - 1][0] })}>‹ {t('Prev')}</button>
<button className="btn" disabled={unitIdx < 0 || unitIdx >= units.length - 1} onClick={() => update(s => { s.active.cur = units[unitIdx + 1][0] })}>{t('Next')} ›</button>
<Button icon="chevronLeft" disabled={unitIdx <= 0} onClick={() => update(s => { s.active.cur = units[unitIdx - 1][0] })}>{t('Prev')}</Button>
<Button trailingIcon="chevronRight" disabled={unitIdx < 0 || unitIdx >= units.length - 1} onClick={() => update(s => { s.active.cur = units[unitIdx + 1][0] })}>{t('Next')}</Button>
</div>
<div style={{ height: 10 }} />
<button className="btn" onClick={() => exercisePicker(ex => exConfigSheet(ex, null, cfg => update(s => {
<Button onClick={() => exercisePicker(ex => exConfigSheet(ex, null, cfg => update(s => {
s.active.entries.push({ id: ex.id, target: { ...cfg }, sets: buildSets(s, { ...cfg, id: ex.id }) })
s.active.cur = s.active.entries.length - 1
})))}>+ {t('Add exercise')}</button>
})))} icon="plus">{t('Add exercise')}</Button>
<div style={{ height: 10 }} />
{(() => {
const exDone = A.entries.filter(e => e.sets.length && e.sets.every(s => s.done)).length
const allDone = A.entries.length > 0 && exDone === A.entries.length
return <button className={allDone ? 'btn primary' : 'btn ghost dim'} onClick={finishWorkout}>
{allDone ? t('Finish workout 🏁') : t('Finish workout early · {0} exercises', exDone + '/' + A.entries.length)}
{allDone ? t('Finish workout') : t('Finish workout early · {0} exercises', exDone + '/' + A.entries.length)}
</button>
})()}
<div style={{ height: 40 }} />