-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.css
365 lines (305 loc) · 7.71 KB
/
interface.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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
/** Copyright (C) Microsoft Corporation. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* minimal css reset */
html, body, div, h1, h2, h3, h4, h5, h6, a, p, img, ul, li, button { padding: 0; margin: 0; border: 0; outline: 0; }
html, body {
width: 100vw; /* fullscreen */
height: 100vh; /* fullscreen */
overflow: hidden;
user-select: none;
font-family: system-ui, sans-serif;
font-size: 16px;
color: #000000;
touch-action: pinch-zoom; /* prevents navigating back with one finger */
}
/* game layers fill entire page */
#game-canvas, #game-bg, #game-gradient, #game-ui, #game-tint {
overflow: hidden;
position: absolute;
user-select: none;
width: 100vw;
height: 100vh;
top: 0;
left: 0;
}
/* from edge */
#hamburger-container {
overflow: visible;
position: absolute;
top: 10px;
right: 8px;
}
html[dir="rtl"] #hamburger-container {
right: unset;
left: 10px;
}
html[dir="rtl"].icon-arrow-right,
html[dir="rtl"].icon-arrow-left {
/* undo RTL */
transform: scale(-1, 1);
}
#modal-root {
position: fixed;
}
/* page structure */
#game-gradient {
z-index: 1;
pointer-events: none;
}
@media (forced-colors:active) {
/* CanvasText, LinkText, VisitedText, ActiveText, GrayText, Field, FieldText, HighlightText, Highlight (txt bg), ButtonText, ButtonFace (btn bg) */
#game-bg { background: Canvas !important; }
}
#game-bg {
background-repeat: repeat;
image-rendering: pixelated; /* important */
z-index: 2;
pointer-events: none;
}
#game-canvas {
image-rendering: pixelated; /* important */
z-index: 3;
}
/* overlay */
#game-tint {
pointer-events: none;
z-index: 4;
background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.1) 100%);
transition: opacity 0.35s, visibility 0s 0.35s;
transition-timing-function: cubic-bezier(0.30, 0.20, 0.20, 1.00);
visibility: hidden;
opacity: 0;
backdrop-filter: blur(0px);
}
#game-tint.visible {
pointer-events: inherit;
transition: opacity 0.35s; /* instant visibility */
visibility: visible;
opacity: 1;
backdrop-filter: blur(4px);
}
/* main game ui */
#game-ui {
width: calc(100vw - 32px); /* fullscreen minus 32 padding */
height: calc(100vh - 32px); /* fullscreen minus 32 padding */
padding: 16px;
z-index: 5;
}
#ui-title,
#ui-subtitle {
width: calc(100vw - 32px); /* fullscreen minus 32 padding */
font-weight: bold;
text-align: center;
text-transform: uppercase;
}
#ui-title {
margin-top: calc(10vh - 40px);
line-height: 48px;
font-size: 48px;
}
#ui-subtitle {
margin-top: 10px;
line-height: 24px;
font-size: 24px;
}
/* shrinks title for super small screens */
@media screen and (max-height: 480px) {
#ui-title { line-height: 36px; font-size: 36px; }
#ui-subtitle { line-height: 20px; font-size: 20px; }
}
/* hides mode title on tiny screens */
@media screen and (max-height: 360px) {
#ui-subtitle { visibility: hidden; }
}
/* hides game title on tiny screens */
@media screen and (max-height: 280px) {
#ui-title { visibility: hidden; }
}
#ui-selector {
position: absolute;
top: calc(40vh - 64px);
left: calc(50vw - 240px);
width: 480px; /* fullscreen minus 32 padding */
height: 128px;
display: flex;
justify-content: space-between;
align-items: center;
}
#ui-selector span {
border-radius: 4px;
background-color: rgba(255,255,255,0);
transition: background-color 0.1s;
}
#ui-selector span:hover {
background: rgba(255,255,255,0.4);
cursor: pointer;
}
/* shrink menu arrows on narrow screens */
@media screen and (max-width: 520px) {
#ui-selector { left: calc(50vw - 220px); width: 440px; }
}
/* hide menu arrows on narrow screens */
@media screen and (max-width: 420px) {
#ui-selector span { visibility: hidden; }
}
#ui-container {
display: inline-block;
}
#view-container {
position: absolute;
top: calc(100vh * 0.55 - 32px); /* minus half height */
width: calc(100vw - 32px); /* fullscreen minus 32 padding */
text-align: center;
}
#ui-instruct {
position: relative;
/* top: calc(100vh * 0.6 - 32px); /* minus half height */
/* width: calc(100vw - 32px); /* fullscreen minus 32 padding */
text-align: center;
}
#instruct-content {
padding: 16px 12px;
}
#instruct-content.tinted {
background-color: rgba(255,255,255,0.6);
backdrop-filter: blur(32px);
box-shadow: 0px 16px 24px rgba(0,0,0,0.16);
border-radius: 4px;
}
#instruct-icon { /* xbox + ps */
display: inline-block;
vertical-align: middle;
width: 32px;
height: 32px;
}
#instruct-action { /* spacebar, double tap, double click */
display: inline-block;
margin: 0 8px;
vertical-align: middle;
}
#instruct-action.outline { /* spacebar, double tap, double click */
padding: 4px 12px 5px;
border: 2px solid #000000;
border-radius: 4px;
font-size: 20px;
font-weight: bold;
text-transform: uppercase;
}
#instruct-text {
display: inline-block;
margin: 0 8px;
vertical-align: middle;
font-size: 24px;
font-weight: 600;
}
#ui-notify {
position: absolute;
top: calc(100vh * 0.75 - 24px);
width: calc(100vw - 32px); /* fullscreen minus 32 padding */
text-align: center;
transition: opacity 0.5s, visibility 0s 0.5s;
transition-timing-function: cubic-bezier(0.30, 0.20, 0.20, 1.00);
visibility: hidden;
opacity: 0;
}
#ui-notify.visible {
transition: opacity 0.35s; /* instant visibility */
visibility: visible;
opacity: 1;
}
#notify-content {
display: inline-block;
padding: 12px 20px;
font-weight: 600;
border-radius: 4px;
color: #FFFFFF;
background-color: rgba(0,0,0,0.7);
backdrop-filter: blur(32px);
}
#notify-shareLink {
display: inline-flex;
vertical-align: -33%;
align-items: center;
font-weight: normal;
background-color: rgba(255,255,255,0.2);
padding: 4px 8px 2px;
margin-inline-start: 12px;
border-radius: 4px;
cursor: pointer;
color: currentColor;
}
#notify-shareLink:hover {
background-color: rgba(255,255,255,0.3);
}
#notify-shareText {
}
/* game stats and ui */
#ui-dash {
position: relative;
width: 100%;
margin: 0 auto;
}
#dash-stats {
display: flex;
width: 280px;
margin: 0 auto;
}
#stats-score,
.stats-icons {
display: flex;
justify-content: center;
height: 22px;
flex-basis: 136px;
}
.stats-icons {
flex-basis: 72px;
image-rendering: pixelated; /* important */
}
.stats-icons div {
width: 22px;
height: 22px;
margin-inline-end: 2px;
background-size: 1920px 512px;
}
.life-full { background-position: -1px -1px; }
.life-empty { background-position: -1px -25px; }
.boost-full { background-position: -25px -1px; }
.boost-empty { background-position: -25px -25px; }
.shield { background-position: -49px -1px; }
.infinite { background-position: -49px -25px; }
#score-icon {
display: inline-block;
vertical-align: middle;
height: 22px;
margin-inline-end: 4px;
}
#score-text {
vertical-align: middle;
font-size: 16px;
font-weight: bold;
line-height: 22px;
}
#ui-share {
position: relative;
text-align: center;
margin-top: 10px;
visibility: hidden;
}
#ui-share.visible {
visibility: visible;
}
.icon-star {
vertical-align: top;
}
.icon-fill {
fill: #000000;
}
#ui-notify .icon-fill {
fill: #FFFFFF;
}
@media (forced-colors:active) {
/* CanvasText, LinkText, VisitedText, ActiveText, GrayText, Field, FieldText, HighlightText, Highlight (txt bg), ButtonText, ButtonFace (btn bg) */
.icon-fill { fill: CanvasText !important; }
}