@jjlmoya/utils-home 1.15.0 → 1.16.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-home",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -10,7 +10,8 @@
10
10
  "./entries": "./src/entries.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
+ }
@@ -209,235 +209,3 @@ const fillW = Math.abs(tempX - dewX);
209
209
  init();
210
210
  </script>
211
211
 
212
- <style>
213
- .dew-wrapper {
214
- --dew-p: #8b5cf6;
215
-
216
- width: 100%;
217
- padding: 1rem 0;
218
- }
219
-
220
- .dew-card {
221
- background: var(--bg-surface);
222
- width: calc(100% - 24px);
223
- max-width: 900px;
224
- margin: 0 auto;
225
- border-radius: 24px;
226
- overflow: hidden;
227
- display: flex;
228
- flex-direction: column;
229
- border: 1px solid var(--border-color);
230
- color: var(--text-main);
231
- }
232
-
233
- @media (min-width: 768px) {
234
- .dew-card {
235
- flex-direction: row;
236
- min-height: 500px;
237
- }
238
- }
239
-
240
- .dew-left {
241
- flex: 0 0 auto;
242
- width: 100%;
243
- padding: 32px;
244
- border-bottom: 1px solid var(--border-color);
245
- display: flex;
246
- flex-direction: column;
247
- gap: 32px;
248
- }
249
-
250
- @media (min-width: 768px) {
251
- .dew-left {
252
- width: 340px;
253
- border-bottom: none;
254
- border-right: 1px solid var(--border-color);
255
- }
256
- }
257
-
258
- .dew-right {
259
- flex: 1;
260
- background: var(--bg-page);
261
- display: flex;
262
- flex-direction: column;
263
- align-items: center;
264
- justify-content: center;
265
- gap: 24px;
266
- padding: 32px;
267
- min-height: 360px;
268
- }
269
-
270
- .dew-field {
271
- display: flex;
272
- flex-direction: column;
273
- gap: 12px;
274
- }
275
-
276
- .dew-field-top {
277
- display: flex;
278
- justify-content: space-between;
279
- align-items: flex-end;
280
- }
281
-
282
- .dew-label {
283
- font-size: 0.6875rem;
284
- font-weight: 700;
285
- text-transform: uppercase;
286
- letter-spacing: 0.1em;
287
- color: var(--dew-p);
288
- }
289
-
290
- .dew-val-display {
291
- font-size: 2rem;
292
- font-weight: 900;
293
- color: var(--text-main);
294
- line-height: 1;
295
- }
296
-
297
- .dew-unit {
298
- font-size: 1rem;
299
- font-weight: 400;
300
- color: var(--text-muted);
301
- }
302
-
303
- .dew-slider {
304
- width: 100%;
305
- height: 6px;
306
- accent-color: var(--dew-p);
307
- cursor: pointer;
308
- border-radius: 9999px;
309
- }
310
-
311
- .dew-steps {
312
- display: flex;
313
- gap: 8px;
314
- }
315
-
316
- .dew-step {
317
- flex: 1;
318
- padding: 8px;
319
- border-radius: 10px;
320
- border: 1px solid var(--border-color);
321
- background: var(--bg-surface);
322
- color: var(--text-main);
323
- font-size: 1.25rem;
324
- font-weight: 700;
325
- cursor: pointer;
326
- transition: all 0.15s;
327
- }
328
-
329
- .dew-step:hover {
330
- border-color: var(--dew-p);
331
- color: var(--dew-p);
332
- }
333
-
334
- .dew-result-section {
335
- text-align: center;
336
- }
337
-
338
- .dew-result-label {
339
- font-size: 0.6875rem;
340
- font-weight: 700;
341
- text-transform: uppercase;
342
- letter-spacing: 0.15em;
343
- color: var(--text-muted);
344
- margin: 0 0 8px;
345
- }
346
-
347
- .dew-result-value {
348
- font-size: 5rem;
349
- font-weight: 900;
350
- color: #06b6d4;
351
- line-height: 1;
352
- margin: 0;
353
- }
354
-
355
- .dew-result-unit {
356
- font-size: 2.5rem;
357
- font-weight: 300;
358
- color: var(--text-muted);
359
- }
360
-
361
- .dew-risk-badge {
362
- display: flex;
363
- align-items: center;
364
- gap: 10px;
365
- padding: 12px 18px;
366
- border-radius: 12px;
367
- width: 100%;
368
- max-width: 320px;
369
- transition: background 0.3s;
370
- }
371
-
372
- .dew-risk-dot {
373
- width: 10px;
374
- height: 10px;
375
- border-radius: 50%;
376
- flex-shrink: 0;
377
- }
378
-
379
- .dew-risk-text {
380
- display: flex;
381
- flex-direction: column;
382
- gap: 2px;
383
- }
384
-
385
- .dew-risk-name {
386
- font-size: 0.875rem;
387
- font-weight: 700;
388
- }
389
-
390
- .dew-risk-desc {
391
- font-size: 0.6875rem;
392
- opacity: 0.8;
393
- }
394
-
395
- .dew-risk-low {
396
- background: rgba(34, 197, 94, 0.1);
397
- border: 1px solid rgba(34, 197, 94, 0.2);
398
- color: #4ade80;
399
- }
400
-
401
- .dew-risk-low .dew-risk-dot {
402
- background: #22c55e;
403
- }
404
-
405
- .dew-risk-medium {
406
- background: rgba(245, 158, 11, 0.1);
407
- border: 1px solid rgba(245, 158, 11, 0.2);
408
- color: #fbbf24;
409
- }
410
-
411
- .dew-risk-medium .dew-risk-dot {
412
- background: #f59e0b;
413
- }
414
-
415
- .dew-risk-high {
416
- background: rgba(249, 115, 22, 0.1);
417
- border: 1px solid rgba(249, 115, 22, 0.2);
418
- color: #fb923c;
419
- }
420
-
421
- .dew-risk-high .dew-risk-dot {
422
- background: #f97316;
423
- }
424
-
425
- .dew-risk-extreme {
426
- background: rgba(239, 68, 68, 0.1);
427
- border: 1px solid rgba(239, 68, 68, 0.2);
428
- color: #f87171;
429
- }
430
-
431
- .dew-risk-extreme .dew-risk-dot {
432
- background: #ef4444;
433
- }
434
-
435
- .dew-gauge {
436
- width: 100%;
437
- max-width: 320px;
438
- }
439
-
440
- .dew-gauge-track {
441
- fill: var(--bg-muted);
442
- }
443
- </style>
@@ -0,0 +1,230 @@
1
+ .dew-wrapper {
2
+ --dew-p: #8b5cf6;
3
+
4
+ width: 100%;
5
+ padding: 1rem 0;
6
+ }
7
+
8
+ .dew-card {
9
+ background: var(--bg-surface);
10
+ width: calc(100% - 24px);
11
+ max-width: 900px;
12
+ margin: 0 auto;
13
+ border-radius: 24px;
14
+ overflow: hidden;
15
+ display: flex;
16
+ flex-direction: column;
17
+ border: 1px solid var(--border-color);
18
+ color: var(--text-main);
19
+ }
20
+
21
+ @media (min-width: 768px) {
22
+ .dew-card {
23
+ flex-direction: row;
24
+ min-height: 500px;
25
+ }
26
+ }
27
+
28
+ .dew-left {
29
+ flex: 0 0 auto;
30
+ width: 100%;
31
+ padding: 32px;
32
+ border-bottom: 1px solid var(--border-color);
33
+ display: flex;
34
+ flex-direction: column;
35
+ gap: 32px;
36
+ }
37
+
38
+ @media (min-width: 768px) {
39
+ .dew-left {
40
+ width: 340px;
41
+ border-bottom: none;
42
+ border-right: 1px solid var(--border-color);
43
+ }
44
+ }
45
+
46
+ .dew-right {
47
+ flex: 1;
48
+ background: var(--bg-page);
49
+ display: flex;
50
+ flex-direction: column;
51
+ align-items: center;
52
+ justify-content: center;
53
+ gap: 24px;
54
+ padding: 32px;
55
+ min-height: 360px;
56
+ }
57
+
58
+ .dew-field {
59
+ display: flex;
60
+ flex-direction: column;
61
+ gap: 12px;
62
+ }
63
+
64
+ .dew-field-top {
65
+ display: flex;
66
+ justify-content: space-between;
67
+ align-items: flex-end;
68
+ }
69
+
70
+ .dew-label {
71
+ font-size: 0.6875rem;
72
+ font-weight: 700;
73
+ text-transform: uppercase;
74
+ letter-spacing: 0.1em;
75
+ color: var(--dew-p);
76
+ }
77
+
78
+ .dew-val-display {
79
+ font-size: 2rem;
80
+ font-weight: 900;
81
+ color: var(--text-main);
82
+ line-height: 1;
83
+ }
84
+
85
+ .dew-unit {
86
+ font-size: 1rem;
87
+ font-weight: 400;
88
+ color: var(--text-muted);
89
+ }
90
+
91
+ .dew-slider {
92
+ width: 100%;
93
+ height: 6px;
94
+ accent-color: var(--dew-p);
95
+ cursor: pointer;
96
+ border-radius: 9999px;
97
+ }
98
+
99
+ .dew-steps {
100
+ display: flex;
101
+ gap: 8px;
102
+ }
103
+
104
+ .dew-step {
105
+ flex: 1;
106
+ padding: 8px;
107
+ border-radius: 10px;
108
+ border: 1px solid var(--border-color);
109
+ background: var(--bg-surface);
110
+ color: var(--text-main);
111
+ font-size: 1.25rem;
112
+ font-weight: 700;
113
+ cursor: pointer;
114
+ transition: all 0.15s;
115
+ }
116
+
117
+ .dew-step:hover {
118
+ border-color: var(--dew-p);
119
+ color: var(--dew-p);
120
+ }
121
+
122
+ .dew-result-section {
123
+ text-align: center;
124
+ }
125
+
126
+ .dew-result-label {
127
+ font-size: 0.6875rem;
128
+ font-weight: 700;
129
+ text-transform: uppercase;
130
+ letter-spacing: 0.15em;
131
+ color: var(--text-muted);
132
+ margin: 0 0 8px;
133
+ }
134
+
135
+ .dew-result-value {
136
+ font-size: 5rem;
137
+ font-weight: 900;
138
+ color: #06b6d4;
139
+ line-height: 1;
140
+ margin: 0;
141
+ }
142
+
143
+ .dew-result-unit {
144
+ font-size: 2.5rem;
145
+ font-weight: 300;
146
+ color: var(--text-muted);
147
+ }
148
+
149
+ .dew-risk-badge {
150
+ display: flex;
151
+ align-items: center;
152
+ gap: 10px;
153
+ padding: 12px 18px;
154
+ border-radius: 12px;
155
+ width: 100%;
156
+ max-width: 320px;
157
+ transition: background 0.3s;
158
+ }
159
+
160
+ .dew-risk-dot {
161
+ width: 10px;
162
+ height: 10px;
163
+ border-radius: 50%;
164
+ flex-shrink: 0;
165
+ }
166
+
167
+ .dew-risk-text {
168
+ display: flex;
169
+ flex-direction: column;
170
+ gap: 2px;
171
+ }
172
+
173
+ .dew-risk-name {
174
+ font-size: 0.875rem;
175
+ font-weight: 700;
176
+ }
177
+
178
+ .dew-risk-desc {
179
+ font-size: 0.6875rem;
180
+ opacity: 0.8;
181
+ }
182
+
183
+ .dew-risk-low {
184
+ background: rgba(34, 197, 94, 0.1);
185
+ border: 1px solid rgba(34, 197, 94, 0.2);
186
+ color: #4ade80;
187
+ }
188
+
189
+ .dew-risk-low .dew-risk-dot {
190
+ background: #22c55e;
191
+ }
192
+
193
+ .dew-risk-medium {
194
+ background: rgba(245, 158, 11, 0.1);
195
+ border: 1px solid rgba(245, 158, 11, 0.2);
196
+ color: #fbbf24;
197
+ }
198
+
199
+ .dew-risk-medium .dew-risk-dot {
200
+ background: #f59e0b;
201
+ }
202
+
203
+ .dew-risk-high {
204
+ background: rgba(249, 115, 22, 0.1);
205
+ border: 1px solid rgba(249, 115, 22, 0.2);
206
+ color: #fb923c;
207
+ }
208
+
209
+ .dew-risk-high .dew-risk-dot {
210
+ background: #f97316;
211
+ }
212
+
213
+ .dew-risk-extreme {
214
+ background: rgba(239, 68, 68, 0.1);
215
+ border: 1px solid rgba(239, 68, 68, 0.2);
216
+ color: #f87171;
217
+ }
218
+
219
+ .dew-risk-extreme .dew-risk-dot {
220
+ background: #ef4444;
221
+ }
222
+
223
+ .dew-gauge {
224
+ width: 100%;
225
+ max-width: 320px;
226
+ }
227
+
228
+ .dew-gauge-track {
229
+ fill: var(--bg-muted);
230
+ }