mirror of
http://nostr-git-proxy.forgejo.svc.cluster.local/git/45387ca441053e230b2126802005eb03767ab59d84555e8bac86b6e7def14e27/myadhd
synced 2026-09-23 20:23:10 +00:00
fix(sprint4): logic for Visual pie clock & interval grounding chimes
This commit is contained in:
parent
c8bb985212
commit
c654e85c8d
3 changed files with 34 additions and 14 deletions
|
|
@ -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() {
|
function timerComplete() {
|
||||||
timerStop(); beep();
|
timerStop(); beep();
|
||||||
|
|
@ -356,8 +357,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#timer-start').addEventListener('click', function () {
|
$('#timer-start').addEventListener('click', function () {
|
||||||
|
if (window.setGroundingInterval) setGroundingInterval();
|
||||||
if (timer.running) { timerStop(); $('#timer-start').textContent = 'resume'; timerPaint(); return; }
|
if (timer.running) { timerStop(); $('#timer-start').textContent = 'resume'; timerPaint(); return; }
|
||||||
timer.running = true;
|
timer.running = true;
|
||||||
|
if (window.setGroundingInterval) setGroundingInterval();
|
||||||
$('#timer-start').textContent = 'pause';
|
$('#timer-start').textContent = 'pause';
|
||||||
timer.iv = setInterval(function () {
|
timer.iv = setInterval(function () {
|
||||||
timer.left--;
|
timer.left--;
|
||||||
|
|
@ -365,6 +368,7 @@
|
||||||
if (timer.left <= 0) {
|
if (timer.left <= 0) {
|
||||||
timerComplete();
|
timerComplete();
|
||||||
return;
|
return;
|
||||||
|
if (window.groundingIv) clearInterval(groundingIv);
|
||||||
}
|
}
|
||||||
timerPaint();
|
timerPaint();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
|
||||||
|
|
@ -109,3 +109,19 @@ function setupAudioUI() {
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
setupAudioUI();
|
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);
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -289,8 +289,8 @@ input[type="text"]:focus-visible { outline: 2px solid var(--accent); outline-off
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||||
}
|
}
|
||||||
.unstuck-trigger:hover {
|
.unstuck-trigger:hover {
|
||||||
transform: translateY(-3px) scale(1.05);
|
transform: translateY(-3px) scale(1.05);
|
||||||
box-shadow: 0 8px 20px rgba(255, 126, 95, 0.6);
|
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 {
|
.close-modal {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px; right: 20px;
|
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;
|
color: var(--text-muted, #a6adc8); cursor: pointer;
|
||||||
}
|
}
|
||||||
.unstuck-phase h2 { margin-top: 0; color: var(--text-main, #cdd6f4); margin-bottom: 15px; }
|
.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 Animation - Physiological Sigh */
|
||||||
.breathing-circle-container {
|
.breathing-circle-container {
|
||||||
height: 180px;
|
height: 180px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 30px 0;
|
margin: 30px 0;
|
||||||
}
|
}
|
||||||
.breathing-circle {
|
.breathing-circle {
|
||||||
width: 80px; height: 80px; border-radius: 50%;
|
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);
|
border: 2px solid rgba(137, 180, 250, 0.8);
|
||||||
animation: breathe 8s infinite cubic-bezier(0.4, 0, 0.2, 1);
|
animation: breathe 8s infinite cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
}
|
}
|
||||||
#breathe-text {
|
#breathe-text {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: var(--text-main, #cdd6f4);
|
color: var(--text-main, #cdd6f4);
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
text-shadow: 0 2px 4px rgba(0,0,0,0.5);
|
text-shadow: 0 2px 4px rgba(0,0,0,0.5);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue