From 85a72258f58ec5bb1362a2d99b47463e7f78b107 Mon Sep 17 00:00:00 2001 From: Dicken Date: Fri, 26 Jun 2026 17:10:15 +0200 Subject: [PATCH] fix: Hex Wars - Grid passt aufs Handy, weniger Overhead --- frontend/src/tools/gebietseroberung.jsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/frontend/src/tools/gebietseroberung.jsx b/frontend/src/tools/gebietseroberung.jsx index 65aa478..6287adf 100644 --- a/frontend/src/tools/gebietseroberung.jsx +++ b/frontend/src/tools/gebietseroberung.jsx @@ -216,11 +216,12 @@ function GameBoard({ game, myId, onMove, toast }) { } const vw = Math.min(window.innerWidth, 600); - // Verfügbare Höhe: Viewport minus Header (~48px) minus Scoreboard (~72px) minus Status (~40px) minus Legende (~24px) minus Puffer (20px) - const availH = window.innerHeight - 204; + // Overhead: h2-Header(36) + Scoreboard(56) + MineAlert(0-52) + Banner(0-48) + Status(32) + Legende(28) + Puffer(32) = ~260px worst case + const availH = window.innerHeight - 260; const byWidth = Math.floor((vw - 32) / GRID); const byHeight = Math.floor(availH / GRID); const cellSize = Math.max(10, Math.min(byWidth, byHeight)); + const gridPx = cellSize * GRID + 19 + 6; // gap(19) + padding(6) // Zell-Rendering const renderCell = (r, c) => { @@ -278,15 +279,15 @@ function GameBoard({ game, myId, onMove, toast }) { return (
{/* Scoreboard */} -
-
+
+
DU
-
{myScore} Pkt
+
{myScore} Pkt
🌫️{fogCount}
-
+
{oppName?.toUpperCase()}
-
Pkt {oppScore}
+
Pkt {oppScore}
@@ -343,7 +344,7 @@ function GameBoard({ game, myId, onMove, toast }) { )} {/* Legende */} -
+
{[['⭐','Gold +3','#ffe66d'],['💣','Mine −3','#ff6b9d'],['🪨','Felsen','rgba(255,255,255,0.35)'],['🌫️','Nebel','rgba(255,255,255,0.25)']].map(([icon,label,color]) => (
{icon} @@ -353,8 +354,8 @@ function GameBoard({ game, myId, onMove, toast }) {
{/* Grid */} -
-
+
+
{grid.map((row, r) => row.map((_, c) => renderCell(r, c)))}
@@ -493,7 +494,7 @@ export default function HexWars({ toast }) { return (
-
+
{activeId && ( )}