@jjlmoya/utils-creative 1.17.0 → 1.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-creative",
3
- "version": "1.17.0",
3
+ "version": "1.19.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -10,7 +10,8 @@
10
10
  "./data": "./src/data.ts"
11
11
  },
12
12
  "files": [
13
- "src"
13
+ "src",
14
+ "scripts"
14
15
  ],
15
16
  "publishConfig": {
16
17
  "access": "public"
@@ -29,7 +30,8 @@
29
30
  "postversion": "git push && git push --tags",
30
31
  "patch": "npm version patch",
31
32
  "minor": "npm version minor",
32
- "major": "npm version major"
33
+ "major": "npm version major",
34
+ "postinstall": "node scripts/postinstall.mjs"
33
35
  },
34
36
  "lint-staged": {
35
37
  "*.{ts,tsx,astro}": [
@@ -0,0 +1,27 @@
1
+ import { readFileSync, writeFileSync, mkdirSync, readdirSync } from 'fs';
2
+ import { join, dirname } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ const libDir = dirname(fileURLToPath(import.meta.url));
6
+ const toolsDir = join(libDir, '../src/tool');
7
+
8
+ const inNodeModules = libDir.includes('node_modules');
9
+ if (!inNodeModules) process.exit(0);
10
+
11
+ const projectRoot = join(libDir, '../../../..');
12
+ const categoryKey = JSON.parse(readFileSync(join(libDir, '../package.json'), 'utf8')).name.replace('@jjlmoya/utils-', '');
13
+ const destDir = join(projectRoot, `public/styles/lib/${categoryKey}`);
14
+
15
+ mkdirSync(destDir, { recursive: true });
16
+
17
+ const tools = readdirSync(toolsDir, { withFileTypes: true }).filter(d => d.isDirectory());
18
+ for (const tool of tools) {
19
+ const toolDir = join(toolsDir, tool.name);
20
+ let files;
21
+ try { files = readdirSync(toolDir).filter(f => f.endsWith('.css')); }
22
+ catch { continue; }
23
+ for (const file of files) {
24
+ writeFileSync(join(destDir, file), readFileSync(join(toolDir, file)));
25
+ console.log(`[@jjlmoya/utils-${categoryKey}] copied ${file}`);
26
+ }
27
+ }
@@ -0,0 +1,507 @@
1
+ .bead-wrapper {
2
+ width: 100%;
3
+ max-width: 72rem;
4
+ margin: 0 auto;
5
+ padding: 1rem 2rem;
6
+ }
7
+
8
+ .bead-hidden {
9
+ display: none;
10
+ }
11
+
12
+ .bead-card {
13
+ position: relative;
14
+ background: rgba(255,255,255,0.85);
15
+ backdrop-filter: blur(16px);
16
+ border-radius: 1.5rem;
17
+ box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
18
+ overflow: hidden;
19
+ border: 1px solid rgba(255,255,255,0.2);
20
+ }
21
+ .theme-dark .bead-card {
22
+ background: rgba(17,24,39,0.85);
23
+ border-color: rgba(55,65,81,0.3);
24
+ }
25
+
26
+ .bead-top-bar {
27
+ position: absolute;
28
+ top: 0;
29
+ left: 0;
30
+ width: 100%;
31
+ height: 0.5rem;
32
+ background: linear-gradient(to right, #ec4899, #a855f7, #6366f1);
33
+ }
34
+
35
+ .bead-inner {
36
+ padding: 2.5rem;
37
+ display: flex;
38
+ flex-direction: column;
39
+ gap: 2rem;
40
+ }
41
+
42
+ .bead-header {
43
+ display: flex;
44
+ flex-wrap: wrap;
45
+ gap: 1.5rem;
46
+ justify-content: space-between;
47
+ align-items: flex-end;
48
+ }
49
+ .bead-header-title h2 {
50
+ font-size: 1.5rem;
51
+ font-weight: 700;
52
+ color: #1f2937;
53
+ margin: 0;
54
+ }
55
+
56
+ .theme-dark .bead-header-title h2 {
57
+ color: #fff;
58
+ }
59
+
60
+ .bead-header-title p {
61
+ font-size: 0.875rem;
62
+ color: #6b7280;
63
+ margin: 0.25rem 0 0;
64
+ }
65
+
66
+ .theme-dark .bead-header-title p {
67
+ color: #9ca3af;
68
+ }
69
+
70
+ .bead-controls {
71
+ display: flex;
72
+ flex-wrap: wrap;
73
+ gap: 1rem;
74
+ align-items: flex-end;
75
+ }
76
+
77
+ .bead-control-group {
78
+ display: flex;
79
+ flex-direction: column;
80
+ gap: 0.25rem;
81
+ min-width: 9rem;
82
+ }
83
+
84
+ .bead-control-label {
85
+ font-size: 0.7rem;
86
+ font-weight: 700;
87
+ text-transform: uppercase;
88
+ color: #6b7280;
89
+ }
90
+
91
+ .bead-slider-row {
92
+ display: flex;
93
+ align-items: center;
94
+ gap: 0.5rem;
95
+ background: #f3f4f6;
96
+ padding: 0.5rem;
97
+ border-radius: 0.5rem;
98
+ border: 1px solid #e5e7eb;
99
+ }
100
+
101
+ .theme-dark .bead-slider-row {
102
+ background: #1f2937;
103
+ border-color: #374151;
104
+ }
105
+
106
+ .bead-slider {
107
+ flex: 1;
108
+ height: 0.5rem;
109
+ border-radius: 0.5rem;
110
+ appearance: none;
111
+ cursor: pointer;
112
+ background: #d1d5db;
113
+ }
114
+
115
+ .theme-dark .bead-slider {
116
+ background: #4b5563;
117
+ }
118
+
119
+ .bead-slider-pink {
120
+ accent-color: #ec4899;
121
+ }
122
+
123
+ .bead-slider-purple {
124
+ accent-color: #a855f7;
125
+ }
126
+
127
+ .bead-slider-val {
128
+ font-size: 0.875rem;
129
+ font-weight: 700;
130
+ width: 2rem;
131
+ text-align: center;
132
+ }
133
+ .bead-val-pink {
134
+ color: #ec4899;
135
+ }
136
+
137
+ .bead-val-purple {
138
+ color: #a855f7;
139
+ }
140
+
141
+ .bead-options-row {
142
+ display: flex;
143
+ align-items: center;
144
+ gap: 1rem;
145
+ height: 2.625rem;
146
+ background: #f3f4f6;
147
+ padding: 0.5rem 0.75rem;
148
+ border-radius: 0.5rem;
149
+ border: 1px solid #e5e7eb;
150
+ }
151
+
152
+ .theme-dark .bead-options-row {
153
+ background: #1f2937;
154
+ border-color: #374151;
155
+ }
156
+
157
+ .bead-checkbox-label {
158
+ display: flex;
159
+ align-items: center;
160
+ gap: 0.5rem;
161
+ cursor: pointer;
162
+ font-size: 0.875rem;
163
+ font-weight: 700;
164
+ color: #374151;
165
+ white-space: nowrap;
166
+ }
167
+
168
+ .theme-dark .bead-checkbox-label {
169
+ color: #d1d5db;
170
+ }
171
+
172
+ .bead-checkbox {
173
+ width: 1rem;
174
+ height: 1rem;
175
+ accent-color: #ec4899;
176
+ cursor: pointer;
177
+ }
178
+
179
+ .bead-divider {
180
+ width: 1px;
181
+ height: 100%;
182
+ background: #d1d5db;
183
+ }
184
+
185
+ .theme-dark .bead-divider {
186
+ background: #4b5563;
187
+ }
188
+
189
+ .bead-download-btn {
190
+ display: flex;
191
+ align-items: center;
192
+ gap: 0.5rem;
193
+ padding: 0.75rem 1.5rem;
194
+ background: #4f46e5;
195
+ color: #fff;
196
+ border: none;
197
+ border-radius: 0.75rem;
198
+ font-weight: 700;
199
+ cursor: pointer;
200
+ box-shadow: 0 4px 14px rgba(79,70,229,0.3);
201
+ transition: background 0.2s, box-shadow 0.2s;
202
+ white-space: nowrap;
203
+ }
204
+
205
+ .bead-download-btn:hover {
206
+ background: #4338ca;
207
+ }
208
+
209
+ .bead-download-btn:disabled {
210
+ opacity: 0.5;
211
+ box-shadow: none;
212
+ cursor: not-allowed;
213
+ }
214
+
215
+ .bead-canvas-area {
216
+ position: relative;
217
+ min-height: 25rem;
218
+ display: flex;
219
+ flex-direction: column;
220
+ gap: 3rem;
221
+ }
222
+
223
+ .bead-drop-zone {
224
+ position: relative;
225
+ display: flex;
226
+ flex-direction: column;
227
+ align-items: center;
228
+ justify-content: center;
229
+ border: 3px dashed #d1d5db;
230
+ border-radius: 1rem;
231
+ min-height: 25rem;
232
+ background: rgba(255,255,255,0.5);
233
+ backdrop-filter: blur(4px);
234
+ transition: border-color 0.2s, background 0.2s, transform 0.2s;
235
+ cursor: pointer;
236
+ }
237
+ .theme-dark .bead-drop-zone {
238
+ border-color: #374151;
239
+ background: rgba(31,41,55,0.5);
240
+ }
241
+
242
+ .bead-drop-zone:hover,
243
+ .bead-drop-active {
244
+ border-color: #ec4899;
245
+ background: rgba(236,72,153,0.04);
246
+ transform: scale(1.01);
247
+ }
248
+
249
+ .bead-file-input {
250
+ position: absolute;
251
+ inset: 0;
252
+ width: 100%;
253
+ height: 100%;
254
+ opacity: 0;
255
+ cursor: pointer;
256
+ z-index: 1;
257
+ }
258
+
259
+ .bead-drop-content {
260
+ text-align: center;
261
+ display: flex;
262
+ flex-direction: column;
263
+ align-items: center;
264
+ gap: 1rem;
265
+ pointer-events: none;
266
+ }
267
+
268
+ .bead-upload-icon {
269
+ display: flex;
270
+ align-items: center;
271
+ justify-content: center;
272
+ width: 5rem;
273
+ height: 5rem;
274
+ background: linear-gradient(135deg, #f472b6, #a855f7);
275
+ border-radius: 50%;
276
+ box-shadow: 0 8px 20px rgba(168,85,247,0.3);
277
+ color: #fff;
278
+ }
279
+
280
+ .bead-drop-content h3 {
281
+ font-size: 1.25rem;
282
+ font-weight: 700;
283
+ color: #374151;
284
+ margin: 0;
285
+ }
286
+
287
+ .theme-dark .bead-drop-content h3 {
288
+ color: #e5e7eb;
289
+ }
290
+
291
+ .bead-drop-content p {
292
+ color: #6b7280;
293
+ margin: 0;
294
+ }
295
+
296
+ .bead-result {
297
+ display: flex;
298
+ flex-direction: column;
299
+ gap: 2rem;
300
+ animation: bead-fade-in 0.5s ease;
301
+ }
302
+
303
+ @keyframes bead-fade-in {
304
+ from {
305
+ opacity: 0;
306
+ transform: scale(0.98);
307
+ }
308
+
309
+ to {
310
+ opacity: 1;
311
+ transform: scale(1);
312
+ }
313
+ }
314
+
315
+ .bead-result-inner {
316
+ display: flex;
317
+ gap: 2rem;
318
+ align-items: flex-start;
319
+ }
320
+
321
+ @media (max-width: 640px) {
322
+ .bead-result-inner {
323
+ flex-direction: column;
324
+ }
325
+ }
326
+
327
+ .bead-palette-col {
328
+ width: 12rem;
329
+ flex-shrink: 0;
330
+ }
331
+
332
+ .bead-palette-title {
333
+ font-size: 0.7rem;
334
+ font-weight: 700;
335
+ text-transform: uppercase;
336
+ letter-spacing: 0.05em;
337
+ color: #6b7280;
338
+ margin: 0 0 0.75rem;
339
+ }
340
+
341
+ .bead-palette-grid {
342
+ display: grid;
343
+ grid-template-columns: repeat(4, 1fr);
344
+ gap: 0.5rem;
345
+ }
346
+
347
+ .bead-palette-item {
348
+ display: flex;
349
+ flex-direction: column;
350
+ align-items: center;
351
+ }
352
+
353
+ .bead-color-swatch {
354
+ width: 100%;
355
+ aspect-ratio: 1;
356
+ border-radius: 50%;
357
+ box-shadow: 0 2px 6px rgba(0,0,0,0.15);
358
+ border: 2px solid #fff;
359
+ outline: 1px solid #e5e7eb;
360
+ display: flex;
361
+ align-items: center;
362
+ justify-content: center;
363
+ }
364
+
365
+ .theme-dark .bead-color-swatch {
366
+ border-color: #1f2937;
367
+ outline-color: #374151;
368
+ }
369
+
370
+ .bead-symbol {
371
+ font-size: 0.75rem;
372
+ font-weight: 700;
373
+ user-select: none;
374
+ }
375
+ .bead-symbol-dark {
376
+ color: #000;
377
+ }
378
+
379
+ .bead-symbol-light {
380
+ color: #fff;
381
+ }
382
+
383
+ .bead-reupload-btn {
384
+ margin-top: 1.5rem;
385
+ width: 100%;
386
+ padding: 0.5rem;
387
+ font-size: 0.875rem;
388
+ font-weight: 700;
389
+ color: #6b7280;
390
+ border: 1px solid #e5e7eb;
391
+ border-radius: 0.5rem;
392
+ background: transparent;
393
+ cursor: pointer;
394
+ display: flex;
395
+ align-items: center;
396
+ justify-content: center;
397
+ gap: 0.5rem;
398
+ transition: color 0.2s, border-color 0.2s;
399
+ }
400
+
401
+ .bead-reupload-btn:hover {
402
+ color: #ec4899;
403
+ border-color: #f9a8d4;
404
+ }
405
+
406
+ .bead-canvas-col {
407
+ flex: 1;
408
+ background: #f3f4f6;
409
+ padding: 1rem;
410
+ border-radius: 0.75rem;
411
+ border: 2px solid #e5e7eb;
412
+ box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
413
+ overflow-x: auto;
414
+ text-align: center;
415
+ }
416
+
417
+ .theme-dark .bead-canvas-col {
418
+ background: #030712;
419
+ border-color: #1f2937;
420
+ }
421
+
422
+ .bead-canvas {
423
+ display: inline-block;
424
+ max-width: 100%;
425
+ box-shadow: 0 20px 40px rgba(0,0,0,0.2);
426
+ cursor: crosshair;
427
+ image-rendering: pixelated;
428
+ }
429
+
430
+ .bead-tunnel-bar {
431
+ display: flex;
432
+ align-items: center;
433
+ justify-content: space-between;
434
+ flex-wrap: wrap;
435
+ gap: 1rem;
436
+ padding: 1rem;
437
+ background: #eef2ff;
438
+ border: 1px solid #c7d2fe;
439
+ border-radius: 0.75rem;
440
+ }
441
+
442
+ .theme-dark .bead-tunnel-bar {
443
+ background: rgba(79,70,229,0.1);
444
+ border-color: rgba(99,102,241,0.3);
445
+ }
446
+
447
+ .bead-tunnel-title {
448
+ font-weight: 700;
449
+ color: #312e81;
450
+ margin: 0;
451
+ }
452
+
453
+ .theme-dark .bead-tunnel-title {
454
+ color: #c7d2fe;
455
+ }
456
+
457
+ .bead-tunnel-sub {
458
+ font-size: 0.875rem;
459
+ color: #4338ca;
460
+ margin: 0.25rem 0 0;
461
+ }
462
+
463
+ .theme-dark .bead-tunnel-sub {
464
+ color: #818cf8;
465
+ }
466
+
467
+ .bead-tunnel-controls {
468
+ display: flex;
469
+ gap: 0.5rem;
470
+ align-items: center;
471
+ }
472
+
473
+ .bead-tunnel-btn {
474
+ padding: 0.5rem;
475
+ border-radius: 0.5rem;
476
+ border: none;
477
+ background: #fff;
478
+ color: #4f46e5;
479
+ cursor: pointer;
480
+ transition: background 0.15s;
481
+ }
482
+
483
+ .bead-tunnel-btn:hover {
484
+ background: #e0e7ff;
485
+ }
486
+
487
+ .theme-dark .bead-tunnel-btn {
488
+ background: #1f2937;
489
+ color: #818cf8;
490
+ }
491
+
492
+ .bead-tunnel-display {
493
+ padding: 0.5rem 1rem;
494
+ background: #fff;
495
+ border-radius: 0.5rem;
496
+ font-weight: 700;
497
+ color: #4f46e5;
498
+ border: 1px solid #c7d2fe;
499
+ min-width: 3rem;
500
+ text-align: center;
501
+ }
502
+
503
+ .theme-dark .bead-tunnel-display {
504
+ background: #1f2937;
505
+ color: #818cf8;
506
+ border-color: rgba(99,102,241,0.3);
507
+ }