Skip to content

Commit 547840c

Browse files
committed
fix: center game controls in playground mode
🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 55379c1 commit 547840c

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ const elements = {
147147
previewSection: document.querySelector(".preview-section"),
148148
prevBtn: document.getElementById("prev-btn"),
149149
nextBtn: document.getElementById("next-btn"),
150+
gameControls: document.querySelector(".game-controls"),
150151
levelIndicator: document.getElementById("level-indicator"),
151152
headerLevelPill: document.getElementById("header-level-pill"),
152153

@@ -708,9 +709,10 @@ function updateNavigationButtons() {
708709
const engineState = lessonEngine.getCurrentState();
709710
const isPlayground = engineState.lesson?.mode === "playground";
710711

711-
// Hide nav buttons in playground mode
712+
// Hide nav buttons and center controls in playground mode
712713
elements.prevBtn.classList.toggle("hidden", isPlayground);
713714
elements.nextBtn.classList.toggle("hidden", isPlayground);
715+
elements.gameControls?.classList.toggle("centered", isPlayground);
714716

715717
if (!isPlayground) {
716718
elements.prevBtn.disabled = !engineState.canGoPrev;

src/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,10 @@ kbd {
891891
box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.08);
892892
}
893893

894+
.game-controls.centered {
895+
justify-content: center;
896+
}
897+
894898
/* ================= SIDEBAR ================= */
895899
.sidebar-backdrop {
896900
position: fixed;

0 commit comments

Comments
 (0)