From d970b393b99a2cbb28a3e89dbcded220366627cf Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 13:44:48 +0000 Subject: [PATCH] feat: Semantic keyboard shortcuts and styling for game instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrapped the key bindings (Space and ↑) in the game instructions using semantic tags and added physical key styling using box-shadows, text-shadows, and monospace fonts to improve discoverability and intuitive UX. Also recorded UX learnings to the palette journal. Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 3 +++ src/views/mario-game.njk | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index 49b0751..b96fc5d 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -19,3 +19,6 @@ ## 2024-08-06 - Screen Reader Accessible Dynamic Text **Learning:** Dynamic text changes, like game scores, are invisible to screen readers unless explicitly marked. Do not place static text (like instructions) inside an `aria-live` region, as it forces screen readers to unnecessarily repeat the static text every time the dynamic content updates. Extract static text into a separate sibling element. **Action:** Add `aria-live="polite"` to the container of the dynamic value and extract static text out of it. +## 2026-08-24 - Semantic Keyboard Shortcuts +**Learning:** Explicitly highlighting keyboard shortcuts using semantic tags with physical key styling improves intuitiveness and discoverability. Applying text-shadows ensures high contrast against dynamic backgrounds. +**Action:** Always wrap key shortcuts in and apply text-shadows and physical key styling to ensure high contrast against dynamic backgrounds. diff --git a/src/views/mario-game.njk b/src/views/mario-game.njk index c84e3f2..95dc305 100644 --- a/src/views/mario-game.njk +++ b/src/views/mario-game.njk @@ -62,6 +62,18 @@ font-family: Arial; pointer-events: none; } + + kbd { + background-color: #f7f7f7; + color: #333; + border: 1px solid #ccc; + border-radius: 4px; + padding: 2px 6px; + font-size: 14px; + font-family: monospace; + box-shadow: 0 2px 0 rgba(0,0,0,0.2); + text-shadow: 1px 1px 0 #fff; + } @@ -69,7 +81,7 @@
Score: 0
-
Press Space or ↑ to jump!
+
Press Space or to jump!