From 529b44934582015f1fdd50baf90a78f2a6e1efd2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:02:06 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Improve=20accessibili?= =?UTF-8?q?ty=20for=20text=20fragmentation=20animations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added `aria-label` to parent elements and `aria-hidden="true"` to animated character spans in `six.html`. - Updated `css/style.css` to trigger animations on `:focus-visible` for keyboard parity. - Added visible focus indicators for links in `css/style.css`. - Documented accessibility learnings in `.Jules/palette.md`. Co-authored-by: void032 <129795373+void032@users.noreply.github.com> --- .Jules/palette.md | 3 +++ css/style.css | 12 ++++++++++-- six.html | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .Jules/palette.md diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 0000000..6c8e089 --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,3 @@ +## 2025-05-14 - [A11y for Text Fragmentation] +**Learning:** Fragmenting text into spans for animation (e.g., character-by-character effects) breaks screen reader clarity by treating each character as a separate entity. Always use `aria-label` on the parent interactive element to preserve the full text and set `aria-hidden="true"` on the individual character spans. Additionally, hover animations must always have a `:focus-visible` counterpart for keyboard accessibility. +**Action:** Automatically apply `aria-label` and `aria-hidden` when using character fragmentation scripts and ensure `:focus-visible` triggers are included in CSS. diff --git a/css/style.css b/css/style.css index cf8e61a..6a644c0 100644 --- a/css/style.css +++ b/css/style.css @@ -78,7 +78,8 @@ body { } /* Apply the animation on hover */ - .logo a:hover span { + .logo a:hover span, + .logo a:focus-visible span { animation: showlogoLetters 0.2s ease forwards; /* Play animation on hover and keep the final state */ } @@ -124,7 +125,8 @@ body { } /* Apply the animation on hover */ - .item a:hover span { + .item a:hover span, + .item a:focus-visible span { animation: showLetters 0.2s ease forwards; /* Play animation on hover and keep the final state */ } @@ -188,6 +190,12 @@ body { .center-text h1::after { filter: blur(10px); } + + a:focus-visible { + outline: 2px solid #C3F2FF; + outline-offset: 4px; + border-radius: 2px; + } @keyframes rotate { 0% { diff --git a/six.html b/six.html index 810f374..67678d2 100644 --- a/six.html +++ b/six.html @@ -148,8 +148,9 @@

Explore The Space

function wrapCharacters(element) { const text = element.innerText; + element.setAttribute("aria-label", text); const characters = text.split(""); - const wrappedText = characters.map(char => `${char}`).join(""); + const wrappedText = characters.map(char => ``).join(""); element.innerHTML = wrappedText; }