-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.html
More file actions
536 lines (477 loc) · 19.7 KB
/
Copy pathmenu.html
File metadata and controls
536 lines (477 loc) · 19.7 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
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Choose from seven browser-based classic arcade tributes.">
<link rel="icon" href="data:,">
<title>Arcade Clones | Select a Game</title>
<style>
:root {
color-scheme: dark;
--ink: #f8fbff;
--muted: #9aa6bd;
--cyan: #00e5ff;
--pink: #ff3cac;
--yellow: #fff36a;
--panel: rgba(7, 9, 25, .9);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #02030a; }
body {
min-height: 100vh;
margin: 0;
overflow-x: hidden;
background:
radial-gradient(circle at 50% -10%, rgba(113, 55, 255, .25), transparent 42rem),
radial-gradient(circle at 8% 30%, rgba(0, 229, 255, .12), transparent 24rem),
radial-gradient(circle at 94% 70%, rgba(255, 60, 172, .12), transparent 28rem),
#02030a;
color: var(--ink);
font-family: "Courier New", Courier, monospace;
}
body::before,
body::after {
content: "";
position: fixed;
inset: 0;
pointer-events: none;
z-index: 20;
}
body::before {
background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .17) 0 1px, transparent 1px 4px);
opacity: .7;
}
body::after {
background: radial-gradient(ellipse at center, transparent 54%, rgba(0, 0, 0, .74) 100%);
}
.stars,
.stars::before {
position: fixed;
inset: -20%;
pointer-events: none;
content: "";
background-image:
radial-gradient(circle, rgba(255,255,255,.8) 0 1px, transparent 1.5px),
radial-gradient(circle, rgba(0,229,255,.65) 0 1px, transparent 1.5px);
background-position: 0 0, 31px 47px;
background-size: 83px 83px, 131px 131px;
opacity: .28;
animation: star-drift 36s linear infinite;
}
.stars::before {
inset: 0;
transform: rotate(17deg) scale(1.25);
opacity: .4;
animation-duration: 54s;
}
.skip-link {
position: fixed;
top: 8px;
left: 8px;
z-index: 100;
padding: 10px 14px;
transform: translateY(-160%);
border: 2px solid var(--yellow);
background: #02030a;
color: var(--yellow);
}
.skip-link:focus { transform: translateY(0); }
.arcade-shell {
position: relative;
z-index: 1;
width: min(1240px, calc(100% - 28px));
margin: 0 auto;
padding: 44px 0 36px;
}
.masthead { text-align: center; margin-bottom: 28px; }
.eyebrow {
margin: 0 0 10px;
color: var(--cyan);
font-size: clamp(.68rem, 2vw, .83rem);
font-weight: 700;
letter-spacing: .34em;
text-transform: uppercase;
text-shadow: 0 0 10px var(--cyan);
}
h1 {
position: relative;
display: inline-block;
margin: 0;
color: #fff;
font-family: Impact, "Arial Black", sans-serif;
font-size: clamp(3.2rem, 10vw, 7.4rem);
font-style: italic;
font-weight: 900;
letter-spacing: .025em;
line-height: .82;
text-transform: uppercase;
text-shadow:
4px 4px 0 #632cff,
8px 8px 0 #ff3cac,
0 0 22px rgba(0, 229, 255, .8),
0 0 55px rgba(255, 60, 172, .5);
transform: skew(-3deg);
}
h1 span { display: block; color: var(--yellow); font-size: .54em; letter-spacing: .32em; margin-left: .35em; }
.tagline {
margin: 20px auto 0;
color: var(--muted);
font-size: clamp(.76rem, 1.8vw, .95rem);
letter-spacing: .1em;
line-height: 1.7;
text-transform: uppercase;
}
.status-bar {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px 24px;
margin: 26px auto 0;
padding: 10px 18px;
width: fit-content;
max-width: 100%;
border: 1px solid rgba(0, 229, 255, .4);
background: rgba(0, 229, 255, .06);
box-shadow: inset 0 0 18px rgba(0, 229, 255, .08), 0 0 18px rgba(0, 229, 255, .08);
color: var(--cyan);
font-size: .7rem;
letter-spacing: .13em;
text-transform: uppercase;
}
.online::before {
content: "";
display: inline-block;
width: 7px;
height: 7px;
margin-right: 8px;
border-radius: 50%;
background: #55ff72;
box-shadow: 0 0 9px #55ff72;
animation: blink 1.5s steps(2, end) infinite;
}
.select-heading {
display: flex;
align-items: center;
gap: 14px;
margin: 30px 0 15px;
color: var(--yellow);
font-size: .83rem;
letter-spacing: .2em;
text-transform: uppercase;
}
.select-heading::before,
.select-heading::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, rgba(255,243,106,.65)); }
.select-heading::after { transform: scaleX(-1); }
.game-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 16px;
}
.game-card {
--accent: var(--cyan);
position: relative;
display: grid;
grid-template-rows: auto 112px auto 1fr auto;
min-width: 0;
min-height: 352px;
overflow: hidden;
border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
border-radius: 8px 8px 18px 18px;
background: linear-gradient(150deg, rgba(255,255,255,.055), transparent 32%), var(--panel);
box-shadow: inset 0 0 26px rgba(0,0,0,.72), 0 13px 28px rgba(0,0,0,.38);
color: var(--ink);
text-decoration: none;
transform: translateZ(0);
transition: border-color .15s, box-shadow .15s, transform .15s;
}
.game-card::before {
content: "";
position: absolute;
inset: 0;
z-index: 3;
border-radius: inherit;
box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
pointer-events: none;
}
.game-card:hover,
.game-card:focus-visible,
.game-card.is-selected {
border-color: var(--accent);
outline: none;
box-shadow: inset 0 0 26px rgba(0,0,0,.62), 0 0 10px color-mix(in srgb, var(--accent) 72%, transparent), 0 0 34px color-mix(in srgb, var(--accent) 30%, transparent);
transform: translateY(-4px);
}
.game-card:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.marquee {
position: relative;
padding: 14px 14px 12px;
overflow: hidden;
border-bottom: 1px solid color-mix(in srgb, var(--accent) 46%, transparent);
background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 20%, #050714), #050714 52%);
}
.marquee::after {
content: "";
position: absolute;
inset: 0;
background: repeating-linear-gradient(135deg, transparent 0 9px, rgba(255,255,255,.025) 9px 10px);
}
.marquee h2 {
position: relative;
z-index: 1;
margin: 0;
color: #fff;
font-family: Impact, "Arial Black", sans-serif;
font-size: clamp(1.32rem, 2.2vw, 1.76rem);
font-style: italic;
font-weight: 900;
letter-spacing: .045em;
line-height: 1;
text-transform: uppercase;
text-shadow: 2px 2px 0 color-mix(in srgb, var(--accent) 58%, #000), 0 0 10px var(--accent);
}
.year { position: relative; z-index: 1; float: right; margin-top: -16px; color: var(--accent); font-size: .64rem; letter-spacing: .14em; }
.game-screen {
position: relative;
display: grid;
place-items: center;
margin: 12px 12px 0;
overflow: hidden;
border: 5px solid #151829;
border-radius: 10px;
background:
linear-gradient(rgba(255,255,255,.018), rgba(255,255,255,.018)),
radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 12%, #000), #000 70%);
box-shadow: inset 0 0 28px #000, 0 0 0 1px #30354b;
color: var(--accent);
}
.game-screen::after {
content: "";
position: absolute;
inset: 0;
background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.3) 3px 4px);
pointer-events: none;
}
.game-art { width: 88%; height: 82%; filter: drop-shadow(0 0 5px currentColor); }
.game-art .dim { opacity: .42; }
.game-art .solid { fill: currentColor; stroke: none; }
.game-number {
position: absolute;
top: 7px;
right: 9px;
color: color-mix(in srgb, var(--accent) 66%, #fff);
font-size: .58rem;
letter-spacing: .12em;
}
.description { margin: 13px 14px 9px; color: #dbe2f2; font-size: .73rem; line-height: 1.48; }
.controls {
margin: 0 14px 12px;
padding-top: 9px;
border-top: 1px dashed rgba(255,255,255,.14);
color: var(--muted);
font-size: .63rem;
line-height: 1.48;
letter-spacing: .035em;
text-transform: uppercase;
}
.controls strong { color: var(--accent); font-weight: 700; }
.play-prompt {
align-self: end;
margin-top: auto;
padding: 10px 14px;
border-top: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
background: color-mix(in srgb, var(--accent) 8%, transparent);
color: var(--yellow);
font-size: .7rem;
font-weight: 700;
letter-spacing: .15em;
text-align: center;
text-transform: uppercase;
}
.game-card:hover .play-prompt,
.game-card:focus-visible .play-prompt,
.game-card.is-selected .play-prompt { color: #fff; text-shadow: 0 0 8px var(--yellow); animation: prompt-pulse .8s steps(2, end) infinite; }
.footer {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 9px 22px;
margin-top: 28px;
color: #69758d;
font-size: .67rem;
letter-spacing: .09em;
line-height: 1.6;
text-align: center;
text-transform: uppercase;
}
.footer kbd {
padding: 2px 5px;
border: 1px solid #4b5570;
border-radius: 3px;
background: #0c1020;
color: #cbd5e7;
font: inherit;
}
@media (max-width: 1020px) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .arcade-shell { padding-top: 32px; } }
@media (max-width: 490px) { .game-grid { grid-template-columns: 1fr; } .game-card { min-height: 330px; } .game-screen { height: 118px; } .status-bar span:nth-child(2) { display: none; } }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@keyframes blink { 50% { opacity: .35; } }
@keyframes prompt-pulse { 50% { opacity: .62; } }
@keyframes star-drift { to { transform: translate3d(83px, 83px, 0); } }
</style>
</head>
<body>
<a class="skip-link" href="#games">Skip to game selection</a>
<div class="stars" aria-hidden="true"></div>
<main class="arcade-shell">
<header class="masthead">
<p class="eyebrow">The home computer arcade</p>
<h1>Arcade <span>Clones</span></h1>
<p class="tagline">Seven legends. One screen. Infinite credits.</p>
<div class="status-bar" aria-label="Arcade status">
<span class="online">7 machines online</span>
<span>Free play enabled</span>
<span>Player 1 ready</span>
</div>
</header>
<h2 class="select-heading" id="games"><span>Select a cabinet</span></h2>
<section class="game-grid" aria-label="Available arcade games">
<a class="game-card is-selected" style="--accent:#7df9ff" href="Asteroids.html" aria-current="true">
<div class="marquee"><h2>Asteroids</h2><span class="year">1979</span></div>
<div class="game-screen">
<span class="game-number">01</span>
<svg class="game-art" viewBox="0 0 180 90" role="img" aria-label="Vector ship flying through asteroids">
<g fill="none" stroke="currentColor" stroke-width="2"><path d="M32 49 66 34 57 50 66 66Z"/><path d="M18 22 29 13 43 18 45 32 34 41 20 35Z"/><path d="m119 17 14-7 15 9-1 17-16 8-14-10Z"/><path d="m126 64 10-7 14 4 4 12-11 9-15-5Z"/><path d="M72 50h30" stroke-dasharray="9 7"/></g>
</svg>
</div>
<p class="description">Split drifting rocks, dodge saucers, and survive the vector void.</p>
<p class="controls"><strong>Move</strong> arrows / WASD <strong>Fire</strong> Space<br><strong>Hyper</strong> Down / Shift <strong>Pause</strong> P</p>
<span class="play-prompt">Press Enter to play</span>
</a>
<a class="game-card" style="--accent:#71ff6d" href="Centipede.html">
<div class="marquee"><h2>Centipede</h2><span class="year">1981</span></div>
<div class="game-screen">
<span class="game-number">02</span>
<svg class="game-art" viewBox="0 0 180 90" role="img" aria-label="Centipede moving through mushrooms">
<g fill="none" stroke="currentColor" stroke-width="2"><path d="M20 18c26 0 24 23 49 23h58c22 0 22 24 42 24"/><circle cx="25" cy="18" r="7"/><circle cx="45" cy="27" r="7"/><circle cx="66" cy="41" r="7"/><circle cx="87" cy="41" r="7"/><circle cx="108" cy="41" r="7"/><circle cx="129" cy="42" r="7"/><circle cx="148" cy="55" r="7"/></g><g class="solid"><path d="M43 65h16l-3-8H46Z"/><path d="M92 76h16l-3-8H95Z"/><path d="M133 24h16l-3-8h-10Z"/></g>
</svg>
</div>
<p class="description">Blast the winding invader as it descends through a mushroom field.</p>
<p class="controls"><strong>Move</strong> arrows / WASD / pointer<br><strong>Fire</strong> Space / hold <strong>Pause</strong> P</p>
<span class="play-prompt">Press Enter to play</span>
</a>
<a class="game-card" style="--accent:#ff5bd2" href="Defender.html">
<div class="marquee"><h2>Defender</h2><span class="year">1981</span></div>
<div class="game-screen">
<span class="game-number">03</span>
<svg class="game-art" viewBox="0 0 180 90" role="img" aria-label="Spaceship defending a mountainous planet">
<g fill="none" stroke="currentColor" stroke-width="2"><path d="m34 45 28-11 22 11-22 11Z"/><path d="M19 70 36 54l18 16 17-10 17 10 20-20 18 20 18-12 20 12"/><path d="M92 45h41" stroke-dasharray="12 7"/><path d="M143 29v20m-6-12h12"/></g>
</svg>
</div>
<p class="description">Patrol a wraparound world, destroy alien raiders, and rescue humanoids.</p>
<p class="controls"><strong>Move</strong> arrows / WASD <strong>Fire</strong> Space<br><strong>Bomb</strong> B / Shift <strong>Hyper</strong> H / Ctrl</p>
<span class="play-prompt">Press Enter to play</span>
</a>
<a class="game-card" style="--accent:#ff5a5f" href="Donkey%20Kong.html">
<div class="marquee"><h2>Donkey Kong</h2><span class="year">1981</span></div>
<div class="game-screen">
<span class="game-number">04</span>
<svg class="game-art" viewBox="0 0 180 90" role="img" aria-label="Girders, ladders, and rolling barrels">
<g fill="none" stroke="currentColor" stroke-width="3"><path d="M18 71h145M22 48h137M31 24h128"/><path d="M51 48v23m0-17h15v17M111 24v24m0-17h14v17"/><circle cx="83" cy="40" r="9"/><path d="m77 34 12 12m0-12L77 46"/></g><g class="solid"><rect x="135" y="54" width="10" height="16"/><rect x="131" y="69" width="6" height="4"/><rect x="143" y="69" width="6" height="4"/></g>
</svg>
</div>
<p class="description">Climb the 25m girders, leap barrels, and reach the top.</p>
<p class="controls"><strong>Move / climb</strong> arrows / WASD<br><strong>Jump</strong> Space <strong>Pause</strong> P</p>
<span class="play-prompt">Press Enter to play</span>
</a>
<a class="game-card" style="--accent:#62ff84" href="Frogger.html">
<div class="marquee"><h2>Frogger</h2><span class="year">1981</span></div>
<div class="game-screen">
<span class="game-number">05</span>
<svg class="game-art" viewBox="0 0 180 90" role="img" aria-label="Frog crossing traffic and water">
<g fill="none" stroke="currentColor" stroke-width="2"><path d="M8 30h164M8 61h164" stroke-dasharray="14 8"/><rect x="22" y="38" width="38" height="14" rx="3"/><rect x="119" y="67" width="39" height="12" rx="3"/><path d="M84 49c0-9 13-9 13 0v12H84Zm0 3-9-7m22 7 9-7M86 61l-8 8m17-8 8 8"/></g><circle class="solid" cx="87" cy="45" r="3"/><circle class="solid" cx="94" cy="45" r="3"/>
</svg>
</div>
<p class="description">Thread traffic, ride logs and turtles, and fill every home bay.</p>
<p class="controls"><strong>Hop</strong> arrows / WASD / touch<br><strong>Pause</strong> P <strong>Mute</strong> M</p>
<span class="play-prompt">Press Enter to play</span>
</a>
<a class="game-card" style="--accent:#ff9d3f" href="Missile_Command.html">
<div class="marquee"><h2>Missile Command</h2><span class="year">1980</span></div>
<div class="game-screen">
<span class="game-number">06</span>
<svg class="game-art" viewBox="0 0 180 90" role="img" aria-label="Defense missiles exploding above cities">
<g fill="none" stroke="currentColor" stroke-width="2"><path d="M20 72h142M28 72V61h9v11m6 0V57h11v15m54 0V59h10v13m7 0V62h10v10M37 14l46 44m58-45L96 57"/><circle cx="89" cy="39" r="17"/><path d="M89 15v48M65 39h48M72 22l34 34m0-34L72 56"/></g>
</svg>
</div>
<p class="description">Protect six cities by detonating defensive missiles in the sky.</p>
<p class="controls"><strong>Aim / fire</strong> mouse or touch<br><strong>Batteries</strong> A/S/D or 1/2/3 <strong>Pause</strong> P</p>
<span class="play-prompt">Press Enter to play</span>
</a>
<a class="game-card" style="--accent:#ffe34f" href="Pac%20Man.html">
<div class="marquee"><h2>Pac-Man</h2><span class="year">1980</span></div>
<div class="game-screen">
<span class="game-number">07</span>
<svg class="game-art" viewBox="0 0 180 90" role="img" aria-label="Pac-Man chasing pellets through a maze">
<g fill="none" stroke="currentColor" stroke-width="2"><path class="dim" d="M10 13h160v64H10zm12 12h38v40H22m136 0h-38V25h38"/><path class="solid" d="M81 45 110 27a34 34 0 1 0 0 36Z"/><circle class="solid" cx="126" cy="45" r="3"/><circle class="solid" cx="142" cy="45" r="3"/><circle class="solid" cx="158" cy="45" r="3"/></g>
</svg>
</div>
<p class="description">Clear the maze, eat power pellets, and outsmart all four ghosts.</p>
<p class="controls"><strong>Move</strong> arrows / WASD / swipe<br><strong>Pause</strong> P <strong>Mute</strong> M</p>
<span class="play-prompt">Press Enter to play</span>
</a>
</section>
<footer class="footer">
<span><kbd>Arrow keys</kbd> choose a cabinet</span>
<span><kbd>Enter</kbd> launches</span>
<span><kbd>Esc</kbd> returns here from any game</span>
</footer>
</main>
<script>
(() => {
const grid = document.querySelector('.game-grid');
const cards = Array.from(grid.querySelectorAll('.game-card'));
let selectedIndex = 0;
function selectCard(index, moveFocus = false) {
selectedIndex = (index + cards.length) % cards.length;
cards.forEach((card, cardIndex) => {
const selected = cardIndex === selectedIndex;
card.classList.toggle('is-selected', selected);
if (selected) card.setAttribute('aria-current', 'true');
else card.removeAttribute('aria-current');
});
if (moveFocus) cards[selectedIndex].focus({ preventScroll: true });
}
function columnCount() {
const columns = getComputedStyle(grid).gridTemplateColumns.split(' ').length;
return Math.max(1, columns);
}
cards.forEach((card, index) => {
card.addEventListener('mouseenter', () => selectCard(index));
card.addEventListener('focus', () => selectCard(index));
});
document.addEventListener('keydown', event => {
let next = selectedIndex;
const columns = columnCount();
if (event.key === 'ArrowRight') next += 1;
else if (event.key === 'ArrowLeft') next -= 1;
else if (event.key === 'ArrowDown') next += columns;
else if (event.key === 'ArrowUp') next -= columns;
else if (event.key === 'Home') next = 0;
else if (event.key === 'End') next = cards.length - 1;
else if ((event.key === 'Enter' || event.key === ' ') && !cards.includes(document.activeElement)) {
event.preventDefault();
cards[selectedIndex].click();
return;
} else return;
event.preventDefault();
selectCard(next, true);
cards[selectedIndex].scrollIntoView({ block: 'nearest', behavior: 'smooth' });
});
})();
</script>
</body>
</html>