From 0afa61cc5c5ae1c6aeacc6c7e1a39668e5928340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 24 Aug 2026 13:28:45 +0200 Subject: [PATCH] Use proper SVG icons in the touch control bar, center the middle cluster absolutely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swaps the unicode glyphs (◀ ▶ ⬆) for hand-drawn stroke/fill SVG icons (chevrons, an eject-style plunger glyph, a coin glyph, a play triangle), and positions the coin/start/plunger cluster with absolute + translate so it sits on the bar's true center regardless of the flipper buttons. --- components/hud/TouchControlBar.tsx | 78 ++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 16 deletions(-) diff --git a/components/hud/TouchControlBar.tsx b/components/hud/TouchControlBar.tsx index a0d97f1..0b10a45 100644 --- a/components/hud/TouchControlBar.tsx +++ b/components/hud/TouchControlBar.tsx @@ -25,13 +25,62 @@ function isTouchDevice(): boolean { return typeof window !== "undefined" && ("ontouchstart" in window || navigator.maxTouchPoints > 0); } +function FlipperLeftIcon() { + return ( + + + + ); +} + +function FlipperRightIcon() { + return ( + + + + ); +} + +/** Eject-style glyph (triangle over a bar) for the plunger/launch control. */ +function PlungerIcon() { + return ( + + + + + ); +} + +function CoinIcon() { + return ( + + + + + ); +} + +function PlayIcon() { + return ( + + + + ); +} + function ControlButton({ binding, label, + icon, size, }: { binding: KeyBinding; label: string; + icon: React.ReactNode; size: "lg" | "md" | "sm"; }) { const [pressed, setPressed] = useState(false); @@ -50,28 +99,23 @@ function ControlButton({ dispatchKey("keyup", binding); }, [binding]); - const sizeClasses = - size === "lg" - ? "h-20 w-20 text-3xl" - : size === "md" - ? "h-14 w-14 text-lg" - : "h-12 w-14 font-mono text-[11px] tracking-widest"; + const sizeClasses = size === "lg" ? "h-20 w-20" : size === "md" ? "h-14 w-14" : "h-12 w-12"; return ( ); } @@ -97,17 +141,19 @@ export default function TouchControlBar({ active }: TouchControlBarProps) { return (
- + } size="lg" /> -
- - - + {/* Positioned absolutely so it sits on the bar's true center, independent + of the (equal-width, so already symmetric) flipper buttons on either side. */} +
+ } size="sm" /> + } size="sm" /> + } size="md" />
- + } size="lg" />
); }