-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.css
160 lines (126 loc) · 2.26 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/* Lucas Birkert - TicTacToe */
/* _ _ _ _ */
/* | | (_) | | | | */
/* | |_ _ ___| |_ __ _ ___| |_ ___ ___ */
/* | __| |/ __| __/ _` |/ __| __/ _ \ / _ \ */
/* | |_| | (__| || (_| | (__| || (_) | __/ */
/* \__|_|\___|\__\__,_|\___|\__\___/ \___| */
/* https://github.com/lbirkert/tictactoe/tree/main/LICENSE */
/* (c) Copyright 2024 Lucas Birkert, all rights reserved */
/* BASIC STYLING */
* {
font-family: "VT323", monospace;
text-align: center;
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
align-items: center;
justify-content: center;
min-height: 70vh;
padding: 40px 20px;
}
h1 {
font-size: 60px;
}
p {
font-size: 30px;
margin-bottom: 60px;
}
button {
font-size: 20px;
width: 100%;
cursor: pointer;
background-color: transparent;
border: 3px solid black;
padding: 10px 20px;
}
button:hover {
background-color: black;
color: white;
}
/* GAME GRID STYLES */
#game {
margin-bottom: 60px;
display: flex;
flex-direction: column;
width: 100%;
aspect-ratio: 1;
}
#game .row {
display: flex;
width: 100%;
}
#game button {
all: unset;
flex: 1;
aspect-ratio: 1;
cursor: pointer;
border: 3px solid black;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 60px;
}
#game button:hover {
background-color: #eee;
}
#game button:disabled {
cursor: unset;
}
#game button:disabled:hover {
background-color: transparent;
}
#game .row button:nth-child(1) {
border-left: none;
}
#game .row button:nth-child(3) {
border-right: none;
}
#game .row:nth-child(1) button {
border-top: none;
}
#game .row:nth-child(3) button {
border-bottom: none;
}
#game button.x::after {
content: "X";
color: red;
}
#game button.o::after {
content: "O";
color: blue;
}
/* SPLASH SCREEN STYLES */
#splash,
.gameover #main {
display: none;
}
#main,
.gameover #splash {
display: flex;
flex-direction: column;
align-items: center;
min-width: 300px;
}
#splash .win,
#splash .tie {
display: none;
}
#splash.win .win {
display: block;
}
#splash.tie .tie {
display: block;
}
#winner.x::after {
content: "X";
color: red;
}
#winner.o::after {
content: "O";
color: blue;
}