-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
79 lines (71 loc) · 2.5 KB
/
index.html
File metadata and controls
79 lines (71 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dots and Boxes</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<header>
<h1>Dots and Boxes</h1>
<button id="theme-toggle" title="Toggle theme">🌙</button>
</header>
<!-- Setup Screen -->
<div id="setup-screen">
<div class="setup-group">
<label>Grid Size (dots per side)</label>
<div class="grid-size-picker">
<button class="grid-btn" data-size="3">3×3</button>
<button class="grid-btn active" data-size="4">4×4</button>
<button class="grid-btn" data-size="5">5×5</button>
<button class="grid-btn" data-size="6">6×6</button>
</div>
</div>
<div class="players-setup">
<div class="player-setup">
<h3>Player 1</h3>
<input type="text" id="p1-name" value="Player 1" maxlength="15">
<label>Color</label>
<input type="color" id="p1-color" value="#e74c3c">
</div>
<div class="player-setup">
<h3>Player 2</h3>
<input type="text" id="p2-name" value="Player 2" maxlength="15">
<label>Color</label>
<input type="color" id="p2-color" value="#3498db">
</div>
</div>
<button id="start-btn" class="primary-btn">Start Game</button>
</div>
<!-- Game Screen -->
<div id="game-screen" class="hidden">
<div class="scoreboard">
<div class="score-card" id="p1-score-card">
<span class="player-name" id="p1-label">Player 1</span>
<span class="score" id="p1-score">0</span>
</div>
<div class="turn-indicator" id="turn-indicator">Player 1's turn</div>
<div class="score-card" id="p2-score-card">
<span class="player-name" id="p2-label">Player 2</span>
<span class="score" id="p2-score">0</span>
</div>
</div>
<canvas id="game-canvas"></canvas>
<div class="game-controls">
<button id="restart-btn" class="secondary-btn">New Game</button>
</div>
</div>
<!-- Game Over Overlay -->
<div id="game-over" class="hidden">
<div class="overlay-content">
<h2 id="winner-text">Player 1 Wins!</h2>
<p id="final-score"></p>
<button id="play-again-btn" class="primary-btn">Play Again</button>
</div>
</div>
</div>
<script src="game.js"></script>
</body>
</html>