-
Notifications
You must be signed in to change notification settings - Fork 5
/
styles.css
187 lines (153 loc) · 3.21 KB
/
styles.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
:root {
--color-black: #121213;
--color-white: #fff;
--color-green: #538d4e;
--color-yellow: #B59F3B;
--color-gray-dark: #3A3A3C;
--color-gray-light: #818384;
}
html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }
body {
background: var(--color-black);
color: var(--color-white);
font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
min-height: 100vh;
margin: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 2rem;
}
header { border-bottom: 1px solid var(--color-gray-dark); }
h1 {
margin: 10px 0;
padding: 0;
text-align: center;
}
main {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.toaster {
position: absolute;
top: 10%;
left: 50%;
transform: translate(-50%, 0);
pointer-events: none;
width: fit-content;
}
.toaster ul {
display: flex;
flex-direction: column;
gap: 1rem;
list-style: none;
margin: 0;
padding: 0;
}
.toast {
background: var(--color-white);
border-radius: 4px;
color: var(--color-black);
padding: 1rem;
font-weight: bold;
text-align: center;
opacity: 1;
transition: opacity 300ms cubic-bezier(0.645, 0.045, 0.355, 1);
}
.fade { opacity: 0; }
#board, #keyboard {
display: flex;
flex-direction: column;
gap: 6px; /* Between each row */
text-transform: uppercase;
}
#board ul,
#keyboard ul {
display: flex;
list-style: none;
gap: 6px; /* Between each cell */
padding: 0;
margin: 0;
}
[data-status],
[data-key] {
border: 2px solid var(--color-gray-dark);
font-weight: 700;
font-size: 2rem;
line-height: 2rem;
display: inline-flex;
align-items: center;
justify-content: center;
height: 4rem;
width: 4rem;
user-select: none;
}
#keyboard {
gap: 8px; /* Between each row */
padding-bottom: 10px;
}
#keyboard ul { justify-content: center; }
[data-key] {
background: var(--color-gray-light);
border: none;
border-radius: 4px;
font-size: 1rem;
height: 3.8rem;
width: 2.8rem;
cursor: pointer;
transition: all .3s ease-in-out;
}
[data-key='Enter'] { width: 6rem; }
[data-key='Backspace'] {
background-image: url(./backspace.svg);
background-repeat: no-repeat;
background-position: center;
text-indent: -9999px;
width: 4rem;
}
[data-status='filled'] { border: 1px solid var(--color-gray-light); }
[data-status='valid'] { background: var(--color-green); }
[data-status='invalid'] { background: var(--color-yellow); }
[data-status='none'] { background: var(--color-gray-dark); }
[data-animation='pop'] { animation: PopIn 100ms; }
@keyframes PopIn {
from {
transform: scale(0.8);
opacity: 0;
}
40% {
transform: scale(1.1);
opacity: 1;
}
}
[data-animation='flip'] { animation: Flip .50s ease-in; }
@keyframes Flip {
from {
transform: rotateX(0);
}
50% {
transform: rotateX(-90deg);
}
to {
transform: rotateX(0);
}
}
[data-animation='invalid'] { animation: Shake 600ms; }
@keyframes Shake {
10%, 90% {
transform: translateX(-1px);
}
20%, 80% {
transform: translateX(2px);
}
30%, 50%, 70% {
transform: translateX(-4px);
}
40%, 60% {
transform: translateX(4px);
}
}