@jjlmoya/utils-nature 1.11.0 → 1.13.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.
@@ -130,344 +130,6 @@ const materialNames: Record<string, string> = {
130
130
  </div>
131
131
  </rain-harvester>
132
132
 
133
- <style>
134
- .rh-wrap {
135
- --rh-bg: #fff;
136
- --rh-bg-inputs: #f8fafc;
137
- --rh-border: #e2e8f0;
138
- --rh-text: #1e293b;
139
- --rh-text-muted: #64748b;
140
- --rh-accent: #06b6d4;
141
- --rh-accent-dark: #0891b2;
142
- --rh-result-bg: linear-gradient(135deg, #06b6d4, #2563eb);
143
- --rh-info-bg: #f0f9ff;
144
- --rh-info-border: #bae6fd;
145
- --rh-info-text: #0369a1;
146
-
147
- display: block;
148
- max-width: 72rem;
149
- margin: 0 auto;
150
- padding: 1rem;
151
- user-select: none;
152
- }
153
-
154
- :global(.theme-dark) .rh-wrap {
155
- --rh-bg: #0f172a;
156
- --rh-bg-inputs: #1e293b;
157
- --rh-border: #334155;
158
- --rh-text: #f1f5f9;
159
- --rh-text-muted: #94a3b8;
160
- --rh-info-bg: rgba(3, 105, 161, 0.1);
161
- --rh-info-border: #0369a1;
162
- --rh-info-text: #7dd3fc;
163
- }
164
-
165
- .rh-container {
166
- display: grid;
167
- grid-template-columns: 1fr;
168
- background: var(--rh-bg);
169
- border-radius: 2rem;
170
- overflow: hidden;
171
- border: 1px solid var(--rh-border);
172
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
173
- }
174
-
175
- @media (min-width: 1024px) {
176
- .rh-container {
177
- grid-template-columns: 1fr 1fr;
178
- }
179
- }
180
-
181
- .rh-inputs {
182
- padding: 2.5rem;
183
- background: var(--rh-bg-inputs);
184
- }
185
-
186
- .rh-section-head {
187
- font-size: 1.25rem;
188
- font-weight: 800;
189
- color: var(--rh-text);
190
- display: flex;
191
- align-items: center;
192
- gap: 0.75rem;
193
- margin-bottom: 2rem;
194
- text-transform: uppercase;
195
- letter-spacing: 0.05em;
196
- }
197
-
198
- .rh-step-badge {
199
- width: 2.25rem;
200
- height: 2.25rem;
201
- background: var(--rh-text);
202
- color: var(--rh-bg);
203
- border-radius: 50%;
204
- display: flex;
205
- align-items: center;
206
- justify-content: center;
207
- font-size: 1rem;
208
- font-weight: 900;
209
- }
210
-
211
- .rh-field-group {
212
- display: flex;
213
- flex-direction: column;
214
- gap: 1.5rem;
215
- margin-bottom: 2rem;
216
- }
217
-
218
- .rh-field {
219
- display: flex;
220
- flex-direction: column;
221
- gap: 0.5rem;
222
- }
223
-
224
- .rh-label {
225
- font-size: 0.75rem;
226
- font-weight: 700;
227
- text-transform: uppercase;
228
- color: var(--rh-text-muted);
229
- letter-spacing: 0.05em;
230
- display: flex;
231
- align-items: center;
232
- gap: 0.5rem;
233
- }
234
-
235
- .rh-label-icon {
236
- font-size: 1.25rem;
237
- color: var(--rh-accent);
238
- }
239
-
240
- .rh-input-wrap, .rh-select-wrap {
241
- position: relative;
242
- }
243
-
244
- .rh-input, .rh-select {
245
- width: 100%;
246
- background: var(--rh-bg);
247
- border: 2px solid var(--rh-border);
248
- border-radius: 1rem;
249
- padding: 0.875rem 1rem;
250
- font-size: 1.5rem;
251
- font-weight: 700;
252
- color: var(--rh-text);
253
- transition: border-color 0.2s;
254
- outline: none;
255
- }
256
-
257
- .rh-select {
258
- font-size: 1.125rem;
259
- cursor: pointer;
260
- appearance: none;
261
- }
262
-
263
- .rh-input:focus, .rh-select:focus {
264
- border-color: var(--rh-accent);
265
- }
266
-
267
- .rh-input-suffix {
268
- position: absolute;
269
- right: 1.25rem;
270
- top: 50%;
271
- transform: translateY(-50%);
272
- font-weight: 700;
273
- color: var(--rh-text-muted);
274
- pointer-events: none;
275
- }
276
-
277
- .rh-field-help {
278
- font-size: 0.75rem;
279
- font-style: italic;
280
- color: var(--rh-text-muted);
281
- }
282
-
283
- .rh-select-arrow {
284
- position: absolute;
285
- right: 1.25rem;
286
- top: 50%;
287
- transform: translateY(-50%);
288
- font-size: 1.5rem;
289
- color: var(--rh-text-muted);
290
- pointer-events: none;
291
- }
292
-
293
- .rh-info-card {
294
- background: var(--rh-info-bg);
295
- border: 1px solid var(--rh-info-border);
296
- border-radius: 1.25rem;
297
- padding: 1.25rem;
298
- display: flex;
299
- gap: 1rem;
300
- align-items: center;
301
- }
302
-
303
- .rh-info-icon-box {
304
- background: var(--rh-info-border);
305
- color: var(--rh-info-text);
306
- padding: 0.75rem;
307
- border-radius: 0.75rem;
308
- display: flex;
309
- }
310
-
311
- .rh-info-icon {
312
- font-size: 1.5rem;
313
- }
314
-
315
- .rh-info-title {
316
- margin: 0;
317
- font-weight: 800;
318
- color: var(--rh-info-text);
319
- font-size: 0.875rem;
320
- }
321
-
322
- .rh-info-text {
323
- margin: 0.25rem 0 0;
324
- font-size: 0.75rem;
325
- color: var(--rh-info-text);
326
- opacity: 0.9;
327
- }
328
-
329
- .rh-results {
330
- background: var(--rh-result-bg);
331
- padding: 2.5rem;
332
- color: #fff;
333
- display: flex;
334
- flex-direction: column;
335
- justify-content: space-between;
336
- position: relative;
337
- overflow: hidden;
338
- }
339
-
340
- .rh-result-main {
341
- position: relative;
342
- z-index: 10;
343
- }
344
-
345
- .rh-result-label {
346
- font-size: 0.875rem;
347
- font-weight: 700;
348
- text-transform: uppercase;
349
- letter-spacing: 0.1em;
350
- color: rgba(255, 255, 255, 0.8);
351
- margin: 0 0 0.5rem;
352
- }
353
-
354
- .rh-result-value-box {
355
- display: flex;
356
- align-items: baseline;
357
- gap: 0.5rem;
358
- }
359
-
360
- .rh-result-big {
361
- font-size: 5rem;
362
- font-weight: 900;
363
- letter-spacing: -0.05em;
364
- line-height: 1;
365
- }
366
-
367
- .rh-result-unit {
368
- font-size: 1.5rem;
369
- font-weight: 700;
370
- color: rgba(255, 255, 255, 0.8);
371
- }
372
-
373
- .rh-equivalencies {
374
- position: relative;
375
- z-index: 10;
376
- margin-top: 2rem;
377
- }
378
-
379
- .rh-equiv-title {
380
- font-size: 1rem;
381
- font-weight: 800;
382
- margin: 0 0 1.25rem;
383
- padding-bottom: 0.75rem;
384
- border-bottom: 1px solid rgba(255, 255, 255, 0.2);
385
- }
386
-
387
- .rh-equiv-grid {
388
- display: flex;
389
- flex-direction: column;
390
- gap: 1rem;
391
- }
392
-
393
- .rh-equiv-card {
394
- background: rgba(255, 255, 255, 0.1);
395
- backdrop-filter: blur(8px);
396
- border: 1px solid rgba(255, 255, 255, 0.2);
397
- border-radius: 1rem;
398
- padding: 1rem;
399
- display: flex;
400
- align-items: center;
401
- gap: 1rem;
402
- }
403
-
404
- .rh-equiv-icon {
405
- font-size: 2rem;
406
- color: rgba(255, 255, 255, 0.9);
407
- }
408
-
409
- .rh-equiv-info {
410
- display: flex;
411
- flex-direction: column;
412
- }
413
-
414
- .rh-equiv-val {
415
- font-size: 1.5rem;
416
- font-weight: 800;
417
- line-height: 1;
418
- }
419
-
420
- .rh-equiv-label {
421
- font-size: 0.65rem;
422
- text-transform: uppercase;
423
- font-weight: 700;
424
- margin-top: 0.25rem;
425
- color: rgba(255, 255, 255, 0.7);
426
- }
427
-
428
- .rh-bg-icon {
429
- position: absolute;
430
- bottom: -2rem;
431
- right: -2rem;
432
- font-size: 15rem;
433
- opacity: 0.1;
434
- pointer-events: none;
435
- z-index: 1;
436
- }
437
-
438
- .rh-liquid-container {
439
- position: absolute;
440
- inset: 0;
441
- z-index: 0;
442
- pointer-events: none;
443
- }
444
-
445
- .rh-liquid-fill {
446
- position: absolute;
447
- bottom: 0;
448
- left: 0;
449
- width: 100%;
450
- background: rgba(255, 255, 255, 0.1);
451
- transition: height 1s ease-in-out;
452
- height: 0;
453
- }
454
-
455
- .rh-liquid-wave {
456
- position: absolute;
457
- top: -0.5rem;
458
- left: 0;
459
- width: 100%;
460
- height: 1rem;
461
- background: rgba(255, 255, 255, 0.15);
462
- transform: skewY(1deg);
463
- animation: rh-wave 3s infinite alternate ease-in-out;
464
- }
465
-
466
- @keyframes rh-wave {
467
- from { transform: skewY(1deg); }
468
- to { transform: skewY(-1deg); }
469
- }
470
- </style>
471
133
 
472
134
  <script>
473
135
  class RainHarvester extends HTMLElement {
@@ -0,0 +1,336 @@
1
+ .rh-wrap {
2
+ --rh-bg: #fff;
3
+ --rh-bg-inputs: #f8fafc;
4
+ --rh-border: #e2e8f0;
5
+ --rh-text: #1e293b;
6
+ --rh-text-muted: #64748b;
7
+ --rh-accent: #06b6d4;
8
+ --rh-accent-dark: #0891b2;
9
+ --rh-result-bg: linear-gradient(135deg, #06b6d4, #2563eb);
10
+ --rh-info-bg: #f0f9ff;
11
+ --rh-info-border: #bae6fd;
12
+ --rh-info-text: #0369a1;
13
+
14
+ display: block;
15
+ max-width: 72rem;
16
+ margin: 0 auto;
17
+ padding: 1rem;
18
+ user-select: none;
19
+ }
20
+
21
+ .theme-dark .rh-wrap {
22
+ --rh-bg: #0f172a;
23
+ --rh-bg-inputs: #1e293b;
24
+ --rh-border: #334155;
25
+ --rh-text: #f1f5f9;
26
+ --rh-text-muted: #94a3b8;
27
+ --rh-info-bg: rgba(3, 105, 161, 0.1);
28
+ --rh-info-border: #0369a1;
29
+ --rh-info-text: #7dd3fc;
30
+ }
31
+
32
+ .rh-container {
33
+ display: grid;
34
+ grid-template-columns: 1fr;
35
+ background: var(--rh-bg);
36
+ border-radius: 2rem;
37
+ overflow: hidden;
38
+ border: 1px solid var(--rh-border);
39
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
40
+ }
41
+
42
+ @media (min-width: 1024px) {
43
+ .rh-container {
44
+ grid-template-columns: 1fr 1fr;
45
+ }
46
+ }
47
+
48
+ .rh-inputs {
49
+ padding: 2.5rem;
50
+ background: var(--rh-bg-inputs);
51
+ }
52
+
53
+ .rh-section-head {
54
+ font-size: 1.25rem;
55
+ font-weight: 800;
56
+ color: var(--rh-text);
57
+ display: flex;
58
+ align-items: center;
59
+ gap: 0.75rem;
60
+ margin-bottom: 2rem;
61
+ text-transform: uppercase;
62
+ letter-spacing: 0.05em;
63
+ }
64
+
65
+ .rh-step-badge {
66
+ width: 2.25rem;
67
+ height: 2.25rem;
68
+ background: var(--rh-text);
69
+ color: var(--rh-bg);
70
+ border-radius: 50%;
71
+ display: flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ font-size: 1rem;
75
+ font-weight: 900;
76
+ }
77
+
78
+ .rh-field-group {
79
+ display: flex;
80
+ flex-direction: column;
81
+ gap: 1.5rem;
82
+ margin-bottom: 2rem;
83
+ }
84
+
85
+ .rh-field {
86
+ display: flex;
87
+ flex-direction: column;
88
+ gap: 0.5rem;
89
+ }
90
+
91
+ .rh-label {
92
+ font-size: 0.75rem;
93
+ font-weight: 700;
94
+ text-transform: uppercase;
95
+ color: var(--rh-text-muted);
96
+ letter-spacing: 0.05em;
97
+ display: flex;
98
+ align-items: center;
99
+ gap: 0.5rem;
100
+ }
101
+
102
+ .rh-label-icon {
103
+ font-size: 1.25rem;
104
+ color: var(--rh-accent);
105
+ }
106
+
107
+ .rh-input-wrap, .rh-select-wrap {
108
+ position: relative;
109
+ }
110
+
111
+ .rh-input, .rh-select {
112
+ width: 100%;
113
+ background: var(--rh-bg);
114
+ border: 2px solid var(--rh-border);
115
+ border-radius: 1rem;
116
+ padding: 0.875rem 1rem;
117
+ font-size: 1.5rem;
118
+ font-weight: 700;
119
+ color: var(--rh-text);
120
+ transition: border-color 0.2s;
121
+ outline: none;
122
+ }
123
+
124
+ .rh-select {
125
+ font-size: 1.125rem;
126
+ cursor: pointer;
127
+ appearance: none;
128
+ }
129
+
130
+ .rh-input:focus, .rh-select:focus {
131
+ border-color: var(--rh-accent);
132
+ }
133
+
134
+ .rh-input-suffix {
135
+ position: absolute;
136
+ right: 1.25rem;
137
+ top: 50%;
138
+ transform: translateY(-50%);
139
+ font-weight: 700;
140
+ color: var(--rh-text-muted);
141
+ pointer-events: none;
142
+ }
143
+
144
+ .rh-field-help {
145
+ font-size: 0.75rem;
146
+ font-style: italic;
147
+ color: var(--rh-text-muted);
148
+ }
149
+
150
+ .rh-select-arrow {
151
+ position: absolute;
152
+ right: 1.25rem;
153
+ top: 50%;
154
+ transform: translateY(-50%);
155
+ font-size: 1.5rem;
156
+ color: var(--rh-text-muted);
157
+ pointer-events: none;
158
+ }
159
+
160
+ .rh-info-card {
161
+ background: var(--rh-info-bg);
162
+ border: 1px solid var(--rh-info-border);
163
+ border-radius: 1.25rem;
164
+ padding: 1.25rem;
165
+ display: flex;
166
+ gap: 1rem;
167
+ align-items: center;
168
+ }
169
+
170
+ .rh-info-icon-box {
171
+ background: var(--rh-info-border);
172
+ color: var(--rh-info-text);
173
+ padding: 0.75rem;
174
+ border-radius: 0.75rem;
175
+ display: flex;
176
+ }
177
+
178
+ .rh-info-icon {
179
+ font-size: 1.5rem;
180
+ }
181
+
182
+ .rh-info-title {
183
+ margin: 0;
184
+ font-weight: 800;
185
+ color: var(--rh-info-text);
186
+ font-size: 0.875rem;
187
+ }
188
+
189
+ .rh-info-text {
190
+ margin: 0.25rem 0 0;
191
+ font-size: 0.75rem;
192
+ color: var(--rh-info-text);
193
+ opacity: 0.9;
194
+ }
195
+
196
+ .rh-results {
197
+ background: var(--rh-result-bg);
198
+ padding: 2.5rem;
199
+ color: #fff;
200
+ display: flex;
201
+ flex-direction: column;
202
+ justify-content: space-between;
203
+ position: relative;
204
+ overflow: hidden;
205
+ }
206
+
207
+ .rh-result-main {
208
+ position: relative;
209
+ z-index: 10;
210
+ }
211
+
212
+ .rh-result-label {
213
+ font-size: 0.875rem;
214
+ font-weight: 700;
215
+ text-transform: uppercase;
216
+ letter-spacing: 0.1em;
217
+ color: rgba(255, 255, 255, 0.8);
218
+ margin: 0 0 0.5rem;
219
+ }
220
+
221
+ .rh-result-value-box {
222
+ display: flex;
223
+ align-items: baseline;
224
+ gap: 0.5rem;
225
+ }
226
+
227
+ .rh-result-big {
228
+ font-size: 5rem;
229
+ font-weight: 900;
230
+ letter-spacing: -0.05em;
231
+ line-height: 1;
232
+ }
233
+
234
+ .rh-result-unit {
235
+ font-size: 1.5rem;
236
+ font-weight: 700;
237
+ color: rgba(255, 255, 255, 0.8);
238
+ }
239
+
240
+ .rh-equivalencies {
241
+ position: relative;
242
+ z-index: 10;
243
+ margin-top: 2rem;
244
+ }
245
+
246
+ .rh-equiv-title {
247
+ font-size: 1rem;
248
+ font-weight: 800;
249
+ margin: 0 0 1.25rem;
250
+ padding-bottom: 0.75rem;
251
+ border-bottom: 1px solid rgba(255, 255, 255, 0.2);
252
+ }
253
+
254
+ .rh-equiv-grid {
255
+ display: flex;
256
+ flex-direction: column;
257
+ gap: 1rem;
258
+ }
259
+
260
+ .rh-equiv-card {
261
+ background: rgba(255, 255, 255, 0.1);
262
+ backdrop-filter: blur(8px);
263
+ border: 1px solid rgba(255, 255, 255, 0.2);
264
+ border-radius: 1rem;
265
+ padding: 1rem;
266
+ display: flex;
267
+ align-items: center;
268
+ gap: 1rem;
269
+ }
270
+
271
+ .rh-equiv-icon {
272
+ font-size: 2rem;
273
+ color: rgba(255, 255, 255, 0.9);
274
+ }
275
+
276
+ .rh-equiv-info {
277
+ display: flex;
278
+ flex-direction: column;
279
+ }
280
+
281
+ .rh-equiv-val {
282
+ font-size: 1.5rem;
283
+ font-weight: 800;
284
+ line-height: 1;
285
+ }
286
+
287
+ .rh-equiv-label {
288
+ font-size: 0.65rem;
289
+ text-transform: uppercase;
290
+ font-weight: 700;
291
+ margin-top: 0.25rem;
292
+ color: rgba(255, 255, 255, 0.7);
293
+ }
294
+
295
+ .rh-bg-icon {
296
+ position: absolute;
297
+ bottom: -2rem;
298
+ right: -2rem;
299
+ font-size: 15rem;
300
+ opacity: 0.1;
301
+ pointer-events: none;
302
+ z-index: 1;
303
+ }
304
+
305
+ .rh-liquid-container {
306
+ position: absolute;
307
+ inset: 0;
308
+ z-index: 0;
309
+ pointer-events: none;
310
+ }
311
+
312
+ .rh-liquid-fill {
313
+ position: absolute;
314
+ bottom: 0;
315
+ left: 0;
316
+ width: 100%;
317
+ background: rgba(255, 255, 255, 0.1);
318
+ transition: height 1s ease-in-out;
319
+ height: 0;
320
+ }
321
+
322
+ .rh-liquid-wave {
323
+ position: absolute;
324
+ top: -0.5rem;
325
+ left: 0;
326
+ width: 100%;
327
+ height: 1rem;
328
+ background: rgba(255, 255, 255, 0.15);
329
+ transform: skewY(1deg);
330
+ animation: rh-wave 3s infinite alternate ease-in-out;
331
+ }
332
+
333
+ @keyframes rh-wave {
334
+ from { transform: skewY(1deg); }
335
+ to { transform: skewY(-1deg); }
336
+ }