-
Notifications
You must be signed in to change notification settings - Fork 1
/
4x4.html
72 lines (67 loc) · 2.33 KB
/
4x4.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
71
72
<!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>4 x 4</title>
<style>
/* remove border for edges */
.cell:nth-child(1), .cell:nth-child(2), .cell:nth-child(3), .cell:nth-child(4) {
border-top: none;
}
.cell:nth-child(1), .cell:nth-child(5), .cell:nth-child(9), .cell:nth-child(13) {
border-left: none;
}
.cell:nth-child(4), .cell:nth-child(8), .cell:nth-child(12), .cell:nth-child(16) {
border-right: none;
}
.cell:nth-child(13), .cell:nth-child(14), .cell:nth-child(15), .cell:nth-child(16) {
border-bottom: none;
}
</style>
<script>
const WINNING_COMBINATIONS = [
[0, 1, 2, 3],
[4, 5, 6, 7],
[8, 9, 10, 11],
[12, 13, 14, 15],
[0, 4, 8, 12],
[1, 5, 9, 13],
[2, 6, 10, 14],
[3, 7, 11, 15],
[0, 5, 10, 15],
[3, 6, 9, 12]
]
</script>
</head>
<body>
<div class="board" id="board" style = "grid-template-columns: repeat(4, 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 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>