From 43e5810f366ae2c9894ef286f82a9c302df0beed Mon Sep 17 00:00:00 2001 From: Shresth Date: Mon, 8 Jun 2026 17:43:20 +0530 Subject: [PATCH] feat: improve accessibility - ARIA labels, keyboard nav, screen reader support --- index.html | 16 ++--- script.js | 181 +++++++++++++++++++++++++++++++++++++---------------- style.css | 25 ++++++++ 3 files changed, 159 insertions(+), 63 deletions(-) diff --git a/index.html b/index.html index 8631eb4..e166ab7 100644 --- a/index.html +++ b/index.html @@ -11,12 +11,12 @@ -
+ -
+
- - + +
` : ''} `; + // Move focus to result div so screen readers announce the outcome + const resultEl = document.getElementById('result'); + resultEl.setAttribute('tabindex', '-1'); + resultEl.focus(); + if (riskSectionHtml) { + // Append risk section after result card + resultEl.querySelector('.result-card').insertAdjacentHTML('beforeend', riskSectionHtml); + setTimeout(() => { const bar = document.querySelector('.risk-meter-bar'); if (bar) { @@ -438,27 +475,29 @@ async function checkSecurity() { document.getElementById('scanBtn'); btn.disabled = true; + btn.setAttribute('aria-busy', 'true'); + btn.setAttribute('aria-label', 'Scanning URL, please wait...'); // Loading State — enhanced scan animation document.getElementById('result').innerHTML = ` -
+
-
+
Scanning URL...
-
${url}
+
${url}
-
+