From 4b0cf8d7079d3ee857289695492fdc4c56a8c5b9 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 2 Jun 2026 09:11:02 +0000 Subject: [PATCH] a11y: add ARIA semantics and reduced-motion support to web component The embeddable calculator had no accessibility affordances. This adds: - aria-live="polite" region on the results panel so screen readers announce VM sizing/cost results when the user clicks Calculate (results were previously injected silently). - aria-hidden="true" on all decorative emoji (header, section labels, card titles, placeholder) so assistive tech no longer reads them out (e.g. "magnifying glass tilted left"). - A clean aria-label and type="button" on the Calculate button. - prefers-reduced-motion media query that disables hover transforms, transitions, and animations for users who request it. No calculation logic changes; all 65 tests still pass. --- hailbytes-vuln-calculator.js | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/hailbytes-vuln-calculator.js b/hailbytes-vuln-calculator.js index 1d2c2aa..c476eb1 100644 --- a/hailbytes-vuln-calculator.js +++ b/hailbytes-vuln-calculator.js @@ -546,6 +546,12 @@ const STYLES = ` border-left: 3px solid var(--accent); } .rec-list li::before { content: '→'; color: var(--accent); flex-shrink: 0; } + + /* Respect users who prefer reduced motion */ + @media (prefers-reduced-motion: reduce) { + *, *::before, *::after { transition: none !important; animation: none !important; } + .calc-btn:hover { transform: none; } + } `; // ─── Template ───────────────────────────────────────────────────────────────── @@ -553,7 +559,7 @@ const STYLES = ` const TMPL = document.createElement('template'); TMPL.innerHTML = `
-

🔍 Vulnerability Scanner Infrastructure Calculator HailBytes

+

Vulnerability Scanner Infrastructure Calculator HailBytes

Size your scanning infrastructure — estimate VM requirements, cloud costs, and ROI entirely in the browser

@@ -562,7 +568,7 @@ TMPL.innerHTML = `
- +
@@ -570,7 +576,7 @@ TMPL.innerHTML = `
- +
HailBytes ASM (free, self-hosted) @@ -614,7 +620,7 @@ TMPL.innerHTML = `
- +
@@ -624,13 +630,13 @@ TMPL.innerHTML = `
- +
-
+
-
🖥️
+

Configure your scan parameters and click Calculate Infrastructure to size your VM requirements.