From b70c67b5b2ad15fa25ae9c3b97f51aea1fb2d960 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 2 Jan 2026 22:01:17 +0000 Subject: [PATCH] Changes --- src/components/MobileControlsDock.tsx | 40 ++++++++++ src/pages/Breakout.tsx | 43 ++++++----- src/pages/Pacman.tsx | 55 ++++++++------ src/pages/Snake.tsx | 57 ++++++++------ src/pages/SnakeMultiplayer.tsx | 105 +++++++++++++++++--------- src/pages/Tetris.tsx | 53 +++++++------ 6 files changed, 228 insertions(+), 125 deletions(-) create mode 100644 src/components/MobileControlsDock.tsx diff --git a/src/components/MobileControlsDock.tsx b/src/components/MobileControlsDock.tsx new file mode 100644 index 0000000..3ec2eee --- /dev/null +++ b/src/components/MobileControlsDock.tsx @@ -0,0 +1,40 @@ +import React from "react"; + +type MobileControlsDockProps = { + children: React.ReactNode; + /** When false, renders nothing. */ + visible?: boolean; + /** Optional override for the outer z-index. */ + zIndexClassName?: string; +}; + +/** + * Fixed bottom dock for mobile game controls. + * - Always visible on screen + * - Respects iOS safe-area + * - Keeps design tokens (no raw colors) + */ +export function MobileControlsDock({ + children, + visible = true, + zIndexClassName = "z-[70]", +}: MobileControlsDockProps) { + if (!visible) return null; + + return ( +
+
+
+ {children} +
+
+
+ ); +} + +/** Spacer to prevent fixed dock from covering page content in scroll containers. */ +export function MobileControlsSpacer({ heightClassName = "h-40" }: { heightClassName?: string }) { + return