Skip to content

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

Gewichts-Slider: voll theme-farbig (kein weißer Track), größerer Thumb, ±1/±0.5-Chips entfernt

Duarte Santos4545e60974af
diff --git a/frontend/src/index.css b/frontend/src/index.css
index a07a9f4db..b55993c42 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -337,4 +337,13 @@ h4.sec{font-size:.8rem;text-transform:uppercase;letter-spacing:.08em;color:var(-
.bw-pm:active{background:var(--card2);transform:scale(.94)}
.bw-read{font-size:2.9rem;font-weight:800;letter-spacing:-.02em;min-width:160px;text-align:center;font-variant-numeric:tabular-nums}
.bw-read .u{font-size:1.1rem;color:var(--mut);font-weight:600}
-.bw-slider{width:100%;height:30px;accent-color:var(--acc);cursor:pointer}
+/* fully theme-colored range slider (no default white track), big grabbable thumb */
+.bw-slider{-webkit-appearance:none;appearance:none;width:100%;height:30px;background:transparent;cursor:pointer;margin:4px 0}
+.bw-slider::-webkit-slider-runnable-track{height:9px;border-radius:99px;
+ background:var(--track,var(--bg2))}
+.bw-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;margin-top:-10px;
+ width:29px;height:29px;border-radius:50%;background:var(--acc);border:3px solid var(--bg);
+ box-shadow:0 2px 10px rgba(0,0,0,.45)}
+.bw-slider::-moz-range-track{height:9px;border-radius:99px;background:var(--bg2)}
+.bw-slider::-moz-range-progress{height:9px;border-radius:99px;background:var(--acc)}
+.bw-slider::-moz-range-thumb{width:26px;height:26px;border:3px solid var(--bg);border-radius:50%;background:var(--acc)}
diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsx
index a00692e0d..9ffbf5853 100644
--- a/frontend/src/sheets.jsx
+++ b/frontend/src/sheets.jsx
@@ -63,11 +63,10 @@ function BwSheet({ required, onDone, close }) {
<div className="bw-read">{fmtNum(v)}<span className="u"> {unit}</span></div>
<button className="bw-pm" onClick={() => step(0.1)} aria-label="plus">+</button>
</div>
- <input className="bw-slider" type="range" min={lo} max={hi} step="0.1" value={Math.max(lo, Math.min(hi, v))} onChange={e => set(parseFloat(e.target.value))} />
- <div className="row" style={{ justifyContent: 'center', gap: 8, margin: '8px 0 2px' }}>
- {[-1, -0.5, 0.5, 1].map(d => <button key={d} className="chip" onClick={() => step(d)}>{d > 0 ? '+' + d : d}</button>)}
- </div>
- <div style={{ height: 10 }} />
+ <input className="bw-slider" type="range" min={lo} max={hi} step="0.1"
+ value={Math.max(lo, Math.min(hi, v))} onChange={e => set(parseFloat(e.target.value))}
+ style={{ '--track': `linear-gradient(90deg, var(--acc) ${((Math.max(lo, Math.min(hi, v)) - lo) / (hi - lo)) * 100}%, var(--bg2) ${((Math.max(lo, Math.min(hi, v)) - lo) / (hi - lo)) * 100}%)` }} />
+ <div style={{ height: 14 }} />
<button className="btn primary" onClick={save}>{required ? 'Save & start workout' : 'Save'}</button>
{required && <>
<div style={{ height: 8 }} /><button className="btn ghost dim" onClick={() => { close(); onDone && onDone(null) }}>Skip today</button>