class-studys 1.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.html +4 -1729
  2. package/package.json +2 -2
package/index.html CHANGED
@@ -9,746 +9,9 @@
9
9
  <link rel="preconnect" href="https://fonts.googleapis.com">
10
10
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11
11
  <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap" rel="stylesheet">
12
- <style>
13
- /* IGNITE OS styles — embedded */
14
- /* ═══════════════════════════════════════════════════════════
15
- IGNITE OS styles — dark orange engine
16
- ═══════════════════════════════════════════════════════════ */
17
-
18
- :root {
19
- --bg0: #0a0705; --bg1: #140d08; --bg2: #1c130c;
20
- --panel: rgba(20, 13, 9, 0.55);
21
- --panel-solid: #151009;
22
- --panel-2: rgba(28, 19, 13, 0.85);
23
- --line: rgba(255, 255, 255, 0.08);
24
- --line-2: rgba(255, 255, 255, 0.16);
25
- --text: #f4eee6; --muted: #a29588; --dim: #6f635a;
26
- --accent: #ff6b1a; --accent2: #ffb26b;
27
- --on-accent: #140600;
28
- --glow: 0.7; --blur: 14px; --radius: 18px; --saturate: 1;
29
- --font: 'Outfit', 'Segoe UI', system-ui, sans-serif;
30
- --hero-size: clamp(2.6rem, 6.4vw, 5rem);
31
- --ease: cubic-bezier(.22, .8, .3, 1);
32
- }
33
-
34
- * { margin: 0; padding: 0; box-sizing: border-box; }
35
- html { scroll-behavior: smooth; }
36
-
37
- body {
38
- background: var(--bg0); color: var(--text);
39
- font-family: var(--font); font-weight: 400;
40
- min-height: 100vh; overflow-x: hidden; line-height: 1.55;
41
- }
42
- body[data-font='grotesk'] { --font: 'Space Grotesk', 'Outfit', sans-serif; }
43
- body[data-font='mono'] { --font: 'JetBrains Mono', 'Consolas', monospace; }
44
- body[data-font='system'] { --font: 'Segoe UI', system-ui, sans-serif; }
45
-
46
- ::selection { background: var(--accent); color: var(--on-accent); }
47
- ::-webkit-scrollbar { width: 11px; height: 11px; }
48
- ::-webkit-scrollbar-track { background: #0b0706; }
49
- ::-webkit-scrollbar-thumb {
50
- background: linear-gradient(var(--accent), var(--accent2));
51
- border-radius: 9px; border: 3px solid #0b0706;
52
- }
53
-
54
- a { color: inherit; text-decoration: none; }
55
- button { font-family: inherit; cursor: pointer; }
56
- input, select { font-family: inherit; color: inherit; }
57
- .hidden { display: none !important; }
58
-
59
- code, kbd {
60
- font-family: 'JetBrains Mono', monospace;
61
- background: rgba(255, 255, 255, 0.07);
62
- border: 1px solid var(--line); padding: 1px 6px;
63
- border-radius: 6px; font-size: 0.85em; color: var(--accent2);
64
- }
65
-
66
- /* ─────────── background engine ─────────── */
67
-
68
- .bg-wrap {
69
- position: fixed; inset: 0; z-index: -2;
70
- background:
71
- radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
72
- radial-gradient(900px 500px at 10% 110%, color-mix(in srgb, var(--accent2) 10%, transparent), transparent 60%),
73
- linear-gradient(180deg, var(--bg1), var(--bg0) 60%, var(--bg0));
74
- filter: saturate(var(--saturate));
75
- transition: background 0.8s var(--ease);
76
- }
77
- body[data-bg='custom'] .bg-wrap {
78
- background: var(--bgimg, none) center / cover no-repeat fixed, var(--bg0);
79
- }
80
-
81
- .blob {
82
- position: absolute; border-radius: 50%;
83
- filter: blur(95px); opacity: calc(var(--glow) * 0.85);
84
- mix-blend-mode: screen; pointer-events: none;
85
- animation: drift 26s ease-in-out infinite alternate;
86
- will-change: transform;
87
- }
88
- .blob-a {
89
- width: 44vw; height: 44vw; left: -8vw; top: -12vh;
90
- background: radial-gradient(circle, var(--accent), transparent 65%);
91
- animation-duration: 30s;
92
- }
93
- .blob-b {
94
- width: 36vw; height: 36vw; right: -6vw; top: 30vh;
95
- background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, var(--accent2) 45%), transparent 65%);
96
- animation-duration: 24s; animation-delay: -6s;
97
- }
98
- .blob-c {
99
- width: 30vw; height: 30vw; left: 28vw; bottom: -14vh;
100
- background: radial-gradient(circle, var(--accent2), transparent 65%);
101
- animation-duration: 38s; animation-delay: -14s;
102
- }
103
- body[data-bg='grid'] .blob { opacity: calc(var(--glow) * 0.5); }
104
- body[data-bg='stars'] .blob, body[data-bg='stars'] .bg-grid { display: none; }
105
- body[data-bg='mesh'] .blob { animation: none; opacity: calc(var(--glow) * 0.55); }
106
-
107
- @keyframes drift {
108
- 0% { transform: translate3d(0, 0, 0) scale(1); }
109
- 50% { transform: translate3d(6vw, -5vh, 0) scale(1.18); }
110
- 100% { transform: translate3d(-5vw, 4vh, 0) scale(0.94); }
111
- }
112
-
113
- .bg-grid {
114
- position: absolute; inset: 0;
115
- background-image:
116
- linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
117
- linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
118
- background-size: 56px 56px;
119
- -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
120
- mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
121
- animation: gridPan 42s linear infinite alternate; opacity: 0.85;
122
- }
123
- body[data-bg='grid'] .bg-grid {
124
- background-image:
125
- linear-gradient(color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px),
126
- linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px);
127
- opacity: 1;
128
- }
129
- @keyframes gridPan { from { background-position: 0 0; } to { background-position: 56px 112px; } }
130
-
131
- .bg-noise {
132
- position: absolute; inset: 0; opacity: 0.05; pointer-events: none;
133
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
134
- }
135
- #bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
136
-
137
- /* ─────────── nav ─────────── */
138
- /* ─────────── nav ─────────── */
139
-
140
- .nav {
141
- position: sticky; top: 0; z-index: 90;
142
- background: rgba(10, 7, 5, 0.62);
143
- backdrop-filter: blur(calc(var(--blur) * 1.4)) saturate(1.4);
144
- border-bottom: 1px solid var(--line);
145
- }
146
- .nav-inner {
147
- max-width: 1220px; margin: 0 auto; padding: 14px 22px;
148
- display: flex; align-items: center; gap: 18px;
149
- }
150
- .brand { display: flex; align-items: center; gap: 10px; }
151
- .brand-mark {
152
- width: 34px; height: 34px; border-radius: 10px;
153
- display: grid; place-items: center;
154
- background: linear-gradient(135deg, var(--accent), var(--accent2));
155
- color: var(--on-accent); font-size: 15px;
156
- box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent);
157
- }
158
- .brand-name { font-weight: 800; font-size: 1.18rem; letter-spacing: 0.4px; }
159
- .accent-text {
160
- background: linear-gradient(90deg, var(--accent), var(--accent2));
161
- -webkit-background-clip: text; background-clip: text; color: transparent;
162
- }
163
- .brand-ver {
164
- font-size: 0.62rem; color: var(--muted); border: 1px solid var(--line);
165
- padding: 2px 7px; border-radius: 99px; letter-spacing: 1px;
166
- }
167
- .nav-links { display: flex; align-items: center; gap: 4px; margin-left: 12px; flex-wrap: wrap; }
168
- .nav-link {
169
- padding: 7px 14px; border-radius: 10px; font-size: 0.92rem; font-weight: 600;
170
- color: var(--muted); transition: 0.25s var(--ease); background: none; border: none;
171
- }
172
- .nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
173
- .btn-link { font: inherit; }
174
- .btn-link:focus-visible { outline: 2px solid var(--accent); }
175
- .nav-side { margin-left: auto; display: flex; align-items: center; gap: 14px; }
176
- .nav-clock {
177
- font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
178
- color: var(--muted); letter-spacing: 1px;
179
- }
180
- .profile-pill {
181
- background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, #000), color-mix(in srgb, var(--accent) 55%, #000));
182
- color: #ffe9d6; padding: 6px 14px; border-radius: 99px;
183
- font-size: 0.75rem; font-weight: 800; letter-spacing: 1.5px; cursor: pointer;
184
- box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 40%, transparent);
185
- transition: 0.25s var(--ease);
186
- }
187
- .profile-pill:hover { transform: translateY(-1px); filter: brightness(1.1); }
188
-
189
- /* ─────────── layout & hero ─────────── */
190
-
191
- main { max-width: 1220px; margin: 0 auto; padding: 0 22px 60px; display: grid; gap: 22px; }
192
- .hero { padding: 76px 8px 10px; }
193
-
194
- .hero-eyebrow {
195
- display: inline-flex; align-items: center; gap: 9px;
196
- font-size: 0.78rem; letter-spacing: 2.5px; text-transform: uppercase;
197
- color: var(--muted); margin-bottom: 18px;
198
- }
199
- .pulse-dot {
200
- width: 8px; height: 8px; border-radius: 50%;
201
- background: var(--accent); box-shadow: 0 0 12px var(--accent);
202
- animation: pulse 1.8s ease-in-out infinite;
203
- }
204
- @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.75); } }
205
-
206
- .hero-title {
207
- font-size: var(--hero-size); font-weight: 800; line-height: 1.04;
208
- letter-spacing: -1.5px; max-width: 20ch;
209
- }
210
- .gradient-text {
211
- background: linear-gradient(92deg, var(--accent), var(--accent2) 55%, color-mix(in srgb, var(--accent) 40%, #fff));
212
- -webkit-background-clip: text; background-clip: text; color: transparent;
213
- filter: drop-shadow(0 0 30px color-mix(in srgb, var(--accent) 35%, transparent));
214
- }
215
- .hero-sub { margin-top: 20px; max-width: 62ch; color: var(--muted); font-size: 1.04rem; }
216
-
217
- .stat-strip { display: flex; gap: 12px; margin-top: 38px; flex-wrap: wrap; }
218
- .stat {
219
- background: var(--panel); border: 1px solid var(--line);
220
- border-radius: var(--radius); padding: 14px 22px; min-width: 130px;
221
- backdrop-filter: blur(var(--blur));
222
- display: flex; flex-direction: column; transition: 0.3s var(--ease);
223
- }
224
- .stat b {
225
- font-size: 1.6rem; font-weight: 800;
226
- background: linear-gradient(90deg, var(--accent), var(--accent2));
227
- -webkit-background-clip: text; background-clip: text; color: transparent;
228
- }
229
- .stat span { font-size: 0.72rem; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
230
- .stat:hover { transform: translateY(-3px); border-color: var(--line-2); }
231
- /* ─────────── panels & buttons ─────────── */
232
-
233
- .panel {
234
- background: var(--panel);
235
- border: 1px solid var(--line);
236
- border-radius: calc(var(--radius) + 4px);
237
- padding: 26px;
238
- backdrop-filter: blur(var(--blur)) saturate(1.3);
239
- box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
240
- transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
241
- scroll-margin-top: 90px;
242
- }
243
- .panel:hover { border-color: var(--line-2); }
244
- .panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
245
- .panel-title { font-size: 1.28rem; font-weight: 800; letter-spacing: -0.3px; }
246
- .panel-sub { color: var(--muted); font-size: 0.92rem; margin-top: 4px; max-width: 66ch; }
247
-
248
- .badge {
249
- background: rgba(255, 255, 255, 0.05); color: var(--text);
250
- border: 1px solid var(--line); border-radius: 99px;
251
- padding: 6px 14px; font-size: 0.72rem; font-weight: 700;
252
- letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap;
253
- transition: 0.2s var(--ease);
254
- }
255
- .badge:hover { border-color: var(--accent); color: var(--accent2); }
256
- .badge-hot {
257
- background: color-mix(in srgb, var(--accent) 16%, transparent);
258
- border-color: color-mix(in srgb, var(--accent) 45%, transparent);
259
- color: var(--accent2);
260
- }
261
-
262
- .btn {
263
- border: none; border-radius: 12px; padding: 11px 20px;
264
- font-weight: 700; font-size: 0.92rem; letter-spacing: 0.2px;
265
- transition: 0.22s var(--ease);
266
- }
267
- .btn-accent {
268
- background: linear-gradient(135deg, var(--accent), var(--accent2));
269
- color: var(--on-accent);
270
- box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 40%, transparent);
271
- }
272
- .btn-accent:hover { transform: translateY(-2px); filter: brightness(1.07); }
273
- .btn.ghost {
274
- background: rgba(255, 255, 255, 0.05); color: var(--text);
275
- border: 1px solid var(--line);
276
- }
277
- .btn.ghost:hover { border-color: var(--accent); color: var(--accent2); }
278
- .btn-sm { padding: 7px 13px; font-size: 0.8rem; border-radius: 10px; }
279
- .btn-block { width: 100%; }
280
- .icon-btn {
281
- background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
282
- color: var(--text); width: 36px; height: 36px; border-radius: 10px;
283
- display: inline-grid; place-items: center; font-size: 0.85rem;
284
- transition: 0.2s var(--ease);
285
- }
286
- .icon-btn:hover { border-color: var(--accent); color: var(--accent2); }
287
-
288
- /* ─────────── tunnel ─────────── */
289
-
290
- .tunnel-form { display: flex; gap: 10px; flex-wrap: wrap; }
291
- .tunnel-input, .search-input {
292
- flex: 1 1 320px; min-width: 220px;
293
- background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line);
294
- border-radius: 12px; padding: 12px 16px; font-size: 0.95rem;
295
- outline: none; transition: 0.25s var(--ease);
296
- }
297
- .tunnel-input:focus, .search-input:focus {
298
- border-color: var(--accent);
299
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
300
- }
301
- .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
302
- .chip {
303
- background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line);
304
- color: var(--muted); border-radius: 99px; padding: 7px 15px;
305
- font-size: 0.82rem; font-weight: 600; transition: 0.22s var(--ease);
306
- }
307
- .chip:hover {
308
- color: var(--text); border-color: var(--accent);
309
- background: color-mix(in srgb, var(--accent) 10%, transparent);
310
- transform: translateY(-1px);
311
- }
312
- .tunnel-tip { margin-top: 16px; font-size: 0.78rem; color: var(--dim); }
313
-
314
- .local-hint {
315
- background: color-mix(in srgb, var(--accent) 8%, transparent);
316
- border: 1px dashed var(--line-2); border-radius: 12px;
317
- padding: 12px 16px; font-size: 0.85rem; color: var(--muted); margin-bottom: 16px;
318
- }
319
- /* ─────────── game cards ─────────── */
320
-
321
- .game-grid {
322
- display: grid; gap: 16px;
323
- grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
324
- }
325
- .game-card {
326
- position: relative; border-radius: var(--radius); overflow: hidden;
327
- background: var(--panel-2); border: 1px solid var(--line);
328
- transition: 0.3s var(--ease); cursor: pointer;
329
- }
330
- .game-card:hover {
331
- transform: translateY(-5px); border-color: var(--accent);
332
- box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5), 0 0 30px color-mix(in srgb, var(--accent) 18%, transparent);
333
- }
334
- .game-cover {
335
- position: relative; height: 130px; overflow: hidden;
336
- background:
337
- radial-gradient(120% 130% at 12% 8%, color-mix(in srgb, var(--gcolor) 45%, transparent), transparent 55%),
338
- radial-gradient(120% 130% at 90% 95%, color-mix(in srgb, var(--accent2) 30%, transparent), transparent 60%),
339
- linear-gradient(150deg, #241a12, #120a06 70%);
340
- }
341
- .game-cover img {
342
- position: absolute; inset: 0; width: 100%; height: 100%;
343
- object-fit: cover; filter: saturate(1.1); transition: 0.5s var(--ease);
344
- z-index: 1;
345
- }
346
- .game-card:hover .game-cover img { transform: scale(1.06); }
347
- .cover-fallback {
348
- position: absolute; inset: 0; display: grid; place-items: center;
349
- font-size: 3rem; font-weight: 900;
350
- color: color-mix(in srgb, var(--gcolor) 70%, #fff);
351
- text-shadow: 0 0 30px color-mix(in srgb, var(--gcolor) 60%, transparent);
352
- }
353
- .game-play {
354
- position: absolute; right: 12px; bottom: -18px;
355
- width: 44px; height: 44px; border-radius: 50%;
356
- background: linear-gradient(135deg, var(--accent), var(--accent2));
357
- color: var(--on-accent); display: grid; place-items: center;
358
- font-size: 1rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
359
- transition: 0.25s var(--ease); border: none;
360
- }
361
- .game-card:hover .game-play { bottom: 14px; }
362
- .game-body { padding: 16px 16px 18px; }
363
- .game-name { font-weight: 800; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
364
- .game-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
365
- .game-tag {
366
- font-size: 0.66rem; letter-spacing: 1px; text-transform: uppercase;
367
- padding: 3px 9px; border-radius: 99px; color: var(--muted);
368
- background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
369
- }
370
- .game-desc {
371
- color: var(--muted); font-size: 0.82rem; margin-top: 8px;
372
- display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
373
- }
374
- .game-tools {
375
- position: absolute; top: 10px; left: 10px; display: flex; gap: 6px;
376
- opacity: 0; transition: 0.2s var(--ease); z-index: 3;
377
- }
378
- .game-card:hover .game-tools { opacity: 1; }
379
- .game-tools .icon-btn { width: 30px; height: 30px; font-size: 0.72rem; background: rgba(0, 0, 0, 0.55); }
380
- .local-dot {
381
- position: absolute; top: 10px; right: 10px;
382
- background: color-mix(in srgb, var(--gcolor) 85%, #000); color: #fff;
383
- font-size: 0.6rem; font-weight: 800; letter-spacing: 1px;
384
- padding: 3px 8px; border-radius: 99px;
385
- }
386
- /* ─────────── movies ─────────── */
387
-
388
- .movie-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
389
- .movie-toolbar .search-input { flex: 0 1 300px; }
390
- .genre-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
391
- .genre-chip {
392
- background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line);
393
- color: var(--muted); border-radius: 99px; padding: 5px 12px;
394
- font-size: 0.74rem; font-weight: 700; transition: 0.2s var(--ease);
395
- }
396
- .genre-chip.active, .genre-chip:hover {
397
- color: var(--text); border-color: var(--accent);
398
- background: color-mix(in srgb, var(--accent) 12%, transparent);
399
- }
400
- .select-mini {
401
- background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line);
402
- color: var(--text); border-radius: 10px; padding: 9px 12px;
403
- font-size: 0.82rem; outline: none;
404
- }
405
- .select-mini:focus { border-color: var(--accent); }
406
-
407
- .movie-grid {
408
- display: grid; gap: 16px;
409
- grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
410
- }
411
- .movie-card {
412
- position: relative; border-radius: var(--radius); overflow: hidden;
413
- background: var(--panel-2); border: 1px solid var(--line);
414
- transition: 0.3s var(--ease); cursor: pointer;
415
- }
416
- .movie-card:hover {
417
- transform: translateY(-5px); border-color: var(--accent);
418
- box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 26px color-mix(in srgb, var(--accent) 15%, transparent);
419
- }
420
- .movie-poster {
421
- position: relative; aspect-ratio: 2 / 3; overflow: hidden;
422
- background:
423
- radial-gradient(100% 120% at 50% 0%, color-mix(in srgb, var(--mcolor) 38%, transparent), transparent 60%),
424
- linear-gradient(160deg, #241a12, #100a07);
425
- display: grid; place-items: center;
426
- }
427
- .movie-poster img {
428
- position: absolute; inset: 0; width: 100%; height: 100%;
429
- object-fit: cover; transition: 0.5s var(--ease);
430
- z-index: 1;
431
- }
432
- .movie-card:hover .movie-poster img { transform: scale(1.06); }
433
- .movie-fallback {
434
- font-size: 2.6rem; font-weight: 900;
435
- color: color-mix(in srgb, var(--mcolor) 75%, #fff);
436
- text-shadow: 0 0 28px color-mix(in srgb, var(--mcolor) 55%, transparent);
437
- }
438
- .movie-play {
439
- position: absolute; inset: 0; display: grid; place-items: center;
440
- background: rgba(0, 0, 0, 0.25); opacity: 0; transition: 0.25s var(--ease);
441
- }
442
- .movie-play i {
443
- width: 52px; height: 52px; border-radius: 50%;
444
- background: linear-gradient(135deg, var(--accent), var(--accent2));
445
- color: var(--on-accent); display: grid; place-items: center;
446
- font-style: normal; font-size: 1.1rem;
447
- box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent);
448
- transform: scale(0.7); transition: 0.25s var(--ease);
449
- }
450
- .movie-card:hover .movie-play { opacity: 1; }
451
- .movie-card:hover .movie-play i { transform: scale(1); }
452
- .movie-info { padding: 12px 13px 14px; }
453
- .movie-title { font-weight: 800; font-size: 0.92rem; line-height: 1.25; }
454
- .movie-genre { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.6px; margin-top: 3px; text-transform: uppercase; }
455
- .movie-status { position: absolute; top: 9px; left: 9px; display: flex; gap: 5px; z-index: 2; }
456
- .movie-status span {
457
- background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.12);
458
- color: #fff; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.8px;
459
- padding: 3px 8px; border-radius: 99px; backdrop-filter: blur(6px);
460
- }
461
- .movie-status .fav {
462
- background: color-mix(in srgb, var(--accent) 75%, #000); border-color: transparent;
463
- }
464
- .movie-tools {
465
- position: absolute; top: 9px; right: 9px; display: flex; gap: 5px;
466
- opacity: 0; transition: 0.2s var(--ease); z-index: 3;
467
- }
468
- .movie-card:hover .movie-tools { opacity: 1; }
469
- .movie-tools .icon-btn { width: 28px; height: 28px; font-size: 0.68rem; background: rgba(0, 0, 0, 0.55); }
470
- .movie-cont-pct {
471
- display: inline-block; margin-top: 6px; padding: 2px 7px;
472
- font-size: 0.66rem; font-weight: 800; color: var(--accent2);
473
- background: color-mix(in srgb, var(--accent) 14%, transparent);
474
- border-radius: 99px;
475
- }
476
-
477
- .empty-state {
478
- text-align: center; padding: 46px 20px;
479
- background: rgba(255, 255, 255, 0.02); border: 1px dashed var(--line-2);
480
- border-radius: var(--radius); margin-top: 8px;
481
- }
482
- .empty-art { font-size: 3rem; margin-bottom: 10px; }
483
- .empty-state h4 { font-size: 1.15rem; margin-bottom: 8px; }
484
- .empty-state p { color: var(--muted); max-width: 44ch; margin: 0 auto 18px; font-size: 0.92rem; }
485
- /* ─────────── boot splash ─────────── */
486
-
487
- .boot {
488
- position: fixed; inset: 0; z-index: 200;
489
- background: radial-gradient(90% 90% at 50% 40%, #14100b, #070503 80%);
490
- display: grid; place-items: center; transition: opacity 0.55s var(--ease);
491
- }
492
- .boot.done { opacity: 0; pointer-events: none; }
493
- .boot-inner { text-align: center; padding: 20px; }
494
- .boot-logo {
495
- width: 84px; height: 84px; margin: 0 auto 22px;
496
- border-radius: 22px; display: grid; place-items: center; font-size: 38px;
497
- background: linear-gradient(135deg, var(--accent), var(--accent2));
498
- color: var(--on-accent);
499
- box-shadow: 0 0 60px color-mix(in srgb, var(--accent) 55%, transparent);
500
- animation: bootPulse 1.6s ease-in-out infinite;
501
- }
502
- @keyframes bootPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
503
- .boot-title { font-size: 2rem; letter-spacing: 8px; margin-bottom: 16px; }
504
- .boot-type {
505
- font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
506
- color: var(--accent2); min-height: 1.3em; margin-bottom: 22px;
507
- }
508
- .boot-bar {
509
- width: 260px; height: 5px; border-radius: 99px; margin: 0 auto;
510
- background: rgba(255, 255, 255, 0.08); overflow: hidden;
511
- }
512
- .boot-bar i {
513
- display: block; height: 100%; width: 0%;
514
- background: linear-gradient(90deg, var(--accent), var(--accent2));
515
- border-radius: 99px; transition: width 0.25s ease;
516
- box-shadow: 0 0 14px var(--accent);
517
- }
518
- #boot-skip { margin-top: 26px; }
519
-
520
- /* ─────────── footer ─────────── */
521
-
522
- .foot {
523
- max-width: 1220px; margin: 0 auto; padding: 26px 22px 46px;
524
- display: flex; justify-content: space-between; align-items: center; gap: 14px;
525
- flex-wrap: wrap; color: var(--dim); font-size: 0.78rem;
526
- border-top: 1px solid var(--line); letter-spacing: 0.6px;
527
- }
528
- .foot-hint kbd {
529
- color: var(--accent2); border-color: var(--line-2); font-size: 0.72rem;
530
- }
531
-
532
- /* ─────────── customizer ─────────── */
533
-
534
- .customizer {
535
- position: fixed; top: 0; right: 0; bottom: 0; z-index: 120;
536
- width: min(340px, 92vw);
537
- background: rgba(16, 11, 8, 0.9);
538
- backdrop-filter: blur(22px) saturate(1.4);
539
- border-left: 1px solid var(--line);
540
- transform: translateX(105%);
541
- transition: transform 0.4s var(--ease);
542
- display: flex; flex-direction: column;
543
- box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
544
- }
545
- .customizer.open { transform: translateX(0); }
546
- .customizer-head {
547
- display: flex; justify-content: space-between; align-items: center;
548
- padding: 18px 20px; border-bottom: 1px solid var(--line);
549
- }
550
- .customizer-head h4 { font-size: 1.05rem; letter-spacing: 0.4px; }
551
- .cz-scroll { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
552
- .cz-label {
553
- font-size: 0.66rem; letter-spacing: 2px; text-transform: uppercase;
554
- color: var(--muted); font-weight: 700;
555
- }
556
- .swatches { display: flex; gap: 10px; flex-wrap: wrap; }
557
- .swatch {
558
- width: 38px; height: 38px; border-radius: 12px; border: 2px solid transparent;
559
- background: var(--sw); box-shadow: 0 0 18px color-mix(in srgb, var(--sw) 45%, transparent);
560
- transition: 0.2s var(--ease);
561
- }
562
- .swatch:hover { transform: scale(1.12); }
563
- .swatch.active { border-color: #fff; transform: scale(1.12); }
564
- .cz-row { display: flex; align-items: center; gap: 12px; }
565
- input[type='color'] {
566
- width: 46px; height: 34px; border: 1px solid var(--line); border-radius: 9px;
567
- background: transparent; padding: 2px; cursor: pointer;
568
- }
569
- .cz-hex {
570
- font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--accent2);
571
- }
572
- input[type='range'] {
573
- width: 100%; accent-color: var(--accent); cursor: pointer;
574
- }
575
- .cz-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
576
- .cz-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); }
577
- .cz-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
578
- .cz-note { font-size: 0.72rem; color: var(--dim); text-align: center; }
579
- /* ─────────── modals ─────────── */
580
-
581
- .modal {
582
- position: fixed; inset: 0; z-index: 150;
583
- background: rgba(5, 3, 2, 0.82);
584
- backdrop-filter: blur(14px);
585
- display: grid; place-items: center;
586
- animation: fadeIn 0.25s var(--ease);
587
- }
588
- @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
589
-
590
- .launcher-frame-wrap, .player-stage {
591
- width: 100%; height: 100vh; overflow: hidden;
592
- }
593
- .launcher-bar, .player-bar {
594
- position: absolute; top: 0; left: 0; right: 0; z-index: 5;
595
- display: flex; align-items: center; gap: 10px;
596
- padding: 10px 16px;
597
- background: rgba(10, 7, 5, 0.75);
598
- backdrop-filter: blur(14px);
599
- border-bottom: 1px solid var(--line);
600
- }
601
- .launcher-title, .player-title {
602
- font-weight: 700; font-size: 0.88rem; white-space: nowrap;
603
- overflow: hidden; text-overflow: ellipsis; max-width: 40vw;
604
- color: var(--accent2);
605
- }
606
- .launcher-actions { margin-left: auto; display: flex; gap: 7px; align-items: center; }
607
- .launcher-actions .launcher-title { max-width: 30vw; }
608
- #launcher-modal .modal-inner { width: 100%; }
609
- #launcher-modal { display: flex; }
610
- #launcher-modal .launcher-frame-wrap {
611
- margin-top: 0; height: calc(100vh);
612
- display: flex;
613
- }
614
- #launcher-frame {
615
- flex: 1; border: none; height: 100%; width: 100%;
616
- background: #000;
617
- }
618
-
619
- #player-modal { display: flex; }
620
- .player-bar { position: absolute; }
621
- .player-stage {
622
- width: 100%; display: grid; place-items: center;
623
- padding-top: 58px;
624
- }
625
- .player-stage video {
626
- max-width: 84vw; max-height: calc(100vh - 80px); border-radius: var(--radius);
627
- box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); outline: none;
628
- }
629
- .player-stage iframe {
630
- width: 84vw; height: calc(84vw * 0.5625);
631
- max-height: calc(100vh - 90px); border: none; border-radius: var(--radius);
632
- background: #000;
633
- }
634
- @media (max-height: 720px) {
635
- .player-stage iframe { height: calc(100vh - 90px); }
636
- }
637
- .player-error {
638
- max-width: 46ch; text-align: center; color: var(--muted);
639
- padding: 30px; border-radius: var(--radius);
640
- background: var(--panel-2); border: 1px dashed var(--line-2);
641
- }
642
- .player-error a { color: var(--accent2); text-decoration: underline; }
643
-
644
- .form-card {
645
- width: min(440px, 92vw); background: var(--panel-solid);
646
- border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
647
- padding: 26px; display: grid; gap: 15px;
648
- max-height: 90vh; overflow-y: auto;
649
- }
650
- .form-card h4 { font-size: 1.2rem; }
651
- .form-field { display: grid; gap: 6px; }
652
- .form-field label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
653
- .form-field input {
654
- background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line);
655
- border-radius: 10px; padding: 11px 14px; font-size: 0.92rem; outline: none;
656
- transition: 0.22s var(--ease);
657
- }
658
- .form-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
659
- .form-row { display: flex; justify-content: flex-end; gap: 10px; }
660
-
661
- /* ─────────── toasts ─────────── */
662
-
663
- #toast-zone {
664
- position: fixed; right: 18px; bottom: 18px; z-index: 300;
665
- display: flex; flex-direction: column; gap: 10px; pointer-events: none;
666
- }
667
- .toast {
668
- background: rgba(18, 12, 8, 0.92);
669
- border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
670
- border-left: 3px solid var(--accent);
671
- color: var(--text); padding: 12px 18px; border-radius: 12px;
672
- font-size: 0.85rem; max-width: 340px;
673
- box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px color-mix(in srgb, var(--accent) 15%, transparent);
674
- backdrop-filter: blur(12px);
675
- animation: toastIn 0.35s var(--ease);
676
- }
677
- .toast.out { animation: toastOut 0.35s var(--ease) forwards; }
678
- @keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
679
- @keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }
680
-
681
- /* ─────────── turbo / confetti ─────────── */
682
-
683
- .turbo { animation: turboBg 0.5s ease infinite alternate; }
684
- @keyframes turboBg {
685
- to { filter: hue-rotate(32deg) saturate(1.6); }
686
- }
687
- .confetti-piece {
688
- position: fixed; width: 9px; height: 14px; z-index: 400;
689
- border-radius: 2px; pointer-events: none;
690
- animation: confettiFall linear forwards;
691
- }
692
- @keyframes confettiFall {
693
- 0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
694
- 100% { transform: translateY(110vh) rotate(720deg); opacity: 0.4; }
695
- }
696
-
697
- /* ─────────── work mode ─────────── */
698
-
699
- body[data-work='on'] .hero,
700
- body[data-work='on'] #tunnel,
701
- body[data-work='on'] #games,
702
- body[data-work='on'] #movies,
703
- body[data-work='on'] #continue-panel,
704
- body[data-work='on'] .foot-hint,
705
- body[data-work='on'] a[href='#tunnel'],
706
- body[data-work='on'] a[href='#games'],
707
- body[data-work='on'] a[href='#movies'] { display: none; }
708
- body[data-work='on'] #work-view { display: block; }
709
-
710
- #work-view { scroll-margin-top: 90px; }
711
- .work-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
712
- .work-card {
713
- background: var(--panel-2); border: 1px solid var(--line);
714
- border-radius: var(--radius); padding: 18px;
715
- }
716
- .work-card h4 { font-size: 0.95rem; margin: 0 0 12px; color: var(--muted); }
717
- .focus-timer {
718
- font-family: 'JetBrains Mono', monospace; font-size: 1.9rem; font-weight: 700;
719
- color: var(--accent2); letter-spacing: 1px;
720
- }
721
- .timer-controls { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
722
- .todo-list { list-style: none; padding: 0; margin-top: 14px; max-height: 220px; overflow-y: auto; }
723
- .todo-list li {
724
- display: flex; align-items: center; gap: 10px; padding: 8px 12px;
725
- border-radius: 10px; background: rgba(255, 255, 255, 0.045); margin-bottom: 6px;
726
- }
727
- .todo-list li.done span { text-decoration: line-through; opacity: 0.55; }
728
- .todo-list input[type='checkbox'] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
729
- .todo-list .icon-btn { width: 26px; height: 26px; font-size: 0.66rem; }
730
-
731
- /* ─────────── responsive ─────────── */
732
-
733
- @media (max-width: 720px) {
734
- .nav-links { display: none; }
735
- .hero { padding-top: 46px; }
736
- .game-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
737
- .movie-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
738
- .panel { padding: 18px; }
739
- .player-stage video { max-width: 96vw; }
740
- .player-stage iframe { width: 96vw; }
741
- }
742
-
743
- @media (prefers-reduced-motion: reduce) {
744
- *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
745
- }
746
- body[data-anim='off'] *, body[data-anim='off'] *::before, body[data-anim='off'] *::after {
747
- animation: none !important;
748
- scroll-behavior: auto;
749
- }
750
- </style>
12
+ <link rel="stylesheet" href="style.css">
751
13
 
14
+ <base target="_blank">
752
15
  <base target="_blank">
753
16
  <base target="_blank">
754
17
  </head>
@@ -1023,995 +286,7 @@ body[data-anim='off'] *, body[data-anim='off'] *::before, body[data-anim='off']
1023
286
 
1024
287
  <div id="toast-zone"></div>
1025
288
 
1026
- <script>
1027
- (function () {
1028
-
1029
- </script>
1030
- <script>
1031
- /* IGNITE OS data — embedded */
1032
- /* ═══════════════════════════════════════════════════════════════════
1033
- IGNITE OS — data layer
1034
- Games, theme presets and demo movies. The default games all play
1035
- through the IGNITE OS proxy (/go/ form) or straight from /lg/ (local).
1036
- Want more games? Just append entries here.
1037
- ═══════════════════════════════════════════════════════════════════ */
1038
-
1039
- const THEME_PRESETS = {
1040
- ember: { accent: '#ff6b1a', accent2: '#ffb26b', bgHue: 28, bgType: 'aurora' },
1041
- cobalt: { accent: '#3b82f6', accent2: '#93c5fd', bgHue: 205, bgType: 'aurora' },
1042
- violet: { accent: '#a855f7', accent2: '#d8b4fe', bgHue: 268, bgType: 'aurora' },
1043
- inferno: { accent: '#ff3d3d', accent2: '#ffb347', bgHue: 4, bgType: 'grid' },
1044
- ocean: { accent: '#22d3ee', accent2: '#a5f3fc', bgHue: 188, bgType: 'aurora' },
1045
- mint: { accent: '#34d399', accent2: '#a7f3d0', bgHue: 150, bgType: 'aurora' },
1046
- };
1047
-
1048
- const DEFAULT_GAMES = [
1049
- {
1050
- id: 'Boxing random', name: 'boxing random',
1051
- url: 'https://generic-alpaca-325321.framer.app/page-2',
1052
- cover: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSMsmmvT25AoltrbJwr-55zPuJi28fsP49pf2zgVIdNrQ&s=10', // ← optional image URL — letters disappear when set
1053
- desc: 'soccer',
1054
- tags: ['sports', '3D', 'soccer'], color: '#22d3ee',
1055
- },
1056
- {
1057
- id: 'recoil', name: 'Recoil',
1058
- url: 'https://generic-alpaca-325321.framer.app/',
1059
- cover: 'https://fancade.com/images/5E9F40DA7F9C9FA8.jpg', // ← optional image URL — letters disappear when set
1060
- desc: 'recoil like drivve mad',
1061
- tags: ['closed-world', 'action', '2D'], color: '#ff6b1a',
1062
- },
1063
- {
1064
- id: 'retro ball', name: 'Retro Ball',
1065
- url: 'https://objectstorage.us-ashburn-1.oraclecloud.com/n/idzgyfi7awwr/b/bucket-20231001-1518-rb1.0/o/index.html',
1066
- cover: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTfQEUbXopS95V30bru2UdgdystMD8ElzCDFzH6k6_pUQ&s', // ← optional image URL — letters disappear when set
1067
- desc: 'touchdown',
1068
- tags: ['sports', 'action'], color: '#a855f7',
1069
- },
1070
- {
1071
- id: 'drift boss', name: 'Drift Boss',
1072
- url: 'https://www.mathplayground.com/drift-boss-v3/index.html',
1073
- cover: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTMW_L-ZhbnvWj1lwNrWeAGDaK0rG0lCw52zSIsTfTmWNZ9oOVhXvQ_oJRA&s=10', // ← optional image URL — letters disappear when set
1074
- desc: 'drive',
1075
- tags: ['car', 'arcade', '2D'], color: '#3b82f6',
1076
- },
1077
- {
1078
- id: 'tiny fishing', name: 'Tiny fishing',
1079
- url: 'https://generic-alpaca-325321.framer.app/page-3',
1080
- cover: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR-I2lTQx2HkSPrPeyCNmAnGGd_c29Um34tPc8TpiyJjg&s=10', // ← optional image URL — letters disappear when set
1081
- desc: 'works trust',
1082
- tags: ['slow but works', '3D'], color: '#facc15',
1083
- },
1084
- {
1085
- id: 'A Small world Cup', name: 'A Small World Cup',
1086
- url: 'https://script.google.com/a/macros/mcpsmd.net/s/AKfycbwSK5IqLXbZppMz9znIJVycB4BZCHodE3uSgUF4C1fReEqmMSDYua81Ew7Rp-Cn85gojg/exec',
1087
- cover: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTY4AGQkfiAEPBItQdxMlfKm0Wz7eUOzt-SsZUGejt7cA&s=10', // ← optional image URL — letters disappear when set
1088
- desc: 'Soccer Skills — Euro 2021 edition. Curl it into the top corner.',
1089
- tags: ['soccer', 'sports'], color: '#34d399',
1090
- },
1091
- {
1092
- id: 'Air Hockey CUP', name: 'Air Hockey CUP',
1093
- url: 'https://script.google.com/macros/s/AKfycbw7VnhYKWITlJo9p8qyT8ExOfvnjvizq57_jj7MzDnyJWTuHtNbee3NHoEoRhuS6eqo/exec',
1094
- cover: 'https://play-lh.googleusercontent.com/EFevQ0zkoUL5FEPIsI8-yFKoK6QCyu3TSZRXEJiLkRaWrCidW3b6ZKNiNzuvfeaLKW9FyHeY3WYh4RR839Qanck', // ← optional image URL — letters disappear when set
1095
- desc: 'basic hockey',
1096
- tags: ['hockey', 'sports'], color: '#f43f5e',
1097
- },
1098
- {
1099
- id: 'Slope REMAKE', name: 'Slope REMAKE',
1100
- url: 'https://script.google.com/a/macros/mcpsmd.net/s/AKfycbyendSzfWzjivGUAoNgH5QDpJIxJDyJvSYwXWxcV_8gl9xkdTMV2BvDpjiWNw5pGaVT/exec',
1101
- cover: 'https://play-lh.googleusercontent.com/Ev5gkPTONr-1k1r7erT0iiW-pUZoGUH_6FVQdD91e9ghSAqZRMTaFVGQW5Z6PLOfFgxZnJhdEBE2z-TgfZ1bsg', // ← optional image URL — letters disappear when set
1102
- desc: 'a rolling ball ',
1103
- tags: ['slope','3D'], color: '#fb7185',
1104
- },
1105
- ];
1106
-
1107
- const DEMO_MOVIES = [
1108
- { title: 'Spiderman: Far from home ', genre: 'Spiderman · Open Movie', desc: 'spiderman goes in new york idk',
1109
- source: 'url', videoUrl: 'https://drive.google.com/file/d/1t62YY5V2WFqPA801cDECww1EQYk4fMnk/preview?t=11.299',
1110
- poster: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg' },
1111
- { title: 'Sintel', genre: 'Fantasy · Open Movie', desc: 'A lone warrior’s journey across a frozen land — Blender open film #3.',
1112
- source: 'url', videoUrl: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/Sintel.mp4',
1113
- poster: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/Sintel.jpg' },
1114
- { title: 'Tears of Steel', genre: 'Sci-Fi · Open Movie', desc: 'Robots, lasers and a mission to save the world — Blender open film #4.',
1115
- source: 'url', videoUrl: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4',
1116
- poster: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/TearsOfSteel.jpg' },
1117
- { title: 'Elephants Dream', genre: 'Surreal · Open Movie', desc: 'The strangest dream you’ve never had — the very first open movie.',
1118
- source: 'url', videoUrl: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4',
1119
- poster: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ElephantsDream.jpg' },
1120
- ];
1121
-
1122
- /* IGNITE OS app — embedded */
1123
- /* ═══════════════════════════════════════════════════════════════
1124
- IGNITE OS — dashboard engine (zero deps)
1125
- ═══════════════════════════════════════════════════════════════ */
1126
- (function () {
1127
- 'use strict';
1128
-
1129
- const $ = (id) => document.getElementById(id);
1130
-
1131
- // ── persistence ──
1132
- const K = {
1133
- games: 'emby.games.v1', movies: 'emby.movies.v1',
1134
- prefs: 'emby.prefs.v1', profile: 'emby.profile.v1',
1135
- last: 'emby.last.v1', overrides: 'emby.overrides.v1',
1136
- };
1137
- const store = {
1138
- get(key, fallback) {
1139
- try { const v = JSON.parse(localStorage.getItem(key)); return v === null || v === undefined ? fallback : v; }
1140
- catch { return fallback; }
1141
- },
1142
- set(key, val) {
1143
- try { localStorage.setItem(key, JSON.stringify(val)); } catch { /* ignore */ }
1144
- },
1145
- };
1146
-
1147
- // ── state ──
1148
- const state = {
1149
- games: [],
1150
- localGames: [],
1151
- movies: store.get(K.movies, []),
1152
- overrides: store.get(K.overrides, {}),
1153
- prefs: Object.assign({
1154
- preset: 'ember', accent: '#ff6b1a', accent2: '#ffb26b',
1155
- bgType: 'aurora', bgHue: 28, bgUrl: '', glow: 70, blur: 14,
1156
- radius: 18, font: 'outfit', particles: true, grid: true,
1157
- noise: true, anim: true, sound: false, work: false,
1158
- }, store.get(K.prefs, {})),
1159
- profile: Object.assign({ name: 'DRIVER' }, store.get(K.profile, {})),
1160
- movieFilter: '', movieGenre: '', movieSort: 'added',
1161
- playerMovie: null, playerEngine: 'video',
1162
- launcherUrl: '', formEditId: null, formMode: 'movie',
1163
- keys: [], turbo: false,
1164
- };
1165
-
1166
- // ── proxy url helpers ──
1167
- const serverBase = () => {
1168
- try { return String(localStorage.getItem('emby.server') || '').replace(/\/+$/, ''); }
1169
- catch { return ''; }
1170
- };
1171
- const proxify = (raw) => {
1172
- let u = (raw || '').trim();
1173
- if (!u) return '';
1174
- if (!/^[a-z][a-z0-9+.-]*:/i.test(u)) u = 'https://' + u;
1175
- return u;
1176
- };
1177
- const tunnel = (raw) => proxify(raw, '/go/');
1178
-
1179
- // ── google drive parser ──
1180
- const DRIVE_ID = /[A-Za-z0-9_-]{28,}/;
1181
- function parseDrive(input) {
1182
- const s = (input || '').trim();
1183
- if (!s) return { kind: 'none' };
1184
- if (/^[A-Za-z0-9_-]{28,}$/.test(s)) return { kind: 'file', id: s };
1185
- let u;
1186
- try { u = new URL(s); } catch { return { kind: 'url', url: s }; }
1187
- const host = u.hostname.toLowerCase();
1188
- if (host === 'drive.google.com' || host === 'drive.usercontent.google.com' || host === 'docs.google.com') {
1189
- const path = u.pathname;
1190
- const mFile = path.match(/\/file\/d\/([^/]+)/);
1191
- const mFolder = path.match(/\/drive\/folders\/([^/]+)/);
1192
- const idQ = u.searchParams.get('id');
1193
- const folderQ = u.searchParams.get('folder');
1194
- if (mFolder || folderQ) return { kind: 'folder', id: (mFolder ? mFolder[1] : folderQ) };
1195
- if (mFile) return { kind: 'file', id: mFile[1] };
1196
- if (idQ) return { kind: 'file', id: idQ };
1197
- if (DRIVE_ID.test(path)) return { kind: 'file', id: path.match(DRIVE_ID)[0] };
1198
- }
1199
- return { kind: 'url', url: s };
1200
- }
1201
- const drivePreview = (id) => 'https://drive.google.com/file/d/' + id + '/preview';
1202
- const driveRaw = (id) => 'https://drive.google.com/uc?export=download&id=' + id;
1203
- const driveFolder = (id) => 'https://drive.google.com/embeddedfolderview?id=' + id + '#list';
1204
- const driveThumb = (id) => 'https://lh3.googleusercontent.com/d/' + id + '=w600-h900';
1205
-
1206
- // ── toast ──
1207
- function toast(msg, ms) {
1208
- const zone = $('toast-zone');
1209
- const t = document.createElement('div');
1210
- t.className = 'toast'; t.textContent = msg;
1211
- zone.appendChild(t);
1212
- setTimeout(() => { t.classList.add('out'); setTimeout(() => t.remove(), 400); }, ms || 2600);
1213
- }
1214
-
1215
- // ── micro sound fx (WebAudio, optional) ──
1216
- let audioCtx = null;
1217
- function beep(freq, dur, type) {
1218
- if (!state.prefs.sound) return;
1219
- try {
1220
- audioCtx = audioCtx || new (window.AudioContext || window.webkitAudioContext)();
1221
- const o = audioCtx.createOscillator(), g = audioCtx.createGain();
1222
- o.type = type || 'sine'; o.frequency.value = freq;
1223
- g.gain.setValueAtTime(0.06, audioCtx.currentTime);
1224
- g.gain.exponentialRampToValueAtTime(0.0001, audioCtx.currentTime + (dur || 0.12));
1225
- o.connect(g); g.connect(audioCtx.destination);
1226
- o.start(); o.stop(audioCtx.currentTime + (dur || 0.12));
1227
- } catch { /* ignore */ }
1228
- }
1229
-
1230
- // ── confetti ──
1231
- function confetti(n) {
1232
- const colors = ['#ff6b1a', '#ffb26b', '#ffd54f', '#ff8a65', '#ffffff', '#ffab91'];
1233
- for (let i = 0; i < (n || 60); i++) {
1234
- const p = document.createElement('i');
1235
- p.className = 'confetti-piece';
1236
- p.style.left = Math.random() * 100 + 'vw';
1237
- p.style.background = colors[(Math.random() * colors.length) | 0];
1238
- p.style.animationDuration = (1.6 + Math.random() * 1.8) + 's';
1239
- p.style.animationDelay = (Math.random() * 0.35) + 's';
1240
- document.body.appendChild(p);
1241
- setTimeout(() => p.remove(), 4200);
1242
- }
1243
- }
1244
-
1245
- window.IGNITE = { tunnel, proxify };
1246
- // ═══════════ theme / prefs ═══════════
1247
-
1248
- const hexToRgb = (hex) => {
1249
- const h = hex.replace('#', '');
1250
- const n = parseInt(h.length === 3 ? h.split('').map((c) => c + c).join('') : h, 16);
1251
- return { r: (n >> 16) & 255, g: (n >> 8) & 255, b: n & 255 };
1252
- };
1253
-
1254
- function applyPrefs() {
1255
- const p = state.prefs;
1256
- const root = document.documentElement.style;
1257
- root.setProperty('--accent', p.accent);
1258
- root.setProperty('--accent2', p.accent2);
1259
- root.setProperty('--glow', Math.max(0.05, p.glow / 100));
1260
- root.setProperty('--blur', p.blur + 'px');
1261
- root.setProperty('--radius', p.radius + 'px');
1262
- root.setProperty('--bg-h', p.bgHue);
1263
- root.setProperty('--bg0', 'hsl(' + p.bgHue + ' 42% 3%)');
1264
- root.setProperty('--bg1', 'hsl(' + p.bgHue + ' 40% 7%)');
1265
- root.setProperty('--bg2', 'hsl(' + p.bgHue + ' 38% 11%)');
1266
-
1267
- const body = document.body;
1268
- body.dataset.bg = p.bgType;
1269
- body.dataset.font = p.font;
1270
- body.dataset.anim = p.anim ? 'on' : 'off';
1271
- body.dataset.work = p.work ? 'on' : 'off';
1272
- if (p.bgType === 'custom' && p.bgUrl) {
1273
- body.style.setProperty('--bgimg', 'url("' + p.bgUrl.replace(/"/g, '%22') + '")');
1274
- } else {
1275
- body.style.removeProperty('--bgimg');
1276
- }
1277
- document.querySelector('.bg-grid').style.display = p.grid ? '' : 'none';
1278
- document.querySelector('.bg-noise').style.display = p.noise ? '' : 'none';
1279
-
1280
- // sync customizer UI
1281
- $('cz-accent').value = p.accent;
1282
- $('cz-accent-hex').textContent = p.accent;
1283
- $('cz-accent2').value = p.accent2;
1284
- $('cz-accent2-hex').textContent = p.accent2;
1285
- $('cz-bgtype').value = p.bgType;
1286
- $('cz-bgurl').value = p.bgUrl;
1287
- $('cz-bg-hue').value = p.bgHue;
1288
- $('cz-glow').value = p.glow;
1289
- $('cz-blur').value = p.blur;
1290
- $('cz-radius').value = p.radius;
1291
- $('cz-font').value = p.font;
1292
- $('cz-particles').checked = p.particles;
1293
- $('cz-grid').checked = p.grid;
1294
- $('cz-noise').checked = p.noise;
1295
- $('cz-anim').checked = p.anim;
1296
- $('cz-sound').checked = p.sound;
1297
- $('cz-work').checked = !!p.work;
1298
- document.title = p.work ? 'Homework Hub' : 'IGNITE OS — the unblocked dashboard';
1299
- const bnameTag = document.querySelector('.brand-name');
1300
- if (bnameTag) bnameTag.innerHTML = p.work
1301
- ? 'Homework<span class="accent-text">Hub</span>'
1302
- : 'Ignite<span class="accent-text">OS</span>';
1303
- $('cz-bgurl-row').classList.toggle('hidden', p.bgType !== 'custom');
1304
- document.querySelectorAll('#cz-swatches .swatch').forEach((sw) => {
1305
- sw.classList.toggle('active', sw.dataset.preset === p.preset);
1306
- });
1307
- store.set(K.prefs, p);
1308
- }
1309
-
1310
- function savePref(patch) {
1311
- Object.assign(state.prefs, patch);
1312
- applyPrefs();
1313
- store.set(K.prefs, state.prefs);
1314
- }
1315
-
1316
- function toggleCustomizer(open) {
1317
- $('customizer').classList.toggle('open', open);
1318
- if (open) { $('cz-name').value = state.profile.name; $('cz-name').focus(); }
1319
- beep(open ? 440 : 320, 0.07);
1320
- }
1321
-
1322
- function bindCustomizer() {
1323
- $('cz-swatches').addEventListener('click', (e) => {
1324
- const sw = e.target.closest('.swatch');
1325
- if (!sw) return;
1326
- const preset = THEME_PRESETS[sw.dataset.preset];
1327
- if (!preset) return;
1328
- Object.assign(state.prefs, preset, { preset: sw.dataset.preset });
1329
- applyPrefs(); store.set(K.prefs, state.prefs);
1330
- beep(620, 0.09);
1331
- toast('theme: ' + sw.dataset.preset, 1400);
1332
- });
1333
- $('cz-accent').addEventListener('input', (e) => savePref({ accent: e.target.value, preset: null }));
1334
- $('cz-accent2').addEventListener('input', (e) => savePref({ accent2: e.target.value, preset: null }));
1335
- $('cz-bgtype').addEventListener('change', (e) => savePref({ bgType: e.target.value, preset: null }));
1336
- $('cz-bgurl').addEventListener('change', (e) => savePref({ bgUrl: e.target.value.trim() }));
1337
- $('cz-bg-hue').addEventListener('input', (e) => savePref({ bgHue: Number(e.target.value) }));
1338
- $('cz-glow').addEventListener('input', (e) => savePref({ glow: Number(e.target.value) }));
1339
- $('cz-blur').addEventListener('input', (e) => savePref({ blur: Number(e.target.value) }));
1340
- $('cz-radius').addEventListener('input', (e) => savePref({ radius: Number(e.target.value) }));
1341
- $('cz-font').addEventListener('change', (e) => savePref({ font: e.target.value }));
1342
- $('cz-particles').addEventListener('change', (e) => savePref({ particles: e.target.checked }));
1343
- $('cz-grid').addEventListener('change', (e) => savePref({ grid: e.target.checked }));
1344
- $('cz-noise').addEventListener('change', (e) => savePref({ noise: e.target.checked }));
1345
- $('cz-anim').addEventListener('change', (e) => savePref({ anim: e.target.checked }));
1346
- $('cz-sound').addEventListener('change', (e) => savePref({ sound: e.target.checked }));
1347
- $('cz-work').addEventListener('change', (e) => setWorkMode(e.target.checked));
1348
- $('cz-name').addEventListener('change', (e) => {
1349
- state.profile.name = (e.target.value || 'DRIVER').toUpperCase().slice(0, 20);
1350
- store.set(K.profile, state.profile);
1351
- $('profile-pill').textContent = state.profile.name;
1352
- });
1353
- $('cz-reset').addEventListener('click', () => {
1354
- localStorage.removeItem(K.prefs);
1355
- localStorage.removeItem(K.profile);
1356
- location.reload();
1357
- });
1358
- $('nav-customize').addEventListener('click', () => toggleCustomizer(true));
1359
- $('cz-close').addEventListener('click', () => toggleCustomizer(false));
1360
- }
1361
- // ═══════════ background canvas ═══════════
1362
-
1363
- const canvas = $('bg-canvas');
1364
- const ctx = canvas.getContext('2d');
1365
- let motes = [], starMode = false;
1366
- function initMotes() {
1367
- starMode = state.prefs.bgType === 'stars';
1368
- const count = starMode ? 130 : Math.min(72, Math.floor(canvas.width / 22));
1369
- motes = Array.from({ length: count }, () => ({
1370
- x: Math.random() * canvas.width, y: Math.random() * canvas.height,
1371
- r: starMode ? (Math.random() * 1.4 + 0.4) : (Math.random() * 2 + 0.6),
1372
- vx: (Math.random() - 0.5) * (starMode ? 0.15 : 0.35),
1373
- vy: (Math.random() - 0.5) * (starMode ? 0.12 : 0.28),
1374
- tw: Math.random() * Math.PI * 2, tws: 0.01 + Math.random() * 0.03,
1375
- hue: Math.random() * 40 - 20,
1376
- }));
1377
- }
1378
- function drawMotes() {
1379
- if (!state.prefs.particles) { ctx.clearRect(0, 0, canvas.width, canvas.height); return; }
1380
- ctx.clearRect(0, 0, canvas.width, canvas.height);
1381
- const rgb = hexToRgb(state.prefs.accent);
1382
- for (const m of motes) {
1383
- m.x += m.vx; m.y += m.vy; m.tw += m.tws;
1384
- if (m.x < -8) m.x = canvas.width + 8; if (m.x > canvas.width + 8) m.x = -8;
1385
- if (m.y < -8) m.y = canvas.height + 8; if (m.y > canvas.height + 8) m.y = -8;
1386
- const alpha = starMode ? (0.3 + 0.7 * Math.abs(Math.sin(m.tw))) : (0.1 + 0.42 * Math.abs(Math.sin(m.tw)));
1387
- ctx.beginPath();
1388
- ctx.arc(m.x, m.y, m.r, 0, Math.PI * 2);
1389
- ctx.fillStyle = starMode
1390
- ? 'rgba(255,255,255,' + alpha + ')'
1391
- : 'hsla(' + (state.prefs.bgHue + m.hue) + ' 90% 65% / ' + alpha + ')';
1392
- ctx.fill();
1393
- }
1394
- }
1395
- function bgLoop() {
1396
- drawMotes();
1397
- requestAnimationFrame(bgLoop);
1398
- }
1399
- window.addEventListener('resize', () => {
1400
- canvas.width = window.innerWidth; canvas.height = window.innerHeight;
1401
- initMotes();
1402
- });
1403
- // ═══════════ game vault ═══════════
1404
-
1405
- const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) =>
1406
- ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
1407
-
1408
- function mergeGames() {
1409
- const base = DEFAULT_GAMES.map((g) => Object.assign({}, g, state.overrides[g.id] || {}));
1410
- const extra = Object.keys(state.overrides)
1411
- .filter((id) => !DEFAULT_GAMES.some((g) => g.id === id))
1412
- .map((id) => state.overrides[id])
1413
- .filter((g) => g && g.name && g.url);
1414
- return base.concat(extra);
1415
- }
1416
-
1417
- function renderGames() {
1418
- const games = mergeGames();
1419
- const local = state.localGames.map((name) => ({
1420
- id: 'local-' + name,
1421
- name: name.replace(/[_-]+/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase()),
1422
- url: serverBase() + '/lg/' + name + '/', local: true, desc: 'Runs 100% offline from IGNITE OS.',
1423
- tags: ['local'], color: '#ff9f6b',
1424
- }));
1425
- state.games = games.concat(local);
1426
- $('local-hint').classList.toggle('hidden', local.length > 0);
1427
- $('stat-games').textContent = games.length;
1428
- $('stat-local').textContent = local.length;
1429
- $('stat-movies').textContent = state.movies.length;
1430
- $('movies-empty').classList.toggle('hidden', state.movies.length > 0);
1431
-
1432
- const wrap = $('game-grid');
1433
- wrap.innerHTML = '';
1434
- state.games.forEach((g) => {
1435
- const card = document.createElement('div');
1436
- card.className = 'game-card';
1437
- card.style.setProperty('--gcolor', g.color || '#ff6b1a');
1438
- card.dataset.id = g.id;
1439
- const cover = g.cover ? '<img src="' + esc(g.cover) + '" alt="" loading="lazy" onerror="this.remove()">' : '';
1440
- const tools = g.local ? '' :
1441
- '<div class="game-tools">' +
1442
- '<button class="icon-btn" data-act="edit" title="edit">&#9998;</button>' +
1443
- '<button class="icon-btn" data-act="del" title="remove">&#10006;</button>' +
1444
- '</div>';
1445
- card.innerHTML =
1446
- '<div class="game-cover">' +
1447
- (g.cover ? '' : '<div class="cover-fallback">' + esc(g.name.slice(0, 2).toUpperCase()) + '</div>') + cover +
1448
- (g.local ? '<span class="local-dot">OFFLINE</span>' : '') + tools +
1449
- '<button class="game-play" data-act="play" title="play">&#9654;</button>' +
1450
- '</div>' +
1451
- '<div class="game-body">' +
1452
- '<div class="game-name">' + esc(g.name) + '</div>' +
1453
- '<div class="game-tags">' + (g.tags || []).map((t) => '<span class="game-tag">' + esc(t) + '</span>').join('') + '</div>' +
1454
- (g.desc ? '<div class="game-desc">' + esc(g.desc) + '</div>' : '') +
1455
- '</div>';
1456
- wrap.appendChild(card);
1457
- });
1458
- }
1459
-
1460
- // ── launcher modal ──
1461
- function openLauncher(title, src) {
1462
- $('launcher-title').textContent = title;
1463
- $('launcher-frame').src = src;
1464
- $('launcher-modal').classList.remove('hidden');
1465
- document.body.style.overflow = 'hidden';
1466
- beep(520, 0.08);
1467
- }
1468
- function closeLauncher() {
1469
- $('launcher-frame').src = 'about:blank';
1470
- $('launcher-modal').classList.add('hidden');
1471
- document.body.style.overflow = '';
1472
- }
1473
- function bindGames() {
1474
- $('game-grid').addEventListener('click', (e) => {
1475
- const card = e.target.closest('.game-card');
1476
- if (!card) return;
1477
- const g = state.games.find((x) => x.id === card.dataset.id);
1478
- if (!g) return;
1479
- const act = e.target.closest('[data-act]');
1480
- if (act && act.dataset.act === 'edit' && !g.local) { showGameForm(g); return; }
1481
- if (act && act.dataset.act === 'del' && !g.local) {
1482
- if (confirm('Remove "' + g.name + '" from your vault?')) {
1483
- delete state.overrides[g.id];
1484
- store.set(K.overrides, state.overrides);
1485
- renderGames(); toast('game removed');
1486
- }
1487
- return;
1488
- }
1489
- const url = g.local ? g.url : tunnel(g.url);
1490
- store.set(K.last, { name: g.name, ts: Date.now() });
1491
- $('stat-last').textContent = g.name.slice(0, 12);
1492
- openLauncher(g.name, url);
1493
- });
1494
- $('games-edit-badge').addEventListener('click', () => showGameForm(null));
1495
- $('launcher-close').addEventListener('click', closeLauncher);
1496
- $('launcher-back').addEventListener('click', () => { try { $('launcher-frame').contentWindow.history.back(); } catch (e) { /* ignore */ } });
1497
- $('launcher-refresh').addEventListener('click', () => { $('launcher-frame').src = $('launcher-frame').src; });
1498
- $('launcher-ext').addEventListener('click', () => { window.open($('launcher-frame').src, '_blank'); });
1499
- $('launcher-fs').addEventListener('click', () => {
1500
- const fr = $('launcher-frame');
1501
- if (fr.requestFullscreen) fr.requestFullscreen().catch(() => {});
1502
- });
1503
- $('launcher-modal').addEventListener('click', (e) => {
1504
- if (e.target === $('launcher-modal')) closeLauncher();
1505
- });
1506
- }
1507
-
1508
- // ── shared add/edit form (games + movies) ──
1509
- function showForm(mode, item) {
1510
- state.formMode = mode;
1511
- state.formEditId = item ? item.id : null;
1512
- $('form-title').textContent = (item ? 'Edit ' : ('Add ')) + (mode === 'game' ? 'game' : 'movie');
1513
- $('form-name').value = item ? item.name || item.title || '' : '';
1514
- $('form-desc').value = item ? item.desc || '' : '';
1515
- $('form-link').value = item ? (mode === 'game' ? item.url : (item.url || item.driveId || '')) : '';
1516
- $('form-genre').value = item ? (mode === 'game' ? (item.tags || []).join(', ') : (item.genre || '')) : '';
1517
- $('form-poster').value = item ? (item.cover || item.poster || '') : '';
1518
- $('form-name').placeholder = mode === 'game' ? 'game title' : 'movie title';
1519
- $('form-link').placeholder = mode === 'game'
1520
- ? 'https://somesite.com/game — proxied automatically'
1521
- : 'https://drive.google.com/file/d/…/view';
1522
- $('form-parse-hint').textContent = '';
1523
- $('form-modal').classList.remove('hidden');
1524
- setTimeout(() => $('form-name').focus(), 60);
1525
- }
1526
- function closeForm() {
1527
- $('form-modal').classList.add('hidden');
1528
- state.formEditId = null;
1529
- }
1530
- // ═══════════ form handlers ═══════════
1531
-
1532
- const uid = () => 'm' + Date.now().toString(36) + Math.random().toString(36).slice(2, 7);
1533
-
1534
- function bindForm() {
1535
- $('form-cancel').addEventListener('click', closeForm);
1536
- $('form-modal').addEventListener('click', (e) => { if (e.target === $('form-modal')) closeForm(); });
1537
- $('form-card').addEventListener('submit', (e) => {
1538
- e.preventDefault();
1539
- const mode = state.formMode;
1540
- const name = $('form-name').value.trim();
1541
- const desc = $('form-desc').value.trim();
1542
- const genre = $('form-genre').value.trim();
1543
- const poster = $('form-poster').value.trim();
1544
- const link = $('form-link').value.trim();
1545
- if (!name) { toast('give it a name'); return; }
1546
- if (mode === 'game') {
1547
- if (!link) { toast('paste a game URL — it plays through the tunnel'); return; }
1548
- const id = state.formEditId || uid().replace('m', 'g');
1549
- const old = state.overrides[id] || {};
1550
- state.overrides[id] = Object.assign({}, old, {
1551
- id, name, url: link, desc,
1552
- tags: genre ? genre.split(',').map((t) => t.trim()).filter(Boolean) : ['custom'],
1553
- cover: poster || undefined, color: old.color || pickColor(name),
1554
- });
1555
- store.set(K.overrides, state.overrides);
1556
- renderGames();
1557
- toast('game saved: ' + name); beep(660, 0.09);
1558
- } else {
1559
- if (!link) { toast('paste a Google Drive link or video URL'); return; }
1560
- const parsed = parseDrive(link);
1561
- const movie = {
1562
- id: state.formEditId || uid(),
1563
- title: name, desc, genre: genre || 'uncategorized',
1564
- poster: poster || (parsed.kind === 'file' ? driveThumb(parsed.id) : ''),
1565
- source: parsed.kind, driveId: parsed.id || undefined,
1566
- url: parsed.url || undefined,
1567
- fav: false, watched: false, progress: 0, added: Date.now(),
1568
- };
1569
- const idx = state.movies.findIndex((m) => m.id === movie.id);
1570
- if (idx > -1) Object.assign(state.movies[idx], movie); else state.movies.unshift(movie);
1571
- store.set(K.movies, state.movies);
1572
- renderMovies(); renderGames();
1573
- toast('movie added: ' + name); beep(660, 0.09);
1574
- }
1575
- closeForm();
1576
- });
1577
-
1578
- $('form-link').addEventListener('input', () => {
1579
- const p = parseDrive($('form-link').value);
1580
- const h = $('form-parse-hint');
1581
- if (p.kind === 'file') h.textContent = 'Drive file detected ✓ (id ' + p.id.slice(0, 6) + '…)';
1582
- else if (p.kind === 'folder') h.textContent = 'Drive folder detected ✓ — embeds the folder listing';
1583
- else if (p.kind === 'url') h.textContent = 'direct video URL — plays in the built-in player';
1584
- else h.textContent = 'paste a Google Drive share link or a direct video URL';
1585
- });
1586
- }
1587
-
1588
- const pickColor = (name) => {
1589
- const palette = ['#ff6b1a', '#3b82f6', '#a855f7', '#22d3ee', '#34d399', '#facc15', '#fb7185'];
1590
- let h = 0; for (let i = 0; i < name.length; i++) h = (h * 31 + name.charCodeAt(i)) | 0;
1591
- return palette[Math.abs(h) % palette.length];
1592
- };
1593
- // ═══════════ movie library ═══════════
1594
-
1595
- function renderMovies() {
1596
- const q = state.movieFilter.toLowerCase();
1597
- let list = state.movies.filter((m) =>
1598
- (!q || m.title.toLowerCase().includes(q)) &&
1599
- (!state.movieGenre || (m.genre || '').toLowerCase().includes(state.movieGenre.toLowerCase())));
1600
- if (state.movieSort === 'title') list = list.slice().sort((a, b) => a.title.localeCompare(b.title));
1601
- else if (state.movieSort === 'watched') list = list.slice().sort((a, b) => Number(a.watched) - Number(b.watched));
1602
- else list = list.slice().sort((a, b) => (b.added || 0) - (a.added || 0));
1603
-
1604
- const genres = ['all'];
1605
- state.movies.forEach((m) => { const g = (m.genre || '').trim(); if (g && !genres.includes(g)) genres.push(g); });
1606
- $('genre-chips').innerHTML = genres.map((g) =>
1607
- '<button class="genre-chip' + ((g === state.movieGenre) || (g === 'all' && !state.movieGenre) ? ' active' : '') +
1608
- '" data-g="' + esc(g) + '">' + esc(g) + '</button>').join('');
1609
-
1610
- const wrap = $('movie-grid');
1611
- wrap.innerHTML = '';
1612
- list.forEach((m) => wrap.appendChild(movieCard(m)));
1613
- $('movies-empty').classList.toggle('hidden', state.movies.length > 0);
1614
-
1615
- const cont = state.movies.filter((m) => m.progress > 7 && m.progress < 95 && !m.watched);
1616
- $('continue-panel').classList.toggle('hidden', cont.length === 0);
1617
- if (cont.length) {
1618
- const cw = $('continue-grid');
1619
- cw.innerHTML = '';
1620
- cont.forEach((m) => {
1621
- const c = movieCard(m);
1622
- const pct = document.createElement('span');
1623
- pct.className = 'movie-cont-pct';
1624
- pct.textContent = Math.round(m.progress) + '%';
1625
- c.querySelector('.movie-info').appendChild(pct);
1626
- cw.appendChild(c);
1627
- });
1628
- }
1629
- }
1630
-
1631
- function movieCard(m) {
1632
- const card = document.createElement('div');
1633
- card.className = 'movie-card';
1634
- card.dataset.id = m.id;
1635
- card.style.setProperty('--mcolor', m.color || '#ff6b1a');
1636
- const poster = m.poster ? '<img src="' + esc(m.poster) + '" alt="" loading="lazy" onerror="this.remove()">' : '';
1637
- const st = [];
1638
- if (m.fav) st.push('<span class="fav">&#9733;</span>');
1639
- if (m.watched) st.push('<span>&#10003;</span>');
1640
- else if (m.progress > 7) st.push('<span>' + Math.round(m.progress) + '%</span>');
1641
- card.innerHTML =
1642
- '<div class="movie-poster">' +
1643
- (m.poster ? '' : '<div class="movie-fallback">' + esc((m.title || '?').slice(0, 2).toUpperCase()) + '</div>') + poster +
1644
- '<div class="movie-play"><i>&#9654;</i></div>' +
1645
- '<div class="movie-status">' + st.join('') + '</div>' +
1646
- '<div class="movie-tools">' +
1647
- '<button class="icon-btn" data-act="fav" title="favorite">&#9733;</button>' +
1648
- '<button class="icon-btn" data-act="watched" title="watched">&#10003;</button>' +
1649
- '<button class="icon-btn" data-act="edit" title="edit">&#9998;</button>' +
1650
- '<button class="icon-btn" data-act="del" title="remove">&#10006;</button>' +
1651
- '</div>' +
1652
- '</div>' +
1653
- '<div class="movie-info">' +
1654
- '<div class="movie-title">' + esc(m.title) + '</div>' +
1655
- '<div class="movie-genre">' + esc(m.genre || '') + '</div>' +
1656
- '</div>';
1657
- return card;
1658
- }
1659
- // ═══════════ movie player ═══════════
1660
-
1661
- const defaultEngine = (m) => (m.source === 'url' ? 'video' : 'preview');
1662
-
1663
- function openPlayer(movie) {
1664
- state.playerMovie = movie;
1665
- state.playerEngine = defaultEngine(movie);
1666
- $('player-title').textContent = movie.title;
1667
- $('player-toggle').classList.toggle('hidden', movie.source !== 'file');
1668
- $('player-modal').classList.remove('hidden');
1669
- document.body.style.overflow = 'hidden';
1670
- renderPlayerStage();
1671
- beep(440, 0.08);
1672
- }
1673
- function closePlayer() {
1674
- $('player-stage').innerHTML = '';
1675
- state.playerMovie = null;
1676
- $('player-modal').classList.add('hidden');
1677
- document.body.style.overflow = '';
1678
- }
1679
-
1680
- function renderPlayerStage() {
1681
- const m = state.playerMovie;
1682
- const stage = $('player-stage');
1683
- stage.innerHTML = '';
1684
- if (!m) return;
1685
-
1686
- if (m.source === 'folder') {
1687
- stage.innerHTML = '<iframe src="' + driveFolder(m.driveId) +
1688
- '" allow="autoplay; fullscreen" allowfullscreen></iframe>';
1689
- return;
1690
- }
1691
- if (state.playerEngine === 'video' && (m.driveId || m.url)) {
1692
- const v = document.createElement('video');
1693
- v.controls = true; v.autoplay = true; v.playsInline = true;
1694
- if (m.poster) v.poster = m.poster;
1695
- v.src = m.driveId ? driveRaw(m.driveId) : m.url;
1696
- if (m.progress > 7 && m.progress < 95 && m.driveId) {
1697
- v.addEventListener('loadedmetadata', () => { try { v.currentTime = (m.progress / 100) * v.duration; } catch (e) { /* ignore */ } });
1698
- }
1699
- v.addEventListener('timeupdate', () => {
1700
- if (!v.duration || Number.isNaN(v.duration)) return;
1701
- const pct = (v.currentTime / v.duration) * 100;
1702
- const m2 = state.movies.find((x) => x.id === m.id);
1703
- if (m2 && Math.abs(m2.progress - pct) > 0.5) {
1704
- m2.progress = Math.min(98, pct);
1705
- store.set(K.movies, state.movies);
1706
- }
1707
- });
1708
- v.addEventListener('error', () => {
1709
- stage.innerHTML = '';
1710
- const box = document.createElement('div');
1711
- box.className = 'player-error';
1712
- box.innerHTML = '<h4>This link blocked direct streaming</h4>' +
1713
- '<p>Some Drive files need the <b>preview engine</b> instead. Click <i>⇄ engine</i> above, or paste a different share link.</p>';
1714
- stage.appendChild(box);
1715
- });
1716
- stage.appendChild(v);
1717
- return;
1718
- }
1719
- // preview engine
1720
- if (m.driveId) {
1721
- stage.innerHTML = '<iframe src="' + drivePreview(m.driveId) +
1722
- '" allow="autoplay; fullscreen" allowfullscreen></iframe>';
1723
- } else {
1724
- const box = document.createElement('div');
1725
- box.className = 'player-error';
1726
- box.innerHTML = '<h4>Nothing to preview</h4><p>This link has no Google Drive id.</p>';
1727
- stage.appendChild(box);
1728
- }
1729
- }
1730
-
1731
- function bindMovies() {
1732
- const onGrid = (e) => {
1733
- const card = e.target.closest('.movie-card');
1734
- if (!card) return;
1735
- const m = state.movies.find((x) => x.id === card.dataset.id);
1736
- if (!m) return;
1737
- const act = e.target.closest('[data-act]');
1738
- if (act) {
1739
- const a = act.dataset.act;
1740
- if (a === 'fav') { m.fav = !m.fav; store.set(K.movies, state.movies); renderMovies(); toast(m.fav ? '★ favorited' : '★ removed', 1200); }
1741
- else if (a === 'watched') { m.watched = !m.watched; m.progress = m.watched ? 100 : m.progress; store.set(K.movies, state.movies); renderMovies(); toast(m.watched ? 'marked watched' : 'marked unwatched', 1200); }
1742
- else if (a === 'edit') { showForm('movie', m); }
1743
- else if (a === 'del') {
1744
- if (confirm('Remove "' + m.title + '"?')) {
1745
- state.movies = state.movies.filter((x) => x.id !== m.id);
1746
- store.set(K.movies, state.movies);
1747
- renderMovies(); toast('movie removed');
1748
- }
1749
- }
1750
- return;
1751
- }
1752
- openPlayer(m);
1753
- };
1754
- $('movie-grid').addEventListener('click', onGrid);
1755
- $('continue-grid').addEventListener('click', onGrid);
1756
-
1757
- $('movies-add').addEventListener('click', () => showForm('movie', null));
1758
- $('movie-search').addEventListener('input', (e) => { state.movieFilter = e.target.value; renderMovies(); });
1759
- $('genre-chips').addEventListener('click', (e) => {
1760
- const chip = e.target.closest('.genre-chip');
1761
- if (!chip) return;
1762
- state.movieGenre = chip.dataset.g === 'all' ? '' : chip.dataset.g;
1763
- renderMovies();
1764
- });
1765
- $('movie-sort').addEventListener('change', (e) => { state.movieSort = e.target.value; renderMovies(); });
1766
- $('demo-movies').addEventListener('click', () => {
1767
- const have = state.movies.map((m) => m.title);
1768
- DEMO_MOVIES.forEach((dm) => {
1769
- if (!have.includes(dm.title)) {
1770
- state.movies.push(Object.assign({}, dm, {
1771
- id: uid(), url: dm.videoUrl, fav: false, watched: false, progress: 0, added: Date.now(),
1772
- }));
1773
- }
1774
- });
1775
- store.set(K.movies, state.movies);
1776
- renderMovies(); renderGames();
1777
- toast('demo shelf loaded');
1778
- confetti(40);
1779
- });
1780
-
1781
- $('player-close').addEventListener('click', closePlayer);
1782
- $('player-back').addEventListener('click', closePlayer);
1783
- $('player-modal').addEventListener('click', (e) => { if (e.target === $('player-modal')) closePlayer(); });
1784
- $('player-toggle').addEventListener('click', () => {
1785
- state.playerEngine = state.playerEngine === 'video' ? 'preview' : 'video';
1786
- renderPlayerStage();
1787
- toast('player engine: ' + state.playerEngine);
1788
- });
1789
- $('player-mark').addEventListener('click', () => {
1790
- if (!state.playerMovie) return;
1791
- const m = state.movies.find((x) => x.id === state.playerMovie.id);
1792
- if (m) { m.watched = true; m.progress = 100; store.set(K.movies, state.movies); renderMovies(); toast('✓ ' + m.title + ' marked watched'); }
1793
- });
1794
- }
1795
- // ═══════════ tunnel ═══════════
1796
-
1797
- function bindTunnel() { /* tunnel removed — nothing to bind */ }
1798
-
1799
- // ═══════════ hotkeys & konami ═══════════
1800
-
1801
- function bindHotkeys() {
1802
- const konami = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a'];
1803
- window.addEventListener('keydown', (e) => {
1804
- const tag = (document.activeElement || {}).tagName;
1805
- const typing = tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT';
1806
- if (!typing) {
1807
- if (e.key === '/') { e.preventDefault(); $('movie-search').focus(); return; }
1808
- if (e.key === 'g' || e.key === 'G') { $('games').scrollIntoView({ behavior: 'smooth' }); return; }
1809
- if (e.key === 'm' || e.key === 'M') { $('movies').scrollIntoView({ behavior: 'smooth' }); return; }
1810
- if (e.key === 'h' || e.key === 'H') { setWorkMode(!state.prefs.work); return; }
1811
- if (e.key === 'c' || e.key === 'C') { toggleCustomizer(!$('customizer').classList.contains('open')); return; }
1812
- }
1813
- if (e.key === 'Escape') {
1814
- closeLauncher(); closePlayer(); closeForm(); toggleCustomizer(false);
1815
- }
1816
- state.keys.push(e.key);
1817
- if (state.keys.length > konami.length) state.keys.shift();
1818
- if (state.keys.join(',') === konami.join(',')) {
1819
- state.keys = [];
1820
- turboTime();
1821
- }
1822
- });
1823
- }
1824
-
1825
- function turboTime() {
1826
- if (state.turbo) return;
1827
- state.turbo = true;
1828
- document.body.classList.add('turbo');
1829
- confetti(90);
1830
- toast('▲▲▼▼◄►◄►BA — TURBO MODE');
1831
- beep(880, 0.5, 'square');
1832
- setTimeout(() => { document.body.classList.remove('turbo'); state.turbo = false; }, 8000);
1833
- }
1834
-
1835
- // ═══════════ games form helper ═══════════
1836
-
1837
- function showGameForm(g) { showForm('game', g); }
1838
-
1839
- // ═══════════ work mode ═══════════
1840
-
1841
- const work = {
1842
- secs: 1500, left: 1500, running: false, timerId: null,
1843
- todos: store.get('emby.work.v1', []),
1844
- };
1845
- const fmtTime = (s) => {
1846
- s = Math.max(0, Math.round(s));
1847
- return String(Math.floor(s / 60)).padStart(2, '0') + ':' + String(s % 60).padStart(2, '0');
1848
- };
1849
- function renderWorkTimer() { $('focus-timer').textContent = fmtTime(work.left); }
1850
- function workTick() {
1851
- if (!work.running) return;
1852
- work.left -= 1;
1853
- if (work.left <= 0) {
1854
- work.left = 0; work.running = false;
1855
- clearInterval(work.timerId);
1856
- renderWorkTimer();
1857
- toast('focus session done');
1858
- beep(880, 0.6, 'square');
1859
- confetti(24);
1860
- return;
1861
- }
1862
- renderWorkTimer();
1863
- }
1864
- function renderTodos() {
1865
- $('todo-list').innerHTML = work.todos.map((t, i) =>
1866
- '<li class="' + (t.done ? 'done' : '') + '">' +
1867
- '<input type="checkbox" ' + (t.done ? 'checked ' : '') + 'data-i="' + i + '">' +
1868
- '<span>' + esc(t.text) + '</span>' +
1869
- '<button class="icon-btn" data-i="' + i + '" title="delete">&#10006;</button></li>').join('');
1870
- }
1871
- const saveTodos = () => store.set('emby.work.v1', work.todos);
1872
-
1873
- function setWorkMode(v) {
1874
- state.prefs.work = !!v;
1875
- applyPrefs();
1876
- store.set(K.prefs, state.prefs);
1877
- if (v) { closeLauncher(); closePlayer(); closeForm(); toggleCustomizer(false); }
1878
- toast(v ? 'Work Mode — vault hidden' : 'Work Mode off');
1879
- beep(v ? 392 : 330, 0.07);
1880
- }
1881
-
1882
- function bindWork() {
1883
- $('nav-work').addEventListener('click', () => setWorkMode(!state.prefs.work));
1884
- $('timer-start').addEventListener('click', () => {
1885
- if (work.left <= 0) work.left = work.secs;
1886
- work.running = true; clearInterval(work.timerId);
1887
- work.timerId = setInterval(workTick, 1000);
1888
- renderWorkTimer();
1889
- });
1890
- $('timer-pause').addEventListener('click', () => {
1891
- work.running = false; clearInterval(work.timerId);
1892
- });
1893
- $('timer-reset').addEventListener('click', () => {
1894
- work.running = false; clearInterval(work.timerId);
1895
- work.left = work.secs; renderWorkTimer();
1896
- });
1897
- $('timer-length').addEventListener('change', (e) => {
1898
- work.secs = Number(e.target.value); work.left = work.secs; renderWorkTimer();
1899
- });
1900
- $('todo-form').addEventListener('submit', (e) => {
1901
- e.preventDefault();
1902
- const v = $('todo-input').value.trim();
1903
- if (!v) return;
1904
- work.todos.push({ text: v, done: false });
1905
- $('todo-input').value = '';
1906
- saveTodos(); renderTodos(); beep(520, 0.06);
1907
- });
1908
- $('todo-list').addEventListener('change', (e) => {
1909
- const i = Number(e.target.dataset.i);
1910
- if (work.todos[i] !== undefined) { work.todos[i].done = e.target.checked; saveTodos(); renderTodos(); }
1911
- });
1912
- $('todo-list').addEventListener('click', (e) => {
1913
- if (!e.target.classList.contains('icon-btn')) return;
1914
- const i = Number(e.target.dataset.i);
1915
- if (work.todos[i] !== undefined) { work.todos.splice(i, 1); saveTodos(); renderTodos(); }
1916
- });
1917
- }
1918
-
1919
- // ═══════════ clocks ═══════════
1920
-
1921
- function tick() {
1922
- const d = new Date();
1923
- const t = d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });
1924
- $('nav-clock').textContent = t;
1925
- $('foot-clock').textContent = new Date().toLocaleDateString([], { weekday: 'short', month: 'short', day: 'numeric' }) + ' · ' + t;
1926
- }
1927
-
1928
- // ═══════════ boot splash ═══════════
1929
-
1930
- const BOOT_LINES = [
1931
- 'boot ignite OS v1.4 …',
1932
- 'game vault … loading',
1933
- 'games vault … ready',
1934
- 'movies (drive) … ready',
1935
- 'weapons hot. have fun, ' + state.profile.name + '.',
1936
- ];
1937
-
1938
- function runBoot() {
1939
- const typeEl = $('boot-type');
1940
- const fill = $('boot-fill');
1941
- const total = 3000;
1942
- const start = performance.now();
1943
- let line = -1;
1944
- const step = () => {
1945
- const p = Math.min(1, (performance.now() - start) / total);
1946
- fill.style.width = Math.round(p * 100) + '%';
1947
- const targetLine = Math.floor(p * BOOT_LINES.length);
1948
- if (targetLine > line) {
1949
- line = targetLine;
1950
- typeEl.textContent = BOOT_LINES[Math.min(line, BOOT_LINES.length - 1)];
1951
- }
1952
- if (p < 1 && state.prefs.anim) requestAnimationFrame(step);
1953
- else finishBoot();
1954
- };
1955
- const finishBoot = () => {
1956
- fill.style.width = '100%';
1957
- typeEl.textContent = 'ready. pull up.';
1958
- setTimeout(() => {
1959
- $('boot').classList.add('done');
1960
- setTimeout(() => $('boot').remove(), 600);
1961
- confetti(26);
1962
- }, 320);
1963
- };
1964
- if (!state.prefs.anim) { typeEl.textContent = 'ready.'; finishBoot(); return; }
1965
- requestAnimationFrame(step);
1966
- }
1967
-
1968
- // ═══════════ init ═══════════
1969
-
1970
- async function fetchLocalGames() {
1971
- try {
1972
- const res = await fetch(serverBase() + '/lg/');
1973
- const names = await res.json();
1974
- state.localGames = names.sort();
1975
- renderGames();
1976
- } catch { /* server missing — ignore */ }
1977
- }
1978
-
1979
- function seedDemo() {
1980
- if (state.movies.length) return;
1981
- state.movies = DEMO_MOVIES.map((dm) => Object.assign({}, dm, {
1982
- id: uid(), url: dm.videoUrl, fav: false, watched: false, progress: 0, added: Date.now(),
1983
- }));
1984
- store.set(K.movies, state.movies);
1985
- }
1986
-
1987
- function init() {
1988
- seedDemo();
1989
- $('profile-pill').textContent = state.profile.name;
1990
- $('profile-pill').addEventListener('click', () => toggleCustomizer(true));
1991
- applyPrefs();
1992
- bindCustomizer();
1993
- bindGames();
1994
- bindMovies();
1995
- bindForm();
1996
- bindTunnel();
1997
- bindHotkeys();
1998
- bindWork();
1999
- renderWorkTimer();
2000
- renderTodos();
2001
- renderGames();
2002
- renderMovies();
2003
- tick(); setInterval(tick, 1000);
2004
- canvas.width = window.innerWidth; canvas.height = window.innerHeight;
2005
- initMotes();
2006
- bgLoop();
2007
- const last = store.get(K.last, {});
2008
- $('stat-last').textContent = last.name ? last.name.slice(0, 12) : '—';
2009
- fetchLocalGames();
2010
- runBoot();
2011
- }
2012
-
2013
- document.addEventListener('DOMContentLoaded', init);
2014
- })();
2015
- </script>
289
+ <script src="js/data.js"></script>
290
+ <script src="js/app.js"></script>
2016
291
  </body>
2017
292
  </html>