@mar7th/firework 1.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.
package/src/styles.css ADDED
@@ -0,0 +1,544 @@
1
+ :root {
2
+ color-scheme: dark;
3
+ --panel: rgba(43, 20, 30, 0.9);
4
+ --panel-strong: rgba(58, 24, 30, 0.96);
5
+ --paper: #fff2d0;
6
+ --line: rgba(255, 216, 138, 0.24);
7
+ --text: #fff9e8;
8
+ --muted: #f3cfa4;
9
+ --accent: #ffbf4d;
10
+ --accent-2: #ff5a3c;
11
+ --accent-3: #63d6d1;
12
+ --danger: #ff6d7a;
13
+ --ink: #2b141e;
14
+ font-family:
15
+ Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
16
+ "Microsoft YaHei", sans-serif;
17
+ }
18
+
19
+ * {
20
+ box-sizing: border-box;
21
+ }
22
+
23
+ html,
24
+ body {
25
+ width: 100%;
26
+ height: 100%;
27
+ margin: 0;
28
+ overflow: hidden;
29
+ background:
30
+ radial-gradient(circle at 18% 14%, rgba(255, 191, 77, 0.2), transparent 28rem),
31
+ radial-gradient(circle at 86% 20%, rgba(255, 90, 60, 0.18), transparent 24rem),
32
+ linear-gradient(180deg, #171025 0%, #321622 48%, #160c16 100%);
33
+ color: var(--text);
34
+ }
35
+
36
+ button,
37
+ select,
38
+ input {
39
+ font: inherit;
40
+ }
41
+
42
+ button,
43
+ select,
44
+ .file-button {
45
+ min-height: 34px;
46
+ border: 1px solid var(--line);
47
+ border-radius: 6px;
48
+ background:
49
+ linear-gradient(180deg, rgba(255, 242, 208, 0.12), rgba(255, 139, 69, 0.08)),
50
+ rgba(67, 27, 31, 0.76);
51
+ color: var(--text);
52
+ }
53
+
54
+ button,
55
+ .file-button,
56
+ .toolbar-link {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ gap: 6px;
61
+ padding: 0 12px;
62
+ cursor: pointer;
63
+ transition:
64
+ border-color 160ms ease,
65
+ background 160ms ease,
66
+ transform 160ms ease;
67
+ }
68
+
69
+ button:hover,
70
+ .file-button:hover,
71
+ select:hover,
72
+ .toolbar-link:hover {
73
+ border-color: rgba(255, 191, 77, 0.78);
74
+ background:
75
+ linear-gradient(180deg, rgba(255, 191, 77, 0.2), rgba(255, 90, 60, 0.14)),
76
+ rgba(84, 30, 28, 0.84);
77
+ }
78
+
79
+ button:active {
80
+ transform: translateY(1px);
81
+ }
82
+
83
+ button[aria-pressed="true"] {
84
+ border-color: rgba(255, 214, 102, 0.95);
85
+ background: linear-gradient(180deg, rgba(255, 194, 77, 0.34), rgba(255, 90, 60, 0.26));
86
+ color: #fff7d5;
87
+ }
88
+
89
+ select {
90
+ max-width: 170px;
91
+ padding: 0 30px 0 10px;
92
+ border-color: rgba(255, 216, 138, 0.36);
93
+ background: #3a1a24;
94
+ color: var(--text);
95
+ outline: none;
96
+ box-shadow: 0 0 0 1px rgba(117, 35, 27, 0.32);
97
+ }
98
+
99
+ select option {
100
+ background: #3a1a24;
101
+ color: var(--text);
102
+ }
103
+
104
+ .toolbar-link {
105
+ min-height: 34px;
106
+ border: 1px solid var(--line);
107
+ border-radius: 6px;
108
+ padding: 0 12px;
109
+ background:
110
+ linear-gradient(180deg, rgba(255, 242, 208, 0.12), rgba(255, 139, 69, 0.08)),
111
+ rgba(67, 27, 31, 0.76);
112
+ color: var(--text);
113
+ text-decoration: none;
114
+ }
115
+
116
+ input[type="color"] {
117
+ width: 46px;
118
+ height: 32px;
119
+ border: 1px solid var(--line);
120
+ border-radius: 6px;
121
+ padding: 2px;
122
+ background: rgba(255, 242, 208, 0.12);
123
+ }
124
+
125
+ input[type="range"] {
126
+ width: 100%;
127
+ accent-color: var(--accent);
128
+ }
129
+
130
+ input[type="number"],
131
+ input[type="text"],
132
+ textarea {
133
+ min-width: 0;
134
+ border: 1px solid var(--line);
135
+ border-radius: 6px;
136
+ background: rgba(37, 17, 25, 0.78);
137
+ color: var(--text);
138
+ }
139
+
140
+ input[type="number"],
141
+ input[type="text"] {
142
+ height: 32px;
143
+ padding: 0 8px;
144
+ }
145
+
146
+ textarea {
147
+ width: 100%;
148
+ min-height: 260px;
149
+ resize: vertical;
150
+ padding: 10px;
151
+ font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
152
+ font-size: 12px;
153
+ line-height: 1.5;
154
+ outline: none;
155
+ }
156
+
157
+ textarea:focus {
158
+ border-color: rgba(255, 191, 77, 0.78);
159
+ box-shadow: 0 0 0 1px rgba(255, 191, 77, 0.28);
160
+ }
161
+
162
+ .app-shell {
163
+ display: grid;
164
+ grid-template-columns: minmax(0, 1fr) 360px;
165
+ width: 100vw;
166
+ height: 100vh;
167
+ }
168
+
169
+ .stage {
170
+ position: relative;
171
+ min-width: 0;
172
+ min-height: 0;
173
+ overflow: hidden;
174
+ background:
175
+ radial-gradient(circle at 12% 20%, rgba(255, 191, 77, 0.12), transparent 18rem),
176
+ radial-gradient(circle at 82% 10%, rgba(99, 214, 209, 0.12), transparent 18rem),
177
+ linear-gradient(180deg, #130e22 0%, #2a1322 52%, #0d0914 100%);
178
+ }
179
+
180
+ .stage::before {
181
+ position: absolute;
182
+ inset: 0;
183
+ pointer-events: none;
184
+ background-image:
185
+ radial-gradient(circle, rgba(255, 244, 190, 0.22) 0 1px, transparent 1.5px),
186
+ linear-gradient(120deg, transparent 0 46%, rgba(255, 191, 77, 0.08) 47% 49%, transparent 50%),
187
+ linear-gradient(60deg, transparent 0 48%, rgba(255, 90, 60, 0.06) 49% 51%, transparent 52%);
188
+ background-position: 0 0, 0 0, 24px 12px;
189
+ background-size: 34px 34px, 120px 120px, 120px 120px;
190
+ content: "";
191
+ mix-blend-mode: screen;
192
+ }
193
+
194
+ #fireworksCanvas {
195
+ display: block;
196
+ width: 100%;
197
+ height: 100%;
198
+ outline: none;
199
+ cursor: crosshair;
200
+ }
201
+
202
+ #fireworksCanvas:focus-visible {
203
+ box-shadow: inset 0 0 0 2px var(--accent);
204
+ }
205
+
206
+ .top-bar {
207
+ position: absolute;
208
+ top: 14px;
209
+ left: 14px;
210
+ right: 14px;
211
+ display: flex;
212
+ align-items: flex-start;
213
+ justify-content: space-between;
214
+ gap: 12px;
215
+ pointer-events: none;
216
+ }
217
+
218
+ .action-group {
219
+ display: flex;
220
+ flex-wrap: wrap;
221
+ align-items: center;
222
+ gap: 8px;
223
+ padding: 8px;
224
+ border: 1px solid var(--line);
225
+ border-radius: 8px;
226
+ background:
227
+ linear-gradient(180deg, rgba(255, 242, 208, 0.08), rgba(83, 31, 30, 0.18)),
228
+ rgba(30, 15, 26, 0.68);
229
+ backdrop-filter: blur(14px);
230
+ pointer-events: auto;
231
+ box-shadow: 0 12px 30px rgba(46, 14, 20, 0.22);
232
+ }
233
+
234
+ .metric {
235
+ min-width: 72px;
236
+ color: var(--accent);
237
+ font-size: 13px;
238
+ font-variant-numeric: tabular-nums;
239
+ }
240
+
241
+ .file-button {
242
+ position: relative;
243
+ overflow: hidden;
244
+ }
245
+
246
+ .file-button input {
247
+ position: absolute;
248
+ inset: 0;
249
+ opacity: 0;
250
+ cursor: pointer;
251
+ }
252
+
253
+ .toast {
254
+ position: absolute;
255
+ left: 50%;
256
+ bottom: 22px;
257
+ max-width: min(520px, calc(100% - 32px));
258
+ padding: 10px 14px;
259
+ border: 1px solid var(--line);
260
+ border-radius: 8px;
261
+ background: rgba(49, 20, 27, 0.88);
262
+ color: var(--text);
263
+ line-height: 1.45;
264
+ opacity: 0;
265
+ pointer-events: none;
266
+ transform: translate(-50%, 12px);
267
+ transition:
268
+ opacity 180ms ease,
269
+ transform 180ms ease;
270
+ }
271
+
272
+ .toast.visible {
273
+ opacity: 1;
274
+ transform: translate(-50%, 0);
275
+ }
276
+
277
+ .control-panel {
278
+ min-height: 0;
279
+ overflow: auto;
280
+ border-left: 1px solid var(--line);
281
+ background:
282
+ radial-gradient(circle at 92% 0%, rgba(255, 191, 77, 0.12), transparent 16rem),
283
+ linear-gradient(180deg, rgba(54, 24, 31, 0.99), rgba(32, 16, 26, 0.99)),
284
+ #24111c;
285
+ }
286
+
287
+ .panel-header {
288
+ position: sticky;
289
+ top: 0;
290
+ z-index: 3;
291
+ display: flex;
292
+ align-items: flex-start;
293
+ justify-content: space-between;
294
+ gap: 12px;
295
+ padding: 18px 18px 14px;
296
+ border-bottom: 1px solid var(--line);
297
+ background:
298
+ linear-gradient(180deg, rgba(255, 242, 208, 0.08), rgba(255, 90, 60, 0.08)),
299
+ var(--panel-strong);
300
+ }
301
+
302
+ .panel-header h1 {
303
+ margin: 0;
304
+ font-size: 22px;
305
+ line-height: 1.2;
306
+ letter-spacing: 0;
307
+ color: #fff4c7;
308
+ text-shadow: 0 0 18px rgba(255, 191, 77, 0.22);
309
+ }
310
+
311
+ .panel-header p {
312
+ margin: 7px 0 0;
313
+ color: var(--muted);
314
+ font-size: 13px;
315
+ line-height: 1.45;
316
+ }
317
+
318
+ .controls {
319
+ display: grid;
320
+ gap: 10px;
321
+ padding: 14px;
322
+ }
323
+
324
+ details.control-section {
325
+ border: 1px solid var(--line);
326
+ border-radius: 8px;
327
+ background:
328
+ linear-gradient(180deg, rgba(255, 242, 208, 0.07), rgba(255, 139, 69, 0.045)),
329
+ rgba(41, 18, 29, 0.78);
330
+ box-shadow: inset 0 1px 0 rgba(255, 242, 208, 0.07);
331
+ }
332
+
333
+ details.control-section summary {
334
+ display: flex;
335
+ align-items: center;
336
+ justify-content: space-between;
337
+ padding: 12px 14px;
338
+ color: #fff0bf;
339
+ font-weight: 700;
340
+ cursor: pointer;
341
+ list-style: none;
342
+ }
343
+
344
+ details.control-section summary::-webkit-details-marker {
345
+ display: none;
346
+ }
347
+
348
+ .section-body {
349
+ display: grid;
350
+ gap: 12px;
351
+ padding: 0 14px 14px;
352
+ }
353
+
354
+ .control-row {
355
+ display: grid;
356
+ grid-template-columns: minmax(100px, 0.9fr) minmax(0, 1.5fr);
357
+ gap: 10px;
358
+ align-items: center;
359
+ }
360
+
361
+ .control-row label {
362
+ color: var(--muted);
363
+ font-size: 13px;
364
+ }
365
+
366
+ .control-hint,
367
+ .section-hint {
368
+ margin: 0;
369
+ color: var(--muted);
370
+ font-size: 12px;
371
+ line-height: 1.45;
372
+ }
373
+
374
+ .control-hint {
375
+ grid-column: 2;
376
+ margin-top: -4px;
377
+ }
378
+
379
+ .section-hint {
380
+ padding: 9px 10px;
381
+ border: 1px solid rgba(255, 191, 77, 0.32);
382
+ border-radius: 6px;
383
+ background: rgba(255, 191, 77, 0.1);
384
+ color: #ffe8bd;
385
+ }
386
+
387
+ .range-control {
388
+ display: grid;
389
+ grid-template-columns: minmax(0, 1fr) 76px;
390
+ gap: 8px;
391
+ align-items: center;
392
+ }
393
+
394
+ .switch-control {
395
+ justify-content: flex-start;
396
+ width: 52px;
397
+ height: 28px;
398
+ border-radius: 999px;
399
+ padding: 3px;
400
+ }
401
+
402
+ .switch-control::before {
403
+ width: 20px;
404
+ height: 20px;
405
+ border-radius: 50%;
406
+ background: currentColor;
407
+ content: "";
408
+ transition: transform 160ms ease;
409
+ }
410
+
411
+ .switch-control[aria-pressed="true"]::before {
412
+ transform: translateX(22px);
413
+ }
414
+
415
+ .swatch-grid {
416
+ display: grid;
417
+ grid-template-columns: repeat(2, minmax(0, 1fr));
418
+ gap: 8px;
419
+ }
420
+
421
+ .wide-row {
422
+ grid-column: 1 / -1;
423
+ }
424
+
425
+ .button-grid {
426
+ display: grid;
427
+ grid-template-columns: repeat(2, minmax(0, 1fr));
428
+ gap: 8px;
429
+ }
430
+
431
+ .script-preset-control {
432
+ display: grid;
433
+ grid-template-columns: 88px minmax(0, 1fr);
434
+ gap: 10px;
435
+ align-items: center;
436
+ color: var(--muted);
437
+ font-size: 13px;
438
+ }
439
+
440
+ .script-preset-control select {
441
+ max-width: none;
442
+ width: 100%;
443
+ }
444
+
445
+ .danger {
446
+ color: #ffeef0;
447
+ border-color: rgba(255, 109, 122, 0.35);
448
+ }
449
+
450
+ .advanced-script-section {
451
+ margin: 0 14px 14px;
452
+ }
453
+
454
+ .script-status {
455
+ margin: 0;
456
+ color: var(--muted);
457
+ font-size: 12px;
458
+ line-height: 1.45;
459
+ }
460
+
461
+ .script-status.error {
462
+ color: var(--danger);
463
+ }
464
+
465
+ .script-status.ok {
466
+ color: var(--accent);
467
+ }
468
+
469
+ .collapsed .control-panel {
470
+ width: 0;
471
+ min-width: 0;
472
+ border-left: 0;
473
+ overflow: hidden;
474
+ }
475
+
476
+ .collapsed {
477
+ grid-template-columns: minmax(0, 1fr) 0;
478
+ }
479
+
480
+ .embed-mode {
481
+ grid-template-columns: minmax(0, 1fr);
482
+ }
483
+
484
+ .embed-mode .control-panel,
485
+ .embed-mode .top-bar {
486
+ display: none;
487
+ }
488
+
489
+ @media (max-width: 900px) {
490
+ .app-shell {
491
+ grid-template-columns: 1fr;
492
+ grid-template-rows: minmax(45vh, 1fr) minmax(280px, 42vh);
493
+ }
494
+
495
+ .control-panel {
496
+ border-top: 1px solid var(--line);
497
+ border-left: 0;
498
+ }
499
+
500
+ .top-bar {
501
+ flex-direction: column;
502
+ align-items: stretch;
503
+ }
504
+
505
+ .action-group {
506
+ width: fit-content;
507
+ max-width: 100%;
508
+ }
509
+ }
510
+
511
+ @media (max-width: 560px) {
512
+ .top-bar {
513
+ top: 8px;
514
+ left: 8px;
515
+ right: 8px;
516
+ }
517
+
518
+ .action-group {
519
+ gap: 6px;
520
+ padding: 6px;
521
+ }
522
+
523
+ button,
524
+ select,
525
+ .file-button {
526
+ min-height: 32px;
527
+ padding-inline: 9px;
528
+ font-size: 13px;
529
+ }
530
+
531
+ .control-row {
532
+ grid-template-columns: 1fr;
533
+ gap: 6px;
534
+ }
535
+
536
+ .control-hint {
537
+ grid-column: 1;
538
+ margin-top: -2px;
539
+ }
540
+
541
+ .range-control {
542
+ grid-template-columns: minmax(0, 1fr) 70px;
543
+ }
544
+ }