From 0d445c12c895e97b532060933fd39a030213c611 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 24 May 2026 13:19:38 +0000 Subject: [PATCH] feat(mario): add visual keyboard instructions and aria-live to score MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adds an overlay explaining keyboard controls ("Space or ↑ to Jump") - Adds `aria-live="polite"` to the `#score` element for screen readers - Cleans up `venv` from `requirements.txt` to fix pip install failures Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ requirements.txt | 1 - src/views/mario-game.njk | 15 ++++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index 8ee612f..a90e0fa 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -12,3 +12,7 @@ ## 2025-03-23 - Game Key Scrolling **Learning:** Browsers natively scroll the page when users press Space or Arrow keys. When building a web-based game, this creates a frustrating UX where the game viewport jumps around while playing. **Action:** Always call `e.preventDefault()` on keydown events for typical game controls ("Space", "ArrowUp", etc.) when the focus is on a game container or the body. + +## 2025-05-24 - Interactive Web Widget Accessibility +**Learning:** For interactive web elements like browser-based games or custom widgets, visual affordances for keyboard controls are essential since they lack native semantics. Dynamic text like scoreboards also need `aria-live` to inform screen reader users of continuous updates. +**Action:** Always provide explicit, visible instructional text for custom keyboard bindings and append `aria-live="polite"` and `aria-atomic="true"` to dynamic score/status elements to maintain full accessibility. diff --git a/requirements.txt b/requirements.txt index cfaa995..4ad1501 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ numpy pandas requests -venv diff --git a/src/views/mario-game.njk b/src/views/mario-game.njk index 67b6bd7..b1b1981 100644 --- a/src/views/mario-game.njk +++ b/src/views/mario-game.njk @@ -52,13 +52,26 @@ font-size: 20px; font-family: Arial; } + + #instructions { + position: absolute; + top: 10px; + right: 10px; + color: white; + font-size: 16px; + font-family: Arial; + background: rgba(0, 0, 0, 0.5); + padding: 5px 10px; + border-radius: 5px; + }
-
Score: 0
+
Score: 0
+
Press Space or ↑ to Jump