Rest timer: take 15 seconds off, not only add them

addRest now accepts a negative step, and taking off more than is left finishes the
rest instead of counting into the negative -- which also kept a negative duration out
of the progress bar and out of the server-side push schedule.

Three controls and the clock do not fit one line on a phone: at 360px the bar was
left with about 30px and stopped saying anything. The rest variant stacks -- clock and
bar on top, controls beneath, -15 and +15 together in number-line order, Skip pushed
to the far edge so the button that ends the rest is not next to the one you tap to buy
more time. Scoped to #timer.rest, so the work timer keeps its single row. Back to one
line at >=1000px, and the card is nearly opaque now -- the set rows underneath were
reading through it.
This commit is contained in:
Duarte Santos committed 2026-07-31 15:35:27 +02:00
1 parent 248da53dca
commit c5e131f81c
3 files changed
+34 -8

No files matched your search

+14 -5
View File
@@ -34,12 +34,21 @@ export default function RestTimer() {
<Button size="sm" variant="primary" icon="check" onClick={finishWorkEarly}>{t('Done')}</Button>
</div>
)
// Three controls plus the clock don't fit one line on a phone — at 360px the bar is left
// with about 30px and stops saying anything. So the rest variant stacks: clock and bar
// read at a glance, controls get their own row. −15 and +15 sit together in number-line
// order; Skip is pushed to the far edge, away from the button you tap to buy more time.
return (
<div id="timer">
<div className="t">{clock(timer.left)}</div>
<div className="bar"><i style={{ width: pct + '%' }} /></div>
<Button size="sm" icon="plus" onClick={() => addRest(15)}>15s</Button>
<Button size="sm" variant="primary" onClick={stopRest}>{t('Skip')}</Button>
<div id="timer" className="rest">
<div className="head">
<div className="t">{clock(timer.left)}</div>
<div className="bar"><i style={{ width: pct + '%' }} /></div>
</div>
<div className="acts">
<Button size="sm" icon="minus" onClick={() => addRest(-15)}>15s</Button>
<Button size="sm" icon="plus" onClick={() => addRest(15)}>15s</Button>
<Button size="sm" variant="primary" className="skip" onClick={stopRest}>{t('Skip')}</Button>
</div>
</div>
)
}