From f01824fa93325dfb13b2f374d249e8d7a357f1ac Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 25 Jul 2026 13:18:50 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20instructional?= =?UTF-8?q?=20text=20to=20mario=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds visible instructional text ("Press Space or Up Arrow to jump") to the mario-game.njk widget so users know the required keybindings. The text is styled with `pointer-events: none` to prevent it from blocking mouse interactions. Evaluated via playwright UI verification to confirm correctness. Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ src/views/mario-game.njk | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/.Jules/palette.md b/.Jules/palette.md index 8ee612f..10fef54 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-07-25 - Interactive Game Instructional Text +**Learning:** For web-based games or interactive widgets, users often don't know the required inputs. +**Action:** When building interactive HTML5 widgets or games with custom keyboard event bindings, always provide explicit, visible instructional text so users know the required inputs, and ensure it uses pointer-events: none to not block interaction. diff --git a/src/views/mario-game.njk b/src/views/mario-game.njk index 67b6bd7..c589dc5 100644 --- a/src/views/mario-game.njk +++ b/src/views/mario-game.njk @@ -52,6 +52,16 @@ font-size: 20px; font-family: Arial; } + + #instructions { + position: absolute; + top: 40px; + left: 10px; + color: rgba(255, 255, 255, 0.8); + font-size: 14px; + font-family: Arial; + pointer-events: none; + } @@ -59,6 +69,7 @@
Score: 0
+
Press Space or Up Arrow to jump