-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
478 lines (418 loc) · 24.1 KB
/
Copy pathindex.html
File metadata and controls
478 lines (418 loc) · 24.1 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<title>Squimball Studios</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #0e0e10;
--bar: #16161a;
--border: #2a2a30;
--accent: #e8ff47;
--muted: #555560;
--text: #c8c8d4;
--hover-bg: #22222a;
--panel-bg: #13131a;
--bar-h: 32px;
}
html, body { height: 100%; background: var(--bg); font-family: 'JetBrains Mono', monospace; color: var(--text); overflow: hidden; }
/* ── TOP BAR ──────────────────────────────────────────── */
#topbar {
position: fixed; top: 0; left: 0; right: 0;
height: var(--bar-h);
background: var(--bar);
border-bottom: 1px solid var(--border);
display: flex; align-items: center; gap: 2px;
padding: 0 6px;
z-index: 300;
user-select: none;
}
.pg-btn {
display: flex; align-items: center; justify-content: center;
width: 22px; height: 22px;
border: 1px solid var(--border);
background: transparent; color: var(--muted);
font-family: inherit; font-size: 10px; font-weight: 600;
cursor: pointer; border-radius: 3px;
transition: background .12s, color .12s, border-color .12s;
}
.pg-btn:hover { background: var(--hover-bg); color: var(--text); border-color: var(--muted); }
.pg-btn.active { background: var(--accent); color: #0e0e10; border-color: var(--accent); }
/* Firework page button: gentle glow + occasional sparkle to draw the eye */
#star-btn {
position: relative; overflow: visible;
color: var(--accent); border-color: rgba(232,255,71,.5);
animation: starGlow 2.2s ease-in-out infinite;
}
#star-btn:hover { color: var(--accent); }
@keyframes starGlow {
0%,100% { box-shadow: 0 0 3px rgba(232,255,71,.30); text-shadow: 0 0 4px rgba(232,255,71,.5); }
50% { box-shadow: 0 0 11px rgba(232,255,71,.75); text-shadow: 0 0 9px rgba(232,255,71,.95); }
}
/* sparkles use ::before + a .spk child (NOT ::after): ::after is reserved for the
shared [data-tip] tooltip, which an ID-level #star-btn::after rule would override */
#star-btn::before, #star-btn .spk {
content: ''; position: absolute; width: 3px; height: 3px; border-radius: 50%;
background: #fff; box-shadow: 0 0 4px 1px rgba(232,255,71,.9);
opacity: 0; pointer-events: none;
}
#star-btn::before { top: -3px; right: -2px; animation: starSparkA 2.4s ease-in-out infinite; }
#star-btn .spk { bottom: -3px; left: -2px; animation: starSparkB 2.4s ease-in-out infinite 1.1s; }
@keyframes starSparkA { 0%,70%,100% { opacity: 0; transform: scale(.2); } 82% { opacity: 1; transform: scale(1); } }
@keyframes starSparkB { 0%,60%,100% { opacity: 0; transform: scale(.2); } 75% { opacity: 1; transform: scale(1); } }
/* when it's the current page, settle down (solid accent, no glow/sparkle) */
#star-btn.active { animation: none; box-shadow: none; text-shadow: none; color: #0e0e10; }
#star-btn.active::before, #star-btn.active .spk { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
#star-btn, #star-btn::before, #star-btn .spk { animation: none; }
#star-btn { box-shadow: 0 0 8px rgba(232,255,71,.5); }
}
.sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.spacer { flex: 1; }
.icon-btn {
display: flex; align-items: center; justify-content: center;
width: 26px; height: 22px;
border: 1px solid transparent; background: transparent;
color: var(--muted); cursor: pointer; border-radius: 3px;
text-decoration: none; font-size: 11px; font-family: inherit;
transition: color .12s, background .12s, border-color .12s;
position: relative;
}
.icon-btn:hover { color: var(--text); background: var(--hover-bg); }
.icon-btn.panel-open { color: var(--accent); border-color: var(--border); background: var(--hover-bg); }
.icon-btn svg { width: 13px; height: 13px; fill: currentColor; }
/* tooltip — hidden when panel is open */
[data-tip] { position: relative; }
[data-tip]::after {
content: attr(data-tip);
position: absolute; top: calc(100% + 7px); left: 50%;
transform: translateX(10%);
background: #1e1e26; color: var(--text); font-size: 9px;
letter-spacing: .05em; padding: 3px 7px; border-radius: 3px;
border: 1px solid var(--border); white-space: nowrap;
pointer-events: none; opacity: 0;
transition: opacity .15s .25s; z-index: 400;
}
[data-tip]:not(.panel-open):hover::after { opacity: 1; }
[data-tip-rtl] { position: relative; }
[data-tip-rtl]::after {
content: attr(data-tip-rtl);
position: absolute; top: calc(100% + 7px); left: 50%;
transform: translateX(-120%);
background: #1e1e26; color: var(--text); font-size: 9px;
letter-spacing: .05em; padding: 3px 7px; border-radius: 3px;
border: 1px solid var(--border); white-space: nowrap;
pointer-events: none; opacity: 0;
transition: opacity .15s .25s; z-index: 400;
}
[data-tip-rtl]:not(.panel-open):hover::after { opacity: 1; }
/* ── SLIDE-DOWN PANELS ────────────────────────────────── */
.panel {
position: fixed;
top: var(--bar-h);
right: 10px;
width: 320px;
background: var(--panel-bg);
border: 1px solid var(--border);
border-top: 2px solid var(--accent);
border-radius: 0 0 6px 6px;
z-index: 200;
overflow: hidden;
max-height: 0;
opacity: 0;
pointer-events: none;
transition: max-height .3s cubic-bezier(.4,0,.2,1), opacity .22s ease;
}
.panel.open { max-height: 520px; opacity: 1; pointer-events: all; }
.panel-inner { padding: 16px 18px 18px; }
.panel h2 {
font-size: 10px; font-weight: 700; letter-spacing: .14em;
text-transform: uppercase; color: var(--accent);
margin-bottom: 10px; padding-bottom: 8px;
border-bottom: 1px solid var(--border);
}
.panel p { font-size: 10px; line-height: 1.75; color: var(--text); margin-bottom: 8px; }
.panel a { color: var(--accent); text-decoration: none; }
.panel a:hover { text-decoration: underline; }
.addr-row {
display: flex; align-items: center; gap: 8px;
background: #0a0a0e; border: 1px solid var(--border);
border-radius: 4px; padding: 8px 10px; margin-top: 8px;
}
.addr-row code {
flex: 1; font-size: 9px; color: var(--muted);
word-break: break-all; line-height: 1.5; font-family: inherit;
}
.copy-btn {
flex-shrink: 0; background: var(--hover-bg); border: 1px solid var(--border);
color: var(--text); font-family: inherit; font-size: 9px; letter-spacing: .05em;
padding: 4px 9px; border-radius: 3px; cursor: pointer;
transition: background .12s, color .12s, border-color .12s;
}
.copy-btn:hover { background: var(--accent); color: #0e0e10; border-color: var(--accent); }
.copy-btn.copied { background: #1a3a1a; color: #7ef07e; border-color: #3a6a3a; }
.kofi-btn {
display: inline-flex; align-items: center; gap: 6px;
margin-top: 12px; padding: 8px 16px;
background: #461919; border: none; border-radius: 4px;
color: #fff; font-family: inherit; font-size: 10px; font-weight: 700;
cursor: pointer; text-decoration: none;
transition: opacity .15s;
}
.kofi-btn:hover { opacity: .85; }
.qr-img {
display: block; width: 150px; height: 150px; margin: 10px auto 4px;
border-radius: 4px; background: #fff; padding: 6px;
}
.gh-stats { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.gh-pill {
background: var(--hover-bg); border: 1px solid var(--border);
border-radius: 20px; font-size: 9px; padding: 3px 10px;
color: var(--text); letter-spacing: .04em;
}
.gh-pill span { color: var(--accent); font-weight: 700; }
.panel-note {
margin-top: 10px; font-size: 9px; color: var(--muted);
line-height: 1.6; letter-spacing: .03em;
}
#visitor-label {
font-size: 9px;
letter-spacing: .08em;
color: var(--muted);
white-space: nowrap;
padding: 0 6px;
}
/* invisible scrim to catch outside clicks */
#scrim { display: none; position: fixed; inset: 0; z-index: 150; }
#scrim.active { display: block; }
/* ── CONTENT PANE ─────────────────────────────────────── */
#content { position: fixed; top: var(--bar-h); left: 0; right: 0; bottom: 0; transition: top .2s ease; }
/* ── FULLSCREEN (collapse the top bar so the content fills the screen) ── */
body.fullscreen #topbar { display: none; }
body.fullscreen #content { top: 0; }
#fs-exit { display: none; position: fixed; top: 4px; left: 4px; z-index: 320; width: 15px; height: 15px;
align-items: center; justify-content: center; background: var(--bar); border: 1px solid var(--border);
border-radius: 4px; color: var(--muted); cursor: pointer; opacity: .55; transition: opacity .15s, color .15s, background .15s; }
body.fullscreen #fs-exit { display: flex; }
#fs-exit:hover { opacity: 1; color: var(--text); background: var(--hover-bg); }
#fs-exit svg { width: 15px; height: 15px; fill: currentColor; }
.page-frame { width: 100%; height: 100%; border: none; display: none; background: var(--bg); }
.page-frame.active { display: block; }
#placeholder {
width: 100%; height: 100%;
display: flex; align-items: center; justify-content: center;
color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
}
</style>
</head>
<body>
<!-- ══════════════════════════════════════════════════════
TOP BAR
════════════════════════════════════════════════════════ -->
<nav id="topbar">
<button class="pg-btn" data-tip="Home" onclick="show(0)">⌂</button>
<div class="sep"></div>
<button class="pg-btn" data-tip="Gravity Simulator" onclick="show(1)">1</button>
<button class="pg-btn" data-tip="Earthquake Animator" onclick="show(2)">2</button>
<button class="pg-btn" data-tip="Solar Flare Map" onclick="show(3)">3</button>
<button class="pg-btn" data-tip="Asteroid Impact" onclick="show(4)">4</button>
<button class="pg-btn" data-tip="PIT Game" onclick="show(5)">5</button>
<button class="pg-btn" data-tip="Wildlife Globe" onclick="show(6)">6</button>
<button class="pg-btn" data-tip="Orbit Simulator" onclick="show(7)">7</button>
<button class="pg-btn" data-tip="Chroma Match Game" onclick="show(8)">8</button>
<button class="pg-btn" data-tip="Firework Randomizer" onclick="show(9)" id="star-btn">★<i class="spk"></i></button>
<div class="sep"></div>
<button class="icon-btn" id="fs-btn" data-tip="Fullscreen" onclick="toggleFullscreen()">
<svg viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>
</button>
<div class="spacer"></div>
<span id="visitor-label"></span>
<div class="sep"></div>
<!-- X -->
<a class="icon-btn" data-tip-rtl="X / Twitter" href="https://x.com/c0deConstructor" target="_blank" rel="noopener">
<svg viewBox="0 0 24 24"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.746l7.73-8.835L1.254 2.25H8.08l4.213 5.567zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
</a>
<!-- YouTube -->
<a class="icon-btn" data-tip-rtl="YouTube" href="https://www.youtube.com/@squimball" target="_blank" rel="noopener">
<svg viewBox="0 0 24 24"><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>
</a>
<div class="sep"></div>
<!-- GitHub -->
<button class="icon-btn" data-tip-rtl="GitHub" onclick="togglePanel('gh-panel', this)">
<svg viewBox="0 0 24 24"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
</button>
<!-- Ko-fi -->
<button class="icon-btn" data-tip-rtl="Support" onclick="togglePanel('kofi-panel', this)">
<svg viewBox="0 0 24 24"><path d="M23.881 8.948c-.773-4.085-4.859-4.593-4.859-4.593H.723c-.604 0-.679.798-.679.798s-.082 7.324-.022 11.822c.164 2.424 2.586 2.672 2.586 2.672s8.267-.023 11.966-.049c2.438-.426 2.683-2.566 2.658-3.734 4.352.24 7.422-2.831 6.649-6.916zm-11.062 3.511c-1.246 1.453-4.011 3.976-4.011 3.976s-.121.119-.31.023c-.076-.057-.108-.09-.108-.09-.443-.441-3.368-3.049-4.034-3.954-.238-.3-.404-.494-.44-.87-.065-.749.19-1.34.692-1.728.73-.563 1.669-.207 2.148.27.283.282.508.637.7.888.175-.235.39-.582.67-.871.509-.505 1.415-.843 2.125-.24.739.626.871 1.668.571 2.596zm7.391 2.16c-.924.824-5.503 1.754-5.503-2.267 0-3.213 3.12-3.981 5.503-3.533.858.165 1.578.662 1.755 1.578.343 1.753-.524 3.348-1.755 4.222z"/></svg>
</button>
<div class="sep"></div>
<!-- Bitcoin -->
<button class="icon-btn" data-tip-rtl="Bitcoin" onclick="togglePanel('btc-panel', this)">
<svg viewBox="0 0 24 24"><path d="M23.638 14.904c-1.602 6.43-8.113 10.34-14.542 8.736C2.67 22.05-1.244 15.525.362 9.105 1.962 2.67 8.475-1.243 14.9.358c6.43 1.605 10.342 8.115 8.738 14.548v-.002zm-6.35-4.613c.24-1.59-.974-2.45-2.64-3.03l.54-2.153-1.315-.328-.525 2.107c-.345-.087-.705-.167-1.064-.25l.526-2.127-1.32-.33-.54 2.165c-.285-.065-.567-.13-.84-.2l-1.815-.45-.35 1.407s.975.225.955.236c.535.136.63.486.615.766l-1.477 5.92c-.075.166-.24.406-.614.314.015.02-.96-.24-.96-.24l-.66 1.51 1.71.426.93.242-.54 2.19 1.32.327.54-2.17c.36.1.705.19 1.05.273l-.51 2.154 1.32.33.545-2.19c2.24.427 3.93.257 4.64-1.774.57-1.637-.03-2.58-1.217-3.196.854-.193 1.5-.76 1.68-1.93h.01zm-3.01 4.22c-.404 1.64-3.157.75-4.05.53l.72-2.9c.896.23 3.757.67 3.33 2.37zm.41-4.24c-.37 1.49-2.662.735-3.405.55l.654-2.64c.744.18 3.137.524 2.75 2.084v.006z"/></svg>
</button>
<!-- Ethereum -->
<button class="icon-btn" data-tip-rtl="Ethereum" onclick="togglePanel('eth-panel', this)">
<svg viewBox="0 0 24 24"><path d="M11.944 17.97L4.58 13.62 11.943 24l7.37-10.38-7.372 4.35h.003zM12.056 0L4.69 12.223l7.365 4.354 7.365-4.35L12.056 0z"/></svg>
</button>
</nav>
<!-- Fullscreen exit (only visible while the top bar is collapsed) -->
<button id="fs-exit" onclick="toggleFullscreen()" title="Exit fullscreen" aria-label="Exit fullscreen">
<svg viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/></svg>
</button>
<!-- click-outside scrim -->
<div id="scrim" onclick="closeAllPanels()"></div>
<!-- ══════════════════════════════════════════════════════
DROP-DOWN PANELS (overlay the content, never push it)
════════════════════════════════════════════════════════ -->
<!-- GitHub -->
<div class="panel" id="gh-panel">
<div class="panel-inner">
<h2>GitHub</h2>
<p>Open-source projects, experiments, and tools.</p>
<!-- <div class="gh-stats">
<div class="gh-pill"><span>42</span> repos</div>
<div class="gh-pill"><span>138</span> followers</div>
<div class="gh-pill"><span>3.2k</span> commits</div>
</div> -->
<p>Currently active as <a href="https://github.com/c0deConstructor" target="_blank" rel="noopener">@c0deConstructor</a></p>
<p><a href="https://github.com/c0deConstructor/squimballstudios.com" target="_blank" rel="noopener">→ View profile on GitHub</a></p>
</div>
</div>
<!-- Ko-fi -->
<div class="panel" id="kofi-panel">
<div class="panel-inner">
<h2>Support this work</h2>
<p>If anything here has been useful, consider buying me a coffee. It keeps me interested in making even more cool things for people.</p>
<p>No subscription, no account required — just a one-time tip.</p>
<a class="kofi-btn" href="https://ko-fi.com/squimball" target="_blank" rel="noopener">☕ Support me on Ko-fi</a>
</div>
</div>
<!-- Bitcoin -->
<div class="panel" id="btc-panel">
<div class="panel-inner">
<h2>Bitcoin</h2>
<p>Send BTC donations directly to this address. Help me continue to grow and create cool things for all to enjoy!</p>
<img class="qr-img" src="images/btc-address.png" alt="Bitcoin donation address QR code">
<div class="addr-row">
<code id="btc-addr">1MKmJGv8M4suSFSyJiVrQjFhatP6gfdr1F</code>
<button class="copy-btn" onclick="copyAddr('btc-addr', this)">COPY</button>
</div>
<p class="panel-note">Network: Bitcoin mainnet · No memo required</p>
</div>
</div>
<!-- Ethereum -->
<div class="panel" id="eth-panel">
<div class="panel-inner">
<h2>Ethereum</h2>
<p>Send ETH or any ERC-20 token to this address. Help me continue to grow and create cool things for all to enjoy!</p>
<img class="qr-img" src="images/eth-address.png" alt="Ethereum donation address QR code">
<div class="addr-row">
<code id="eth-addr">0xd32b4c53329a45ed2d24E21C830779877F5E6eD1</code>
<button class="copy-btn" onclick="copyAddr('eth-addr', this)">COPY</button>
</div>
<p class="panel-note">Network: Ethereum mainnet · ERC-20 compatible</p>
</div>
</div>
<!-- ══════════════════════════════════════════════════════
CONTENT PANE
════════════════════════════════════════════════════════ -->
<main id="content">
<div id="placeholder">select a page ↑</div>
<iframe class="page-frame active" id="frame-0" data-src="pages/home.html" src="" title="Home"></iframe>
<iframe class="page-frame" id="frame-1" data-src="pages/gravity_simulator1.html" src="" title="Gravity Simulator 1"></iframe>
<iframe class="page-frame" id="frame-2" data-src="pages/moved_quakes.html" src="" title="Earthquake Animator"></iframe>
<iframe class="page-frame" id="frame-3" data-src="pages/solar_flare_map_gl.html" src="" title="Solar Flare Map"></iframe>
<iframe class="page-frame" id="frame-4" data-src="pages/asteroid_impact.html" src="" title="Asteroid Impact"></iframe>
<iframe class="page-frame" id="frame-5" data-src="pages/pit_game.html" src="" title="PIT Game"></iframe>
<iframe class="page-frame" id="frame-6" data-src="pages/wildlife_globe.html" src="" title="Wildlife Globe"></iframe>
<iframe class="page-frame" id="frame-7" data-src="pages/orbit_simulator.html" src="" title="Orbit Simulator"></iframe>
<iframe class="page-frame" id="frame-8" data-src="pages/moved_chroma.html" src="" title="Chroma Match"></iframe>
<iframe class="page-frame" id="frame-9" data-src="pages/firework_randomizer.html" allow="clipboard-write; autoplay" src="" title="Firework Randomizer"></iframe>
</main>
<script>
/* ── page switching ──────────────────────────────────── */
const pgBtns = document.querySelectorAll('.pg-btn');
const frames = document.querySelectorAll('.page-frame');
let current = 0;
function show(idx) {
idx = Math.max(0, Math.min(pgBtns.length - 1, idx));
if (idx === current && frames[current].src.includes(frames[current].dataset.src || '')) return;
closeAllPanels();
// Unload the leaving frame so its RAF / physics loops fully terminate
const leaving = frames[current];
if (leaving.src && leaving.src !== 'about:blank') leaving.src = 'about:blank';
pgBtns[current].classList.remove('active');
leaving.classList.remove('active');
current = idx;
// Load (or reload) the arriving frame fresh with cache-bust timestamp
const f = frames[current];
f.src = f.dataset.src + '?v=' + Date.now();
pgBtns[current].classList.add('active');
f.classList.add('active');
document.getElementById('placeholder').style.display = 'none';
history.replaceState(null, '', idx === 0 ? location.pathname : '?p=' + idx);
}
// Receive navigation requests from child iframes (home page cards)
window.addEventListener('message', e => {
if (e.data && e.data.sq === 'show') show(e.data.page);
});
document.addEventListener('keydown', e => {
if (e.key === 'Escape') { document.body.classList.remove('fullscreen'); closeAllPanels(); return; }
const n = parseInt(e.key);
// Keys 1-3 map to pages 1-3; key 0 goes home
if (!isNaN(n) && n >= 0 && n <= pgBtns.length - 1) show(n);
});
/* ── fullscreen: collapse the top bar so the content fills the screen ── */
function toggleFullscreen() { document.body.classList.toggle('fullscreen'); }
/* ── panel toggle ────────────────────────────────────── */
function togglePanel(panelId, btn) {
const panel = document.getElementById(panelId);
const isOpen = panel.classList.contains('open');
closeAllPanels();
if (!isOpen) {
panel.classList.add('open');
btn.classList.add('panel-open');
document.getElementById('scrim').classList.add('active');
}
}
function closeAllPanels() {
document.querySelectorAll('.panel').forEach(p => p.classList.remove('open'));
document.querySelectorAll('.icon-btn').forEach(b => b.classList.remove('panel-open'));
document.getElementById('scrim').classList.remove('active');
}
/* ── copy address ────────────────────────────────────── */
async function copyAddr(elemId, btn) {
const text = document.getElementById(elemId).textContent.trim();
try { await navigator.clipboard.writeText(text); }
catch { prompt('Copy this address:', text); return; }
btn.textContent = 'COPIED';
btn.classList.add('copied');
setTimeout(() => { btn.textContent = 'COPY'; btn.classList.remove('copied'); }, 2000);
}
// Read ?p= from URL on load, default to home (0)
const _urlP = parseInt(new URLSearchParams(location.search).get('p'));
show(!isNaN(_urlP) && _urlP >= 0 && _urlP < pgBtns.length ? _urlP : 0);
/* ── visitor counter ─────────────────────────────────── */
{
const _tok = localStorage.getItem('sq_vt') || '';
fetch('counter.php' + (_tok ? '?tok=' + encodeURIComponent(_tok) : ''))
.then(r => r.json())
.then(d => {
if (d.n) {
document.getElementById('visitor-label').textContent =
'unique visitor #' + d.n.toLocaleString();
if (d.tok) localStorage.setItem('sq_vt', d.tok);
}
})
.catch(() => {}); // silently fail if PHP isn't available (e.g. local file browsing)
}
</script>
</body>
</html>