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.
This commit is contained in:
1 parent
e9bf38f39b
commit
cd77cfdd84
23 files changed
+777
-21
No files matched your search
@@ -664,6 +664,38 @@ h4.sec{
|
||||
}
|
||||
.hm-legend .hm-c{width:10px;height:10px}
|
||||
|
||||
/* --- muscle map --- */
|
||||
/* Reuses the .hm-c level ramp above, so one accent scale means one thing app-wide. */
|
||||
/* An untrained muscle is derived from the text colour rather than a fixed surface, so
|
||||
the body keeps the same contrast in both themes — pinned to --surface-2 it was all
|
||||
but invisible on a white card. */
|
||||
.bodymap{
|
||||
display:flex;gap:6px;justify-content:center;align-items:flex-start;
|
||||
--bm-base:color-mix(in srgb,var(--label) 11%,var(--surface));
|
||||
}
|
||||
.bm-v{flex:1;min-width:0;height:auto;max-height:min(46vh,340px)}
|
||||
.bm-ph{height:200px} /* holds the space while the geometry loads */
|
||||
.bm-sil{fill:color-mix(in srgb,var(--label) 18%,var(--surface))}
|
||||
.bm-m{fill:var(--bm-base);transition:fill var(--med) var(--ease)}
|
||||
.bm-m.l1{fill:color-mix(in srgb,var(--acc) 32%,var(--bm-base))}
|
||||
.bm-m.l2{fill:color-mix(in srgb,var(--acc) 56%,var(--bm-base))}
|
||||
.bm-m.l3{fill:color-mix(in srgb,var(--acc) 78%,var(--bm-base))}
|
||||
.bm-m.l4{fill:var(--acc)}
|
||||
.bm-m.sel{stroke:var(--label);stroke-width:7}
|
||||
.bodymap.tappable .bm-m{cursor:pointer}
|
||||
/* A hairline in the surface colour separates neighbouring muscles; the artwork has no
|
||||
outline path of its own, so without this the body reads as one flat blob. */
|
||||
.bm-v path{stroke:var(--surface);stroke-width:2.5;stroke-linejoin:round}
|
||||
|
||||
.mrow{display:flex;align-items:center;gap:9px;padding:5px 0}
|
||||
.mrow .nm{flex:1;min-width:0;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
.mrow .bar{width:74px;height:5px;border-radius:3px;background:var(--surface-2);flex:none;overflow:hidden}
|
||||
.mrow .bar i{display:block;height:100%;background:var(--acc);border-radius:3px}
|
||||
.mrow .v{font-size:12px;color:var(--label-2);min-width:52px;text-align:right;flex:none}
|
||||
.mchips{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
|
||||
.mchip{font-size:12px;padding:4px 9px;border-radius:99px;background:var(--surface-2);color:var(--label-2)}
|
||||
.mchip.miss{background:color-mix(in srgb,var(--orange) 16%,transparent);color:var(--orange)}
|
||||
|
||||
/* --- stat tiles --- */
|
||||
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
|
||||
.tile{background:var(--surface);border-radius:var(--r-card);padding:14px}
|
||||
|
||||
Reference in new issue
Block a user