-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.html
More file actions
58 lines (50 loc) · 1.96 KB
/
game.html
File metadata and controls
58 lines (50 loc) · 1.96 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
<!DOCTYPE html>
<html lang="en">
<!-- Game HTML: The user interface for the Tic Tac Toe game itself -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tic Tac Toe - Game</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="game-container">
<h1>Tic Tac Toe</h1>
<div id="player-indicators">
<div class="player-indicator">
<span id="player1-emoji">❌</span>
<div class="player-label">You</div>
</div>
<div class="player-indicator">
<span id="player2-emoji">⭕</span>
<div class="player-label">Opponent</div>
</div>
</div>
<!-- Game board container with 9 cells representing the Tic Tac Toe grid -->
<div id="board">
<!-- Each .cell is an individual square where players place their mark -->
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
</div>
<!-- Container to show game result messages like win/lose/draw -->
<div id="result"></div>
<div id="button-container">
<button id="reset">Play Again</button>
<button id="backToMenu">Back to Menu</button>
</div>
</div>
<!-- Canvas Confetti Library for visual celebrations (e.g., when a player wins) -->
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.9.3/dist/confetti.browser.min.js"></script>
<!-- Firebase libraries for app initialization and real-time database support -->
<script src="https://www.gstatic.com/firebasejs/9.17.1/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.17.1/firebase-database-compat.js"></script>
<script type="module" src="game-multiplayer.js"></script>
</body>
</html>