Gewichts-Slider: voll theme-farbig (kein weißer Track), größerer Thumb, ±1/±0.5-Chips entfernt
Range-Input komplett custom gestylt (Akzent-Fill + dunkler Track, großer greifbarer Thumb) statt Standard-accent-color mit weißem Track; Schnell-Chips raus. Startwert bleibt das zuletzt eingetragene Gewicht.
This commit is contained in:
1 parent
d26f9ee02a
commit
4545e60974
2 files changed
+14
-6
No files matched your search
+10
-1
@@ -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)}
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user