fix(sprint4): logic for Visual pie clock & interval grounding chimes

This commit is contained in:
djg 2026-09-23 05:14:31 +00:00
parent c8bb985212
commit c654e85c8d
3 changed files with 34 additions and 14 deletions

View file

@ -322,7 +322,8 @@
}
}
function timerStop() { clearInterval(timer.iv); timer.iv = null; timer.running = false; timerPersist(); }
function timerStop() { clearInterval(timer.iv); timer.iv = null; timer.running = false;
if (window.groundingIv) clearInterval(groundingIv); timerPersist(); }
function timerComplete() {
timerStop(); beep();
@ -356,8 +357,10 @@
}
$('#timer-start').addEventListener('click', function () {
if (window.setGroundingInterval) setGroundingInterval();
if (timer.running) { timerStop(); $('#timer-start').textContent = 'resume'; timerPaint(); return; }
timer.running = true;
if (window.setGroundingInterval) setGroundingInterval();
$('#timer-start').textContent = 'pause';
timer.iv = setInterval(function () {
timer.left--;
@ -365,6 +368,7 @@
if (timer.left <= 0) {
timerComplete();
return;
if (window.groundingIv) clearInterval(groundingIv);
}
timerPaint();
}, 1000);

View file

@ -109,3 +109,19 @@ function setupAudioUI() {
document.addEventListener('DOMContentLoaded', () => {
setupAudioUI();
});
window.playGroundingPing = function() {
if (!audioCtx) initAudio();
var osc = audioCtx.createOscillator();
var gain = audioCtx.createGain();
osc.type = 'sine';
osc.frequency.setValueAtTime(528, audioCtx.currentTime); // 528hz droplet
gain.gain.setValueAtTime(0, audioCtx.currentTime);
gain.gain.linearRampToValueAtTime(0.3, audioCtx.currentTime + 0.1);
gain.gain.exponentialRampToValueAtTime(0.001, audioCtx.currentTime + 1.5);
osc.connect(gain);
gain.connect(masterGain);
osc.start();
osc.stop(audioCtx.currentTime + 1.5);
};

View file

@ -289,8 +289,8 @@ input[type="text"]:focus-visible { outline: 2px solid var(--accent); outline-off
z-index: 100;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.unstuck-trigger:hover {
transform: translateY(-3px) scale(1.05);
.unstuck-trigger:hover {
transform: translateY(-3px) scale(1.05);
box-shadow: 0 8px 20px rgba(255, 126, 95, 0.6);
}
@ -322,7 +322,7 @@ input[type="text"]:focus-visible { outline: 2px solid var(--accent); outline-off
.close-modal {
position: absolute;
top: 15px; right: 20px;
background: none; border: none; font-size: 28px;
background: none; border: none; font-size: 28px;
color: var(--text-muted, #a6adc8); cursor: pointer;
}
.unstuck-phase h2 { margin-top: 0; color: var(--text-main, #cdd6f4); margin-bottom: 15px; }
@ -332,23 +332,23 @@ input[type="text"]:focus-visible { outline: 2px solid var(--accent); outline-off
/* Breathing Animation - Physiological Sigh */
.breathing-circle-container {
height: 180px;
display: flex;
justify-content: center;
align-items: center;
position: relative;
height: 180px;
display: flex;
justify-content: center;
align-items: center;
position: relative;
margin: 30px 0;
}
.breathing-circle {
width: 80px; height: 80px; border-radius: 50%;
background: rgba(137, 180, 250, 0.4);
background: rgba(137, 180, 250, 0.4);
border: 2px solid rgba(137, 180, 250, 0.8);
animation: breathe 8s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
#breathe-text {
position: absolute;
font-weight: bold;
color: var(--text-main, #cdd6f4);
#breathe-text {
position: absolute;
font-weight: bold;
color: var(--text-main, #cdd6f4);
font-size: 1.2em;
text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}