diff --git a/site/index.html b/site/index.html
index c2b7c82..3f3f642 100644
--- a/site/index.html
+++ b/site/index.html
@@ -43,14 +43,18 @@
-
+
-
Brain Dump (Parking Lot)
-
Clear your mind. We'll save it to your unsorted list.
-
-
- Press Esc to cancel, Enter to save
-
+
+
Brain Dump (Parking Lot)
+
Clear your mind. We'll save it to your brain dump inbox.
+
diff --git a/site/static/app.js b/site/static/app.js
index 80a1ba2..c3047bd 100644
--- a/site/static/app.js
+++ b/site/static/app.js
@@ -589,6 +589,12 @@
nowShowNext(true);
});
+ $('#timer-complete').addEventListener('click', function (e) {
+ if (e.target === this) {
+ this.hidden = true;
+ }
+ });
+
timerPaint();
/* ---------- dopamine menu ---------- */
@@ -1044,11 +1050,19 @@
};
if (closeBtn) {
- closeBtn.onclick = function () {
- modal.hidden = true;
- }
+ closeBtn.onclick = function () {
+ modal.hidden = true;
+ if (!isManual) stampVisit();
+ };
}
+ modal.onclick = function (e) {
+ if (e.target === modal) {
+ modal.hidden = true;
+ if (!isManual) stampVisit();
+ }
+ };
+
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 ---------- */
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
if (e.altKey && (e.key === 'p' || e.key === 'P')) {
e.preventDefault();
- var overlay = document.getElementById('quick-capture-overlay');
- if (overlay.hidden) {
- overlay.hidden = false;
- document.getElementById('quick-capture-input').value = '';
- document.getElementById('quick-capture-input').focus();
+ if ($qcOverlay && $qcOverlay.hidden) {
+ openQuickCapture();
} else {
- overlay.hidden = true;
+ closeQuickCapture();
}
return;
}
- // Quick capture handling inside input
- if (e.target.id === 'quick-capture-input') {
- 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
+
+ // Don't trigger standard navigation shortcuts when typing in an input or contenteditable
var tag = e.target.tagName;
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 === '2') { showTab('timer'); e.preventDefault(); }
if (e.key === '3') { showTab('dopamine'); e.preventDefault(); }
@@ -1112,14 +1194,6 @@
e.preventDefault();
$('#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);
});
+ modal.addEventListener('click', (e) => {
+ if (e.target === modal) {
+ modal.hidden = true;
+ clearInterval(unstuckInterval);
+ clearInterval(breathInterval);
+ }
+ });
+
// Proceed from phase 1 to 2
$('#unstuck-next-1').addEventListener('click', () => {
p1.hidden = true;
diff --git a/site/static/style.css b/site/static/style.css
index da4a65e..b85db56 100644
--- a/site/static/style.css
+++ b/site/static/style.css
@@ -1,5 +1,6 @@
/* myadhd.dev — calm, low-stimulation dark theme */
* { box-sizing: border-box; margin: 0; padding: 0; }
+[hidden] { display: none !important; }
:root {
--bg: #14141c;
--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;
animation: fadeIn 0.3s ease;
}
+.completion-overlay[hidden] {
+ display: none !important;
+}
.completion-card {
background: var(--card); border: 1.5px solid var(--accent-dim);
border-radius: var(--radius); padding: 40px 32px;
max-width: 400px; text-align: center;
+ position: relative;
animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.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;
box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
-.close-modal {
+.close-modal, .modal-close {
position: absolute;
top: 15px; right: 20px;
background: none; border: none; font-size: 28px;
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 p { color: var(--text-main, #bac2de); margin-bottom: 25px; font-size: 1.1em; line-height: 1.4;}