mirror of
http://nostr-git-proxy.forgejo.svc.cluster.local/git/45387ca441053e230b2126802005eb03767ab59d84555e8bac86b6e7def14e27/myadhd
synced 2026-09-23 20:23:10 +00:00
Merge branch 'fix/brain-dump-popup-dismiss' into main
All checks were successful
Build and Deploy / deploy (push) Successful in 16s
All checks were successful
Build and Deploy / deploy (push) Successful in 16s
This commit is contained in:
commit
1f5ea01cf3
3 changed files with 137 additions and 40 deletions
|
|
@ -43,14 +43,18 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Quick Capture Overlay -->
|
<!-- Quick Capture Overlay -->
|
||||||
<div id="quick-capture-overlay" class="completion-overlay" hidden>
|
<div id="quick-capture-overlay" class="completion-overlay" role="dialog" aria-modal="true" aria-labelledby="quick-capture-title" hidden>
|
||||||
<div class="completion-card">
|
<div class="completion-card">
|
||||||
<h2>Brain Dump (Parking Lot)</h2>
|
<button id="quick-capture-close" class="modal-close" aria-label="Close dialog" type="button">×</button>
|
||||||
<p style="margin-top:-5px; font-size:0.9rem; color:var(--dim);">Clear your mind. We'll save it to your unsorted list.</p>
|
<h2 id="quick-capture-title">Brain Dump (Parking Lot)</h2>
|
||||||
<input type="text" id="quick-capture-input" placeholder="What's distracting you?" autocomplete="off" style="width:100%;font-size:1.2rem;padding:15px;background:var(--bg-hover);border:2px solid var(--border);color:var(--text);border-radius:8px;margin-bottom:10px;margin-top:15px;" />
|
<p style="margin-top:-5px; font-size:0.9rem; color:var(--dim);">Clear your mind. We'll save it to your brain dump inbox.</p>
|
||||||
<div style="text-align:right;">
|
<form id="quick-capture-form" action="#" style="margin-top:15px;">
|
||||||
<span class="tiny dim">Press Esc to cancel, Enter to save</span>
|
<input type="text" id="quick-capture-input" name="task" placeholder="What's distracting you?" autocomplete="off" required style="width:100%;font-size:1.1rem;padding:12px 14px;background:var(--bg2);border:1.5px solid var(--line);color:var(--text);border-radius:10px;margin-bottom:14px;outline:none;" />
|
||||||
</div>
|
<div class="row between center gap" style="margin-top:4px;">
|
||||||
|
<span class="tiny dim">Press Esc to cancel, Enter to save</span>
|
||||||
|
<button type="submit" class="btn primary" id="quick-capture-submit">Save thought</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
||||||
|
|
@ -589,6 +589,12 @@
|
||||||
nowShowNext(true);
|
nowShowNext(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#timer-complete').addEventListener('click', function (e) {
|
||||||
|
if (e.target === this) {
|
||||||
|
this.hidden = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
timerPaint();
|
timerPaint();
|
||||||
|
|
||||||
/* ---------- dopamine menu ---------- */
|
/* ---------- dopamine menu ---------- */
|
||||||
|
|
@ -1044,11 +1050,19 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
if (closeBtn) {
|
if (closeBtn) {
|
||||||
closeBtn.onclick = function () {
|
closeBtn.onclick = function () {
|
||||||
modal.hidden = true;
|
modal.hidden = true;
|
||||||
}
|
if (!isManual) stampVisit();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modal.onclick = function (e) {
|
||||||
|
if (e.target === modal) {
|
||||||
|
modal.hidden = true;
|
||||||
|
if (!isManual) stampVisit();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
modal.hidden = false;
|
modal.hidden = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1068,39 +1082,107 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------- quick capture overlay ---------- */
|
||||||
|
var $qcOverlay = $('#quick-capture-overlay'),
|
||||||
|
$qcForm = $('#quick-capture-form'),
|
||||||
|
$qcInput = $('#quick-capture-input'),
|
||||||
|
$qcClose = $('#quick-capture-close');
|
||||||
|
|
||||||
|
function openQuickCapture() {
|
||||||
|
if (!$qcOverlay) return;
|
||||||
|
$qcOverlay.hidden = false;
|
||||||
|
if ($qcInput) {
|
||||||
|
$qcInput.value = '';
|
||||||
|
setTimeout(function () { $qcInput.focus(); }, 50);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeQuickCapture() {
|
||||||
|
if (!$qcOverlay) return;
|
||||||
|
$qcOverlay.hidden = true;
|
||||||
|
if ($qcInput) $qcInput.value = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($qcForm) {
|
||||||
|
$qcForm.addEventListener('submit', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
if (!$qcInput) return;
|
||||||
|
var val = $qcInput.value.trim();
|
||||||
|
if (!val) return;
|
||||||
|
inboxItems.unshift(val);
|
||||||
|
saveInbox();
|
||||||
|
closeQuickCapture();
|
||||||
|
tickSound();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($qcClose) {
|
||||||
|
$qcClose.addEventListener('click', closeQuickCapture);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($qcOverlay) {
|
||||||
|
$qcOverlay.addEventListener('click', function (e) {
|
||||||
|
if (e.target === this) {
|
||||||
|
closeQuickCapture();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------- keyboard shortcuts ---------- */
|
/* ---------- keyboard shortcuts ---------- */
|
||||||
document.addEventListener('keydown', function (e) {
|
document.addEventListener('keydown', function (e) {
|
||||||
|
// Escape closes any open modal/overlay regardless of current focus
|
||||||
|
if (e.key === 'Escape') {
|
||||||
|
var qc = document.getElementById('quick-capture-overlay');
|
||||||
|
if (qc && !qc.hidden) {
|
||||||
|
closeQuickCapture();
|
||||||
|
e.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var sweep = document.getElementById('sweep-modal');
|
||||||
|
if (sweep && !sweep.hidden) {
|
||||||
|
sweep.hidden = true;
|
||||||
|
if (typeof stampVisit === 'function') stampVisit();
|
||||||
|
e.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var unstuck = document.getElementById('unstuck-modal');
|
||||||
|
if (unstuck && !unstuck.hidden) {
|
||||||
|
unstuck.hidden = true;
|
||||||
|
if (typeof unstuckInterval !== 'undefined') clearInterval(unstuckInterval);
|
||||||
|
if (typeof breathInterval !== 'undefined') clearInterval(breathInterval);
|
||||||
|
e.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var tc = document.getElementById('timer-complete');
|
||||||
|
if (tc && !tc.hidden) {
|
||||||
|
tc.hidden = true;
|
||||||
|
e.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var ambPanel = document.getElementById('ambient-panel');
|
||||||
|
if (ambPanel && !ambPanel.hidden) {
|
||||||
|
ambPanel.hidden = true;
|
||||||
|
e.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Quick Capture (Alt+P) - active globally
|
// Quick Capture (Alt+P) - active globally
|
||||||
if (e.altKey && (e.key === 'p' || e.key === 'P')) {
|
if (e.altKey && (e.key === 'p' || e.key === 'P')) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var overlay = document.getElementById('quick-capture-overlay');
|
if ($qcOverlay && $qcOverlay.hidden) {
|
||||||
if (overlay.hidden) {
|
openQuickCapture();
|
||||||
overlay.hidden = false;
|
|
||||||
document.getElementById('quick-capture-input').value = '';
|
|
||||||
document.getElementById('quick-capture-input').focus();
|
|
||||||
} else {
|
} else {
|
||||||
overlay.hidden = true;
|
closeQuickCapture();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Quick capture handling inside input
|
|
||||||
if (e.target.id === 'quick-capture-input') {
|
// Don't trigger standard navigation shortcuts when typing in an input or contenteditable
|
||||||
if (e.key === 'Escape') {
|
|
||||||
document.getElementById('quick-capture-overlay').hidden = true;
|
|
||||||
} else if (e.key === 'Enter' && e.target.value.trim() !== '') {
|
|
||||||
var unTasks = store('unsorted_tasks') || [];
|
|
||||||
unTasks.push({ text: e.target.value.trim(), created: Date.now() });
|
|
||||||
store('unsorted_tasks', unTasks);
|
|
||||||
if (typeof unPaint === 'function') unPaint();
|
|
||||||
document.getElementById('quick-capture-overlay').hidden = true;
|
|
||||||
e.target.value = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Don't trigger shortcuts when typing in an input or contenteditable
|
|
||||||
var tag = e.target.tagName;
|
var tag = e.target.tagName;
|
||||||
if (tag === 'INPUT' || tag === 'TEXTAREA' || e.target.contentEditable === 'true') return;
|
if (tag === 'INPUT' || tag === 'TEXTAREA' || e.target.contentEditable === 'true') return;
|
||||||
|
|
||||||
// Number keys 1-4 switch tabs
|
// Number keys 1-5 switch tabs
|
||||||
if (e.key === '1') { showTab('breaker'); e.preventDefault(); }
|
if (e.key === '1') { showTab('breaker'); e.preventDefault(); }
|
||||||
if (e.key === '2') { showTab('timer'); e.preventDefault(); }
|
if (e.key === '2') { showTab('timer'); e.preventDefault(); }
|
||||||
if (e.key === '3') { showTab('dopamine'); e.preventDefault(); }
|
if (e.key === '3') { showTab('dopamine'); e.preventDefault(); }
|
||||||
|
|
@ -1112,14 +1194,6 @@
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('#timer-start').click();
|
$('#timer-start').click();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Escape to close completion overlay
|
|
||||||
if (e.key === 'Escape') {
|
|
||||||
var overlay = $('#timer-complete');
|
|
||||||
if (overlay && !overlay.hidden) {
|
|
||||||
overlay.hidden = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1309,6 +1383,14 @@
|
||||||
clearInterval(breathInterval);
|
clearInterval(breathInterval);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modal.addEventListener('click', (e) => {
|
||||||
|
if (e.target === modal) {
|
||||||
|
modal.hidden = true;
|
||||||
|
clearInterval(unstuckInterval);
|
||||||
|
clearInterval(breathInterval);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Proceed from phase 1 to 2
|
// Proceed from phase 1 to 2
|
||||||
$('#unstuck-next-1').addEventListener('click', () => {
|
$('#unstuck-next-1').addEventListener('click', () => {
|
||||||
p1.hidden = true;
|
p1.hidden = true;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/* myadhd.dev — calm, low-stimulation dark theme */
|
/* myadhd.dev — calm, low-stimulation dark theme */
|
||||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
|
[hidden] { display: none !important; }
|
||||||
:root {
|
:root {
|
||||||
--bg: #14141c;
|
--bg: #14141c;
|
||||||
--bg2: #1b1b26;
|
--bg2: #1b1b26;
|
||||||
|
|
@ -182,10 +183,14 @@ input[type="text"]:focus-visible { outline: 2px solid var(--accent); outline-off
|
||||||
display: flex; align-items: center; justify-content: center;
|
display: flex; align-items: center; justify-content: center;
|
||||||
animation: fadeIn 0.3s ease;
|
animation: fadeIn 0.3s ease;
|
||||||
}
|
}
|
||||||
|
.completion-overlay[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
.completion-card {
|
.completion-card {
|
||||||
background: var(--card); border: 1.5px solid var(--accent-dim);
|
background: var(--card); border: 1.5px solid var(--accent-dim);
|
||||||
border-radius: var(--radius); padding: 40px 32px;
|
border-radius: var(--radius); padding: 40px 32px;
|
||||||
max-width: 400px; text-align: center;
|
max-width: 400px; text-align: center;
|
||||||
|
position: relative;
|
||||||
animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
|
animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||||
}
|
}
|
||||||
.completion-emoji { font-size: 3rem; margin-bottom: 12px; }
|
.completion-emoji { font-size: 3rem; margin-bottom: 12px; }
|
||||||
|
|
@ -319,11 +324,17 @@ input[type="text"]:focus-visible { outline: 2px solid var(--accent); outline-off
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-shadow: 0 20px 40px rgba(0,0,0,0.5);
|
box-shadow: 0 20px 40px rgba(0,0,0,0.5);
|
||||||
}
|
}
|
||||||
.close-modal {
|
.close-modal, .modal-close {
|
||||||
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;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 4px;
|
||||||
|
transition: color 0.15s ease;
|
||||||
|
}
|
||||||
|
.close-modal:hover, .modal-close:hover {
|
||||||
|
color: var(--text, #e6e6f0);
|
||||||
}
|
}
|
||||||
.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; }
|
||||||
.unstuck-phase p { color: var(--text-main, #bac2de); margin-bottom: 25px; font-size: 1.1em; line-height: 1.4;}
|
.unstuck-phase p { color: var(--text-main, #bac2de); margin-bottom: 25px; font-size: 1.1em; line-height: 1.4;}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue