Files
battle-royal-tetris/public/index.html
T
jozamudi a0ab4ff5cd Add spectator mode for late-joining players
- Server: Late joiners are added as spectators instead of players
- Server: Send forced-spectator event only to joining spectator (not broadcast)
- Server: Track spectators separately and move them to players after game ends
- Client: Handle forced-spectator event to show all player boards
- Client: Spectators see all boards equally without main/spectator highlighting
- Client: Mobile view shows scrollable vertical list of all boards for spectators
- Fix: All cleared lines are sent as garbage to each opponent (not randomized)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 18:26:48 +00:00

72 lines
2.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tetris Battle Royale</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/style.css?v=10">
</head>
<body>
<div id="app">
<!-- Login Screen -->
<div id="room-screen" class="screen active">
<h1>TETRIS<br>BATTLE ROYALE</h1>
<div class="form-group">
<label for="player-name">Your Name</label>
<input type="text" id="player-name" placeholder="Enter your name">
</div>
<button id="join-btn">JOIN LOBBY</button>
</div>
<!-- Lobby Screen -->
<div id="lobby-screen" class="screen">
<h2>GLOBAL LOBBY</h2>
<div id="player-list"></div>
<div id="spectator-list"></div>
<button id="ready-btn">READY</button>
</div>
<!-- Game Screen -->
<div id="game-screen" class="screen">
<div id="game-header">
<span id="game-room-name"></span>
<button id="leave-btn">LEAVE</button>
</div>
<div id="battle-grid"></div>
<div id="game-status"></div>
<!-- Touch Controls -->
<div id="touch-controls">
<div id="touch-dpad">
<button id="btn-left" class="touch-btn"></button>
<button id="btn-down" class="touch-btn"></button>
<button id="btn-right" class="touch-btn"></button>
</div>
<div id="touch-actions">
<button id="btn-rotate" class="touch-btn action-btn"></button>
<button id="btn-drop" class="touch-btn drop-btn"></button>
<button id="btn-hold" class="touch-btn hold-btn">HOLD</button>
</div>
</div>
</div>
<!-- Game Over Screen (Overlay) -->
<div id="gameover-screen">
<h2>GAME OVER</h2>
<h3 id="winner-display"></h3>
<div id="final-scores"></div>
<button id="back-to-lobby">BACK TO LOBBY</button>
</div>
</div>
<script src="/socket.io/socket.io.js"></script>
<script src="js/network.js?v=5"></script>
<script src="js/game.js?v=4"></script>
<script src="js/renderer.js?v=5"></script>
<script src="js/ui.js?v=5"></script>
<script src="js/app.js?v=5"></script>
</body>
</html>