diff --git a/.Jules/palette.md b/.Jules/palette.md index 8ee612f..fb881dd 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -12,3 +12,6 @@ ## 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. +## 2026-05-22 - Custom Game Keybindings +**Learning:** Interactive HTML5 widgets or games with custom keyboard event bindings often completely hide their required inputs from users because native focus hints and ARIA roles don't describe custom mechanics (like 'Space to Jump'). Without explicit visual text, these components become 'mystery meat' navigation. +**Action:** Always provide explicit, visible instructional text (and corresponding screen-reader attributes) alongside the widget to clarify custom control schemes. 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..e28828b 100644 --- a/src/views/mario-game.njk +++ b/src/views/mario-game.njk @@ -52,13 +52,26 @@ font-size: 20px; font-family: Arial; } + + #controls-hint { + 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 Up Arrow to jump