Timer flash: blink the real theme instead of a black/white overlay, skip it while the app is backgrounded
The completion alert (Settings → "Flash screen when timer ends") laid an opaque black/white rectangle over the whole screen, so the app's own UI flickered into view between pulses. It now flips document.documentElement's data-theme (light/dark) three times and settles back on whatever theme the user actually had — same duration, no overlay, no rectangle. Fully dark -> light, dark, light; fully light -> dark, light, dark; either way it lands back where it started. Separately: the rest/work timers reuse their tick on 'visibilitychange' to stay accurate after the tab is throttled in the background. That reuse had a side effect — reopening the app (or the tab regaining focus) after the countdown had already finished while hidden replayed the completion beep, vibration, flash and toast, even though nothing was actually watching when it ended. Now those perceptible effects only fire if the countdown reaches zero while the app is genuinely visible; finishing hidden only sends the existing push notification, and reopening later stays silent.
This commit is contained in:
1 parent
272bf785ee
commit
ad4bee99be
4 files changed
+72
-21
No files matched your search
@@ -802,19 +802,6 @@ h4.sec{
|
||||
.glyph-cell:active{transform:scale(.92)}
|
||||
.glyph-cell.on{background:var(--acc);color:var(--on-acc)}
|
||||
|
||||
/* --- opt-in timer completion flash ---
|
||||
Four deliberate pulses over 2.4s stay below three flashes per second. Transparent
|
||||
gaps keep the black and white pulses visually distinct. */
|
||||
.timer-flash{
|
||||
position:fixed;inset:0;z-index:1000;pointer-events:none;opacity:0;
|
||||
animation:timer-flash-four 2.4s linear both;
|
||||
}
|
||||
@keyframes timer-flash-four{
|
||||
0%,20%,28%,48%,56%,76%,84%,100%{opacity:0}
|
||||
4%,16%,60%,72%{background:#000;opacity:1}
|
||||
32%,44%,88%,96%{background:#fff;opacity:1}
|
||||
}
|
||||
|
||||
/* --- big weight readout --- */
|
||||
.bwstep{display:flex;align-items:center;justify-content:center;gap:18px;margin:14px 0 6px}
|
||||
.bw-pm{
|
||||
|
||||
Reference in new issue
Block a user