-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
118 lines (118 loc) · 3.26 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tic Tac Toe</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
nav{
display: flex;
justify-content: space-between;
padding: 20px;
border: 2px solid black;
}
.section{
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
gap: 20px;
}
.main{
display: grid;
grid-template-rows: repeat(3, 1fr);
width: 300px;
grid-template-columns: repeat(3, 1fr);
position: relative;
}
.box{
height: 100px;
width: 100px;
border: 2px solid black;
display: flex;
align-items: center;
justify-content: center;
font-size: 2em;
position: relative;
}
#reset{
padding: 7px 20px;
font-size: 15px;
font-weight: 300;
border-radius: 10px;
border: 2px solid #0000f3;
color: white;
background-color: #4141ff;
}
#reset:hover{
cursor: pointer;
background: #2222ff;
font-weight: 500;
box-shadow: #4c4c4c 1px 1px;
}
.strikethrough {
position: absolute;
background-color: red;
z-index: 1;
}
.horizontal {
height: 5px;
width: 300px;
top: 50%;
left: 0;
transform: translateY(-50%);
}
.vertical {
height: 300px;
width: 5px;
left: 50%;
top: 0;
transform: translateX(-50%);
}
.diagonal1 {
height: 5px;
width: 300px;
top: 50%;
left: 0;
transform: translateY(-50%) rotate(45deg);
}
.diagonal2 {
height: 5px;
width: 300px;
top: 50%;
left: 0;
transform: translateY(-50%) rotate(-45deg);
}
</style>
</head>
<body>
<nav>
<h1>Tic Tac Toe</h1>
<button id="reset">Reset</button>
</nav>
<div class="section">
<div class="turn" id="turnX">"X" turn</div>
<div class="turn" id="turnO" hidden>"O" turn</div>
<div class="main">
<div class="box" id="sec1x1"></div>
<div class="box" id="sec1x2"></div>
<div class="box" id="sec1x3"></div>
<div class="box" id="sec2x1"></div>
<div class="box" id="sec2x2"></div>
<div class="box" id="sec2x3"></div>
<div class="box" id="sec3x1"></div>
<div class="box" id="sec3x2"></div>
<div class="box" id="sec3x3"></div>
<div class="strikethrough" id="strikethrough"></div>
</div>
<div class="ans" id="result"></div>
</div>
<script src="https://kit.fontawesome.com/bb1c1f2873.js" crossorigin="anonymous"></script>
<script src="script.js"></script>
</body>
</html>