feat(timer): feature B - time-blindness clock & grounding interval chimes

This commit is contained in:
djg 2026-09-23 04:38:31 +00:00
parent 242c855004
commit 660c0f82c5
2 changed files with 48 additions and 0 deletions

View file

@ -101,11 +101,27 @@
<button class="chip preset break" data-min="5" aria-label="5 minute break">5 min break</button> <button class="chip preset break" data-min="5" aria-label="5 minute break">5 min break</button>
<button class="chip preset break" data-min="15" aria-label="15 minute break">15 min break</button> <button class="chip preset break" data-min="15" aria-label="15 minute break">15 min break</button>
</div> </div>
<div class="row center gap" style="margin-bottom: 12px; margin-top: -8px;">
<button class="btn ghost toggle-visual" id="timer-mode-toggle" aria-label="Toggle Pie Clock Mode">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right:8px; vertical-align:text-bottom;">
<circle cx="12" cy="12" r="10"></circle>
<path d="M12 2v10l5.5 5.5"></path>
</svg>
switch to visual pie clock
</button>
</div>
<div class="timer-wrap"> <div class="timer-wrap">
<svg viewBox="0 0 220 220" class="ring" aria-hidden="true"> <svg viewBox="0 0 220 220" class="ring" aria-hidden="true">
<circle class="ring-bg" cx="110" cy="110" r="100"/> <circle class="ring-bg" cx="110" cy="110" r="100"/>
<circle id="ring-fg" class="ring-fg" cx="110" cy="110" r="100"/> <circle id="ring-fg" class="ring-fg" cx="110" cy="110" r="100"/>
</svg> </svg>
<!-- Visual Pie Mode overlay -->
<svg viewBox="0 0 220 220" class="ring pie-mode" id="ring-pie-svg" aria-hidden="true" style="display:none; transform: rotate(-90deg); border-radius: 50%; opacity: 0.9;">
<circle class="ring-bg" cx="110" cy="110" r="100"/>
<path id="ring-pie-path" d="M110,110 L110,10 A100,100 0 1,1 10,110 Z" fill="var(--primary)" />
</svg>
<div class="timer-readout"> <div class="timer-readout">
<div id="timer-time" class="timer-time">25:00</div> <div id="timer-time" class="timer-time">25:00</div>
<div id="timer-phase" class="timer-phase">pick a length</div> <div id="timer-phase" class="timer-phase">pick a length</div>
@ -118,6 +134,18 @@
<p class="tiny" id="timer-note">Tip: 25 minutes is a suggestion, not a law. The best length is the one you'll actually start.</p> <p class="tiny" id="timer-note">Tip: 25 minutes is a suggestion, not a law. The best length is the one you'll actually start.</p>
</div> </div>
<div class="card center" style="margin-top: 16px;">
<h3>Interval Grounding</h3>
<p class="tiny" style="margin-bottom: 12px; margin-top: 4px;">Time blindness? A soft 528Hz droplet chime will ground you every few minutes to pull you out of rabbit holes.</p>
<div class="presets" style="margin-bottom: 8px;">
<button class="chip preset grounding-chime" data-interval="5" aria-label="Every 5 minutes">5 min pings</button>
<button class="chip preset grounding-chime" data-interval="10" aria-label="Every 10 minutes">10 min pings</button>
<button class="chip preset grounding-chime active" data-interval="0" aria-label="Off">Off</button>
</div>
</div>
<div class="card center" style="margin-top: 16px;"> <div class="card center" style="margin-top: 16px;">
<h3>Focus soundscapes</h3> <h3>Focus soundscapes</h3>
<p class="tiny" style="margin-bottom: 16px; margin-top: 4px;">Locally generated procedural audio to help you focus. No internet required!</p> <p class="tiny" style="margin-bottom: 16px; margin-top: 4px;">Locally generated procedural audio to help you focus. No internet required!</p>

View file

@ -361,3 +361,23 @@ input[type="text"]:focus-visible { outline: 2px solid var(--accent); outline-off
50% { transform: scale(2.0); } /* Brief hold */ 50% { transform: scale(2.0); } /* Brief hold */
100% { transform: scale(1); } /* Slow extended exhale (4s) */ 100% { transform: scale(1); } /* Slow extended exhale (4s) */
} }
.ring.pie-mode {
transition: opacity 0.3s;
}
#ring-pie-path {
transform-origin: 110px 110px;
transition: d 1s linear;
}
#ring-pie-svg.alert-amber #ring-pie-path {
fill: #f59e0b; /* Amber */
animation: pulse-amber 4s infinite alternate;
}
@keyframes pulse-amber {
0% { fill: #d97706; }
100% { fill: #f59e0b; }
}