From 233fd9fd29282014ce7486c222e29a770b25bc2d Mon Sep 17 00:00:00 2001 From: 0m364 <13804150+0m364@users.noreply.github.com> Date: Tue, 16 Jun 2026 11:25:38 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Make=20OSINT=20anchor?= =?UTF-8?q?=20buttons=20accessible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 💡 What: Added `role="button"`, `aria-haspopup="dialog"`, and explicit Space/Spacebar keydown handling (via JS) to `#sitrep-btn` anchors across HTML files. 🎯 Why: Native anchors with `href="#"` used to open modals do not inherently support the Space key for activation, and screen readers read them merely as links. This makes them fully accessible buttons. 📸 Before/After: Visuals didn't change, but semantics and keyboard UX are now robust. ♿ Accessibility: Improved screen reader announcements and corrected keyboard interaction handling for the `Space` key. --- .Jules/palette.md | 4 ++++ concepts.html | 2 +- contact.html | 2 +- modal.js | 8 +++++++- products.html | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index 7c7c523..310fee2 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -29,3 +29,7 @@ ## 2026-06-12 - Robust Skip-to-Content Links **Learning:** Adding a "Skip to main content" link is a critical accessibility requirement for keyboard users. To make it robust, it needs to be hidden visually but appear when focused using `transform: translateY(-100%)` instead of magic pixel numbers, and the target container (e.g., `
`) must have a matching `id` and `tabindex="-1"` so it can programmatically receive focus across all browsers. **Action:** Always include a visually hidden 'Skip to main content' link immediately after the opening `` tag. Set the main content container with an `id` and explicitly `tabindex="-1"`. + +## 2026-06-16 - Accessible Anchor Buttons +**Learning:** When using `` tags with `href="#"` as buttons to trigger actions like opening a modal, native anchors only trigger on `Enter`. Screen readers and keyboard users expect buttons to respond to both `Enter` and `Space`. Furthermore, the default behavior of `Space` on the document body is to scroll down, which is disruptive. +**Action:** Enforce accessibility by adding `role="button"` and `aria-haspopup="dialog"`. Additionally, bind a JavaScript `keydown` event listener for the `Space` key (using `e.preventDefault()` to stop default page scrolling) to invoke the action correctly. diff --git a/concepts.html b/concepts.html index d4e1807..13b8873 100644 --- a/concepts.html +++ b/concepts.html @@ -19,7 +19,7 @@

CHARLES WILLIAMS

Products Concepts Contact - OSINT + OSINT
diff --git a/contact.html b/contact.html index b30b503..a6d680c 100644 --- a/contact.html +++ b/contact.html @@ -49,7 +49,7 @@

Get in Touch

- + OSINT diff --git a/modal.js b/modal.js index 994d6bd..5ff6a52 100644 --- a/modal.js +++ b/modal.js @@ -55,7 +55,13 @@ const openModal = (e) => { // Open modal const btns = document.querySelectorAll('#sitrep-btn'); btns.forEach(btn => { - btn.addEventListener('click', openModal); + btn.addEventListener('click', (e) => openModal(e)); + btn.addEventListener('keydown', (e) => { + if (e.key === ' ' || e.key === 'Spacebar') { + e.preventDefault(); + openModal(e); + } + }); }); // Close modal via button diff --git a/products.html b/products.html index f5f0835..01f1a6c 100644 --- a/products.html +++ b/products.html @@ -20,7 +20,7 @@

CHARLES WILLIAMS

Products Concepts Contact - OSINT + OSINT