This repository has been archived by the owner on Jul 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
105 lines (89 loc) · 2.29 KB
/
style.css
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
:root {
--cell-size: 100px;
--mark-size: calc(var(--cell-size)*0.9);
}
body {
margin: 0;
}
.board {
width: 100vw;
height: 100vh;
justify-content: center;
align-content: center;
display: grid;
grid-template-columns: repeat(3, auto);
}
.cell {
width: var(--cell-size);
height: var(--cell-size);
border: 1px solid black;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.cell.x, .cell.o {
cursor: not-allowed;
}
.board.x .cell:not(.x):not(.o):hover::before, .board.x .cell:not(.x):not(.o):hover::after, .board.o .cell:not(.x):not(.o):hover::before {
background-color: lightgrey;
}
.cell.x::before, .cell.x::after, .cell.o::before {
background-color: black;
}
.cell.x::before, .cell.x::after, .board.x .cell:not(.x):not(.o):hover::before, .board.x .cell:not(.x):not(.o):hover::after {
content: '';
position: absolute;
height: calc(var(--mark-size)*0.1);
width: var(--mark-size);
}
.cell.x::before, .board.x .cell:not(.x):not(.o):hover::before {
transform: rotate(45deg);
}
.cell.x::after, .board.x .cell:not(.x):not(.o):hover::after {
transform: rotate(-45deg);
}
.cell.o::before, .cell.o::after, .board.o .cell:not(.x):not(.o):hover::before, .board.o .cell:not(.x):not(.o):hover::after {
content: '';
border-radius: 50%;
position: absolute;
}
.cell.o::before, .board.o .cell:not(.x):not(.o):hover::before {
width: calc(var(--mark-size)*0.9);
height: calc(var(--mark-size)*0.9);
}
.cell.o::after, .board.o .cell:not(.x):not(.o):hover::after {
width: calc(var(--mark-size)*0.7);
height: calc(var(--mark-size)*0.7);
background-color: white;
}
.winning-message {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .9);
justify-content: center;
align-items: center;
color: white;
font-size: 5rem;
flex-direction: column;
}
.winning-message button {
font-size: 3rem;
background-color: white;
border: 1px solid black;
padding: .25em .5em;
cursor: pointer;
}
.winning-message button:hover {
background-color: black;
color: white;
border-color: white;
}
.winning-message.show {
display: flex;
}