-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
70 lines (69 loc) · 2.04 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>TicTacToe</title>
<link rel="shortcut icon" href="icon512_rounded.png" type="image/x-icon" />
<meta name="description" content="Simple Tic Tac Toe Game" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="style.css" />
<link rel="manifest" href="manifest.json" />
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./sw.js');
}
</script>
<script src="game.js"></script>
<script src="script.js" defer></script>
</head>
<body>
<div class="board" id="board">
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
</div>
<br />
<div class="stats">
<table>
<tr>
<th>X(you)</th>
<th>Draw</th>
<th>O(computer)</th>
</tr>
<tr>
<td id="x-score">0</td>
<td id="draw-score">0</td>
<td id="o-score">0</td>
</tr>
</table>
<button class="clear-button" id="clear-button">Clear Data</button>
</div>
<div class="winning-message" id="winning-message">
<div data-winning-message-text>X wins!</div>
<button id="restart-button">Restart</button>
</div>
<footer>
AI by  
<a
href="http://x.com/emma_nwafor1"
target="_blank"
rel="noopener noreferrer"
>Emmanuel</a
>
</footer>
</body>
<script>
const installBtn = document.createElement('button');
installBtn.addEventListener('click', function () {
deferredPrompt.prompt();
deferredPrompt = null;
});
</script>
</html>