-
Notifications
You must be signed in to change notification settings - Fork 0
/
tic-tac-toe.css
132 lines (114 loc) · 2.45 KB
/
tic-tac-toe.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
@import url('https://fonts.googleapis.com/css?family=Titan+One&display=swap');
:root{
--black: #1a202c;
--lightGrey: #edf2f7;
--grey: #cbd5e0;
--coral: #E57996;
--lighterBlue: #32ABE1;
--lightBlue: #3182ce;
--green: #42B883;
--defaultFontFamily: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;
}
body {
font-family: var(--defaultFontFamily);
background: var(--lightGrey) url('tic-tac-toe-bg.png') repeat top left;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: var(--black);
}
h1 {
color: var(--lighterBlue);
font-family: 'Titan One', var(--defaultFontFamily);
font-size: 48px;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
h1 span {
color: var(--coral);
}
#game {
display: flex;
flex-direction: column;
align-items: center;
}
.controls {
margin: 20px 0;
}
#board {
display: grid;
grid-template-columns: repeat(3, 150px);
grid-gap: 20px;
}
#status {
font-size: 24px;
margin: 20px 0;
text-align: center;
background: white;
max-width: 490px;
padding: 1rem;
box-sizing: border-box;
border-top: 4px solid var(--lighterBlue);
border-radius: 5px;
}
#status.you-won {
color: var(--green);
border-top: 4px solid var(--green);
font-weight: bold;
}
#status.you-won::before {
content: '🎉';
display: inline-block;
margin-right: 8px;
}
#status.you-won::after {
content: '🎉';
display: inline-block;
margin-left: 8px;
}
.square {
background: white;
border: 1px solid var(--grey);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
border-radius: 10px;
width: 150px;
height: 150px;
font-size: 96px;
font-weight: bold;
display: flex;
justify-content: center;
align-items: center;
}
.square.X {
color: var(--lighterBlue);
}
.square.O {
color: var(--coral);
}
.hover {
background: var(--coral);
border-color: var(--lighterBlue);
cursor: pointer;
}
.hover.O {
color: white;
}
.btn {
color: white;
background-color: var(--lighterBlue);
border: 1px solid var(--lighterBlue);
display: inline-block;
font-weight: 400;
text-align: center;
vertical-align: middle;
padding: .375rem .75rem;
margin: 10px 0;
font-size: 1rem;
line-height: 1.5;
border-radius: .25rem;
}
.btn:hover {
background-color: var(--lightBlue);
border: 1px solid var(--lightBlue);
cursor: pointer;
}