Repository navigation
Expand file tree
/
Copy pathstyle.css
More file actions
496 lines (436 loc) · 13.4 KB
/
Copy pathstyle.css
File metadata and controls
496 lines (436 loc) · 13.4 KB
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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=IBM+Plex+Mono:wght@400;500;600&display=swap');
/* v2b palette: the placeholder purple is gone -- the delivered art pass
(images/background.png, images/gameArea-bg.png, images/chord-orb.png)
is a green-on-black "matrix HUD" style, so the whole UI moves onto the
same greens that matrix-panel.css already declares. --miss stays red
on purpose: it's the one signal that must never read as "part of the
theme". */
:root {
--accent: #00ff66;
--accent-bright: #7bffb4;
--accent-soft: #4dff9a;
--accent-dim: rgba(0, 255, 102, 0.20);
--panel-bg: rgba(0, 12, 7, 0.86);
--ink: #d6ffe6;
--miss: #ff4d4d;
/* Body copy is a terminal mono rather than a neutral sans: Inter read as
generic UI chrome bolted onto the HUD art. IBM Plex Mono keeps the
terminal/technical register the panels and score font establish while
still being designed for running text, which the pixel font and
Courier New both are not. Falls back to the same stack
matrix-panel.css uses. */
--font-body: 'IBM Plex Mono', 'Courier New', ui-monospace, monospace;
/* Diameter of a falling orb. Single source of truth: src/app.ts mirrors
this as ORB_SIZE_PX (spawn position, off-screen start, miss line), and
measures the element to pick up the media-query override below, so the
two can't drift. Sized for readability: three stacked lines of pixel
type at 110px left the note list microscopic. */
--orb-size: 150px;
}
body {
margin: 0;
min-height: 100vh;
background-color: #010603;
/* Gradient layer sits *above* the art to sink the edges and keep the
panels legible over the busier corners of the background. */
background-image:
radial-gradient(ellipse at 50% 38%, rgba(0, 10, 5, 0.25), rgba(0, 6, 3, 0.80) 78%),
url('images/background.png');
background-repeat: no-repeat, no-repeat;
background-position: center center, center center;
background-size: cover, cover;
background-attachment: fixed, fixed;
/* "Press Start 2P" stays for headings/score/circles/buttons --
the retro-arcade identity -- but body copy (labels, paragraphs) uses
a readable mono; the pixel font at paragraph sizes was hard to
read. */
font-family: var(--font-body);
color: var(--ink);
}
h1, h2, #startButton, #restartButton, #scoreDisplay, .chordCircle {
font-family: 'Press Start 2P', cursive;
}
h1, h2 {
color: var(--accent-bright);
text-shadow: 0 0 12px rgba(0, 255, 102, 0.45);
}
a {
color: var(--accent-soft);
}
a:hover {
color: var(--accent-bright);
}
/* A button styled to read as inline text -- termsLink needs a click
handler (it opens #termsScreen via showScreen), not a real navigation,
so it can't be a plain <a href>. */
.linkButton {
background: none;
border: none;
padding: 0;
font: inherit;
color: var(--accent-soft);
text-decoration: underline;
cursor: pointer;
}
.linkButton:hover, .linkButton:focus-visible {
color: var(--accent-bright);
}
/* Purchase entry points are inert until the terms checkbox is ticked
(src/app.ts). #unlockButton uses the native disabled attribute; #purchaseLink
is a plain external link, which has no disabled state, so it gets this
instead. */
.inert {
opacity: 0.45;
pointer-events: none;
}
.screen {
display: none;
text-align: center;
padding: 20px;
}
.screen.active {
display: block;
}
/* --- Panels -------------------------------------------------------
The frame itself comes from matrix-panel.css. Everything below only
adapts that component to this app: matrix-panel--container is a
single-child flex row by default and 900px wide, neither of which
suits stacked menu content. */
.setupContainer, .menuContainer {
flex-direction: column;
width: min(92vw, 560px);
margin: 80px auto 40px;
text-align: center;
font-family: var(--font-body);
color: var(--ink);
}
.setupContainer {
width: min(92vw, 620px);
}
.screenNav {
display: flex;
flex-direction: column;
gap: 14px;
margin-top: 24px;
}
.menuBody {
text-align: left;
font-size: 14px;
/* A touch more leading than the old sans needed: mono glyphs are wider,
so lines run longer and want more air between them. */
line-height: 1.75;
opacity: 0.9;
margin: 8px 0 20px;
}
/* --- Buttons ------------------------------------------------------
Terminal-style: dark fill, green rule, green text, glow on hover --
a filled green slab fought the HUD art for attention. */
.menuItem, #startButton, #restartButton, #unlockButton, #mc-embedded-subscribe {
padding: 14px 28px;
font-size: 13px;
font-family: 'Press Start 2P', cursive;
cursor: pointer;
background: linear-gradient(180deg, rgba(0, 40, 20, 0.85), rgba(0, 18, 10, 0.9));
color: var(--accent-soft);
border: 2px solid rgba(0, 255, 102, 0.55);
border-radius: 8px;
letter-spacing: 0.04em;
text-shadow: 0 0 8px rgba(0, 255, 102, 0.45);
box-shadow: 0 0 10px rgba(0, 255, 102, 0.15), inset 0 0 14px rgba(0, 255, 102, 0.07);
transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.menuItem:hover, .menuItem:focus-visible,
#startButton:hover, #startButton:focus-visible,
#restartButton:hover, #restartButton:focus-visible,
#unlockButton:hover, #unlockButton:focus-visible,
#mc-embedded-subscribe:hover, #mc-embedded-subscribe:focus-visible {
transform: translateY(-2px);
color: #eaffe9;
border-color: var(--accent);
box-shadow: 0 0 22px rgba(0, 255, 102, 0.45), inset 0 0 20px rgba(0, 255, 102, 0.15);
outline: none;
}
.menuItem:active, #startButton:active, #restartButton:active,
#unlockButton:active, #mc-embedded-subscribe:active {
transform: translateY(0);
}
/* Start is disabled when the browser has no Web MIDI to offer (see
showMidiNotice in src/app.ts), so it has to look unavailable. */
#startButton:disabled, #startButton:disabled:hover {
cursor: not-allowed;
opacity: 0.45;
transform: none;
border-color: rgba(0, 255, 102, 0.25);
box-shadow: none;
}
/* Both sit inline next to a text input, so they take a compact size
rather than the full arcade-button padding above. */
#unlockButton, #mc-embedded-subscribe {
padding: 9px 16px;
font-size: 10px;
vertical-align: middle;
}
#startButton, #restartButton {
font-size: 14px;
margin: 24px auto 4px;
display: inline-block;
text-decoration: none;
}
.menuItem.backButton {
margin-top: 24px;
background: rgba(0, 255, 102, 0.05);
border-color: rgba(0, 255, 102, 0.28);
box-shadow: none;
opacity: 0.85;
}
.menuItem.backButton:hover, .menuItem.backButton:focus-visible {
opacity: 1;
box-shadow: 0 0 16px rgba(0, 255, 102, 0.3);
}
#mc_embed_shell {
margin: 20px 0;
}
h1 {
font-size: 1.4em;
margin-bottom: 12px;
letter-spacing: 1px;
}
.setupContainer > p {
font-size: 14px;
line-height: 1.75;
opacity: 0.85;
margin: 8px 0 20px;
}
/* --- Forms --------------------------------------------------------- */
.formRow {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
margin: 14px 0;
flex-wrap: wrap;
}
.formRow label {
font-size: 13px;
}
#midiSelect, #keySelect, #genreSelect, #scaleSelect, #levelSelect,
#licenseKeyInput, #mce-EMAIL {
padding: 8px 10px;
font-size: 13px;
font-family: var(--font-body);
background: #04140b;
color: var(--ink);
border: 1px solid rgba(0, 255, 102, 0.35);
border-radius: 6px;
}
#midiSelect:focus, #keySelect:focus, #genreSelect:focus, #scaleSelect:focus,
#levelSelect:focus, #licenseKeyInput:focus, #mce-EMAIL:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 10px rgba(0, 255, 102, 0.35);
}
#levelSelect optgroup {
font-style: normal;
color: var(--accent-bright);
}
#levelSelect option {
color: var(--ink);
background: #04140b;
}
.error, #unlockError {
color: var(--miss);
}
/* --- Play area ----------------------------------------------------- */
#gameArea {
position: relative;
min-width: 70vw;
height: 80vh;
overflow: hidden;
background: url('images/gameArea-bg.png') no-repeat center center;
background-size: cover;
margin: 0 auto;
box-sizing: border-box;
border: 2px solid rgba(0, 255, 102, 0.35);
border-radius: 8px;
box-shadow: 0 0 26px rgba(0, 255, 102, 0.12), inset 0 0 80px rgba(0, 0, 0, 0.55);
transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
/* Brief red pulse around the play area when a circle is missed --
deliberately just a border/shadow change, not a layout-affecting
property, so it can't cause reflow/jank. */
#gameArea.missFlash {
border-color: var(--miss);
box-shadow: 0 0 0 4px var(--miss), inset 0 0 60px rgba(255, 77, 77, 0.35);
}
/* Decorative canvas overlay (see startGameFx in src/app.ts). Explicitly
pinned to the bottom of the stack so the falling circles, which are
appended to #gameArea after it, always paint on top. */
#gameFx {
position: absolute;
/* Long-hand as well as `inset`: Safari only learned the shorthand in
14.1, and this canvas has to be pinned in older ones too. */
top: 0;
left: 0;
inset: 0;
width: 100%;
height: 100%;
z-index: 0;
pointer-events: none;
}
.chordCircle {
position: absolute;
z-index: 2;
width: var(--orb-size);
height: var(--orb-size);
/* 300x300 sprite (2x for retina) cropped tight to the disc, so it fills
the box edge-to-edge and text laid out across the box stays on the
orb rather than spilling onto the play area either side of it (see
art-source/README.md for the crop). The radial layer above it is a
scrim that keeps the label readable over the orb's bright lower
half. */
background:
radial-gradient(circle, rgba(0, 12, 6, 0.74) 0%, rgba(0, 12, 6, 0.44) 55%, rgba(0, 12, 6, 0) 76%),
url('images/chord-orb.png') center/cover no-repeat;
border-radius: 50%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
/* Base size is for the bare single-note circles (generateNoteCircle
writes a plain text node, no wrapper div). */
font-size: 20px;
text-align: center;
padding: 8px;
box-sizing: border-box;
color: var(--ink);
line-height: 1.5;
text-shadow: 0 0 5px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 255, 102, 0.55);
filter: drop-shadow(0 0 10px rgba(0, 255, 102, 0.45));
}
/* Chord circles stack up to three lines inside the disc, so each gets its
own size -- Press Start 2P is near-monospace at ~1em per glyph, and a
shared size overflowed the art on the longest line. */
.chordCircle .ccFunction {
font-size: 13px;
opacity: 0.8;
}
.chordCircle .ccLabel {
font-size: 16px;
}
/* The longest string the orb ever holds: five notes with accidentals on
level 5 ("D#-G-A#-D-F"). Allowed to wrap rather than shrink further,
since below ~10px this pixel font stops being legible at all. */
.chordCircle .ccNotes {
font-size: 10px;
opacity: 0.92;
max-width: 100%;
overflow-wrap: break-word;
word-break: break-word;
}
/* Short-lived "pop" shown where a circle was matched -- a separate
element from the circle itself (see flashMatch in src/app.ts), so it
can't affect the circle-removal/scoring timing it's layered on top of. */
.matchPop {
position: absolute;
z-index: 3;
width: var(--orb-size);
height: var(--orb-size);
border-radius: 50%;
border: 3px solid var(--accent);
box-shadow: 0 0 24px rgba(0, 255, 102, 0.85);
pointer-events: none;
animation: matchPop 0.4s ease-out forwards;
}
@keyframes matchPop {
0% { transform: scale(0.6); opacity: 1; }
100% { transform: scale(1.5); opacity: 0; }
}
/* --- HUD ----------------------------------------------------------- */
.hudPanel {
margin: 6px auto 14px;
}
#scoreDisplay {
font-size: 0.9em;
}
/* Not Press Start 2P: that pixel font has no heart glyph, so the lives
would fall back mid-string and render at a mismatched size. */
#livesDisplay {
font-family: "Courier New", ui-monospace, monospace;
font-size: 1.1em;
letter-spacing: 0.12em;
color: var(--accent);
}
#livesDisplay .lifeSpent {
opacity: 0.28;
}
/* --- End screen ---------------------------------------------------- */
#endScreen h2 {
margin-bottom: 20px;
font-size: 1.5em;
}
#finalScore {
font-size: 16px;
margin-bottom: 20px;
font-family: var(--font-body);
}
/* Mailchimp's own class, kept for any of its markup that isn't the
#mc-embedded-subscribe submit already styled above. */
.button {
margin-top: 15px;
padding: 10px 20px;
font-size: 14px;
cursor: pointer;
background: rgba(0, 255, 102, 0.1);
color: var(--accent-soft);
border: 1px solid rgba(0, 255, 102, 0.45);
border-radius: 5px;
}
.mc-field-group {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
flex-wrap: wrap;
margin: 12px 0;
}
.mc-field-group label {
font-size: 13px;
}
#unlockForm p {
font-size: 13px;
line-height: 1.6;
}
#termsAgreeLabel {
display: block;
font-size: 13px;
margin: 10px 0;
}
/* A 150px orb takes a third of the play area on a phone-sized screen.
src/app.ts measures the element rather than assuming ORB_SIZE_PX, so
spawn bounds and the miss line follow this automatically. */
@media (max-width: 640px) {
:root {
--orb-size: 110px;
}
.chordCircle {
font-size: 15px;
}
.chordCircle .ccFunction {
font-size: 10px;
}
.chordCircle .ccLabel {
font-size: 12px;
}
}
@media (prefers-reduced-motion: reduce) {
.matrix-panel.is-active > .scanline {
animation: none;
opacity: 0;
}
.menuItem, #startButton, #restartButton {
transition: none;
}
.menuItem:hover, #startButton:hover, #restartButton:hover {
transform: none;
}
}