diff --git a/app/app.js b/app/app.js
index e53966d..eb7368c 100644
--- a/app/app.js
+++ b/app/app.js
@@ -13,6 +13,7 @@ const BODYPARTS = [...new Set(EXDB.map(e => e.bp))].sort();
const KEY = 'gym_state_v1';
const DEF = {
unit: 'kg', restSec: 90, sound: true,
+ theme: 'dark', accent: 'lime', // appearance β synced with the profile
bodyweight: [], // {d:'YYYY-MM-DD', w:Number, t:ms}
routines: [], // {id, name, emoji, ex:[{id, sets, reps, weight}]}
week: {}, // weekday(0-6, JS getDay) -> routineId
@@ -485,7 +486,15 @@ function bindCharts(root) {
============================================================ */
let elapsedInt = null;
function nav(hash) { location.hash = hash; }
-function route() { renderView(); updateTabbar(); }
+const ACCENTS = { lime: '#a3e635', sky: '#38bdf8', orange: '#fb923c', violet: '#a78bfa', pink: '#f472b6', red: '#f87171', teal: '#2dd4bf', gold: '#fbbf24' };
+function applyPrefs() {
+ const de = document.documentElement;
+ de.dataset.theme = S.theme === 'light' ? 'light' : 'dark';
+ de.dataset.accent = ACCENTS[S.accent] ? S.accent : 'lime';
+ const meta = document.querySelector('meta[name="theme-color"]');
+ if (meta) meta.content = de.dataset.theme === 'light' ? '#f2f4f7' : '#0c0e12';
+}
+function route() { applyPrefs(); renderView(); updateTabbar(); }
function renderView() {
const h = (location.hash || '#home').slice(1);
// re-rendering the same view (range chips, toggles, β¦) keeps the scroll position;
@@ -535,7 +544,7 @@ function updateTabbar() {
============================================================ */
function viewLogin(app) {
app.innerHTML = `
-
+
ποΈ
GymLog
Your workouts. Your weights. Your profile.
@@ -647,6 +656,7 @@ function viewHome(app) {
Tap a day to plan or move a session
+
${S.active ? `
Workout in progress
@@ -691,6 +701,7 @@ function viewHome(app) {
${bwSpark}
`
: `
No entries yet β log your weight to start the curve. It's also asked automatically before every workout.
`}
+
This week
${wThisWeek}${plannedPerWeek ? ' / ' + plannedPerWeek : ''}
@@ -705,6 +716,7 @@ function viewHome(app) {
See all βΊ
${[...S.workouts].reverse().slice(0, 3).map(workoutItem).join('')}
` : ''}
+
`;
$('#btn-settings').onclick = () => nav('#settings');
@@ -817,8 +829,10 @@ function viewPlan(app) {
app.innerHTML = `
+
Week schedule
-
${dayRows}
+
${dayRows}
+
Routines
@@ -832,6 +846,7 @@ function viewPlan(app) {
βΊ `).join('')}
`
: `
π
No routines yet.
Create one or load the starter plan.
Load starter plan (Push / Pull / Legs) `}
+
`;
app.querySelectorAll('[data-day]').forEach(el => el.addEventListener('click', () => dayAssignSheet(+el.dataset.day)));
@@ -863,6 +878,7 @@ function viewRoutineEdit(app, rid) {
const r = S.routines.find(x => x.id === rid);
if (!r) { nav('#plan'); return; }
app.innerHTML = `
+
βΉ
@@ -886,6 +902,7 @@ function viewRoutineEdit(app, rid) {
+ Add exercise
Delete routine
+
`;
$('#btn-back').onclick = () => nav('#plan');
@@ -1043,6 +1060,7 @@ function viewWorkout(app) {
const todayR = effectiveRoutine(todayISO());
const todayOvr = S.dayPlan[todayISO()] !== undefined;
app.innerHTML = `
+
Start workout ${DAYN[today]} β ${todayR ? 'today is ' + esc(todayR.name) : 'rest day, but no oneβs stopping you'}
${todayR ? `
@@ -1063,6 +1081,7 @@ function viewWorkout(app) {
π― Freestyle workout (pick as you go)
${!S.routines.length ? `
Load starter plan first ` : ''}
+
`;
app.querySelectorAll('[data-start]').forEach(el => el.addEventListener('click', () => startFlow(el.dataset.start)));
$('#btn-free').onclick = () => startFlow(null);
@@ -1094,6 +1113,7 @@ function renderActive(app) {
const entry = A.entries[cur];
app.innerHTML = `
+
β
${esc(A.name)}
@@ -1112,6 +1132,7 @@ function renderActive(app) {
+ Add exercise
Finish workout π
+
`;
// elapsed ticker
@@ -1424,6 +1445,7 @@ function viewStats(app) {
${heatmapHTML()}
+
Body weight
@@ -1447,6 +1469,7 @@ function viewStats(app) {
Best set weight per workout Β· Best ever: ${fmtNum(bestWeightFor(statsEx))} ${S.unit}
`
: '
Finish your first workout to see strength curves here. π
'}
+
${S.workouts.length ? `
@@ -1557,6 +1580,7 @@ function exerciseDetailSheet(ex) {
============================================================ */
function viewSettings(app) {
app.innerHTML = `
+
@@ -1574,6 +1598,23 @@ function viewSettings(app) {
π€ Sign in with passkey ` : '
Passkeys not supported in this browser.
'}`}
+
+
Appearance Β· synced with your profile
+
+
Theme
+
+ π Dark
+ βοΈ Light
+
+
+
+
Accent color
+
${Object.entries(ACCENTS).map(([k, c]) =>
+ ` `).join('')}
+
+
+
+
Units & timer
@@ -1611,6 +1652,7 @@ function viewSettings(app) {
π± In Safari: Share β Add to Home Screen to install GymLog as a full-screen app. All data stays on this device (localStorage) β export a backup now and then!
GymLog Β· exercise data: hasaneyldrm/exercises-dataset (CC)
+
`;
$('#btn-back').onclick = () => nav('#home');
@@ -1623,6 +1665,8 @@ function viewSettings(app) {
toast('Welcome back, ' + u.name + ' πͺ');
} catch (e) { if (e.name !== 'NotAllowedError' && e.name !== 'AbortError') toast(e.message || 'Sign-in failed'); }
};
+ app.querySelectorAll('[data-theme-set]').forEach(c => c.addEventListener('click', () => { S.theme = c.dataset.themeSet; save(); route(); }));
+ app.querySelectorAll('[data-accent-set]').forEach(c => c.addEventListener('click', () => { S.accent = c.dataset.accentSet; save(); route(); }));
app.querySelectorAll('[data-unit]').forEach(c => c.addEventListener('click', () => { S.unit = c.dataset.unit; save(); route(); }));
$('#set-rest').addEventListener('change', ev => { S.restSec = +ev.target.value; save(); });
$('#set-sound').onclick = () => { S.sound = !S.sound; save(); route(); };
diff --git a/app/index.html b/app/index.html
index 41800ef..36b522f 100644
--- a/app/index.html
+++ b/app/index.html
@@ -13,7 +13,7 @@
-
+
@@ -45,7 +45,7 @@
-
-
+
+