From 18fe0332ae2910352114ab7a7d2af64c91b1c17c Mon Sep 17 00:00:00 2001 From: sokol Date: Sun, 22 Feb 2026 11:20:13 +0300 Subject: [PATCH] Fix: Default player count and initialize player type rows --- public/game.js | 6 ++++++ public/index.html | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/public/game.js b/public/game.js index c4350ce..0a3c8cc 100644 --- a/public/game.js +++ b/public/game.js @@ -72,6 +72,12 @@ class GameUI { const playerCountSelect = document.getElementById('player-count'); const playerTypeRows = document.querySelectorAll('.player-type-row'); + // Initialize player type rows visibility based on default selection + const initialCount = parseInt(playerCountSelect.value); + playerTypeRows.forEach((row, index) => { + row.style.display = index < initialCount ? 'flex' : 'none'; + }); + playerCountSelect.addEventListener('change', (e) => { const count = parseInt(e.target.value); playerTypeRows.forEach((row, index) => { diff --git a/public/index.html b/public/index.html index ca10507..c8a610e 100644 --- a/public/index.html +++ b/public/index.html @@ -20,8 +20,8 @@