-
Notifications
You must be signed in to change notification settings - Fork 1
/
3x3.html
63 lines (58 loc) · 1.87 KB
/
3x3.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/style.css">
<!-- Favicons Start -->
<link rel="shortcut icon" type="image/png" href="icon/favicon.png" />
<!-- Favicons End -->
<title>3 x 3</title>
<style>
/* remove border for edges */
.cell:nth-child(1), .cell:nth-child(2), .cell:nth-child(3) {
border-top: none;
}
.cell:nth-child(1), .cell:nth-child(4), .cell:nth-child(7) {
border-left: none;
}
.cell:nth-child(3), .cell:nth-child(6), .cell:nth-child(9) {
border-right: none;
}
.cell:nth-child(7), .cell:nth-child(8), .cell:nth-child(9) {
border-bottom: none;
}
</style>
<script>
const WINNING_COMBINATIONS = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[0, 3, 6],
[1, 4, 7],
[2, 5, 8],
[0, 4, 8],
[2, 4, 6]
]
</script>
</head>
<body>
<div class="board" id="board" style = "grid-template-columns: repeat(3, auto)">
<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>
<div class="winning-message" id="winningMessage">
<div id="winningMessageText" data-winning-message-text></div>
<button id="restartButton">Restart</button>
</div>
<script src="js/script.js"></script>
</body>
</html>