@jjlmoya/utils-cooking 1.8.0 → 1.10.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.
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  import { Icon } from 'astro-icon/components';
3
- import './IngredientRescaler.css';
4
3
 
5
4
  interface Props {
6
5
  ui: Record<string, string>;
@@ -105,3 +104,296 @@ ${ui.exampleLine4}`;
105
104
  init();
106
105
  }
107
106
  </script>
107
+
108
+ <style is:global>
109
+ :root {
110
+ --ir-primary: hsl(220deg, 90%, 56%);
111
+ --ir-primary-light: hsl(220deg, 90%, 92%);
112
+ --ir-bg-card: hsl(0deg, 0%, 100%);
113
+ --ir-bg-app: hsl(210deg, 20%, 98%);
114
+ --ir-border: hsl(210deg, 20%, 90%);
115
+ --ir-text-main: hsl(210deg, 30%, 20%);
116
+ --ir-text-muted: hsl(210deg, 15%, 50%);
117
+ --ir-shadow-lg: 0 10px 15px -3px rgb(0, 0, 0, 0.1);
118
+ --ir-radius: 1rem;
119
+ }
120
+
121
+ .theme-dark {
122
+ --ir-bg-card: hsl(220deg, 25%, 12%);
123
+ --ir-bg-app: hsl(220deg, 30%, 7%);
124
+ --ir-border: hsl(220deg, 20%, 20%);
125
+ --ir-text-main: hsl(210deg, 20%, 95%);
126
+ --ir-text-muted: hsl(210deg, 15%, 70%);
127
+ --ir-primary-light: hsl(220deg, 90%, 12%);
128
+ }
129
+ </style>
130
+
131
+ <style>
132
+ .ingredient-rescaler-container {
133
+ max-width: 100%;
134
+ padding: 1.5rem;
135
+ background: var(--ir-bg-card);
136
+ border: 1px solid var(--ir-border);
137
+ border-radius: var(--ir-radius);
138
+ box-shadow: var(--ir-shadow-lg);
139
+ }
140
+
141
+ .ir-grid {
142
+ display: grid;
143
+ grid-template-columns: 1fr;
144
+ gap: 2rem;
145
+ margin-bottom: 2rem;
146
+ }
147
+
148
+ @media (min-width: 768px) {
149
+ .ir-grid {
150
+ grid-template-columns: 1fr 1fr;
151
+ }
152
+ }
153
+
154
+ .ir-section {
155
+ background: var(--ir-bg-app);
156
+ padding: 1.5rem;
157
+ border-radius: 1.25rem;
158
+ border: 1px solid var(--ir-border);
159
+ }
160
+
161
+ .ir-section-primary {
162
+ background: var(--ir-bg-card);
163
+ border: 2px solid var(--ir-primary);
164
+ }
165
+
166
+ .ir-section-title {
167
+ font-size: 1.125rem;
168
+ font-weight: 700;
169
+ color: var(--ir-text-main);
170
+ margin-bottom: 1rem;
171
+ display: flex;
172
+ align-items: center;
173
+ gap: 0.5rem;
174
+ }
175
+
176
+ .ir-section-primary .ir-section-title {
177
+ color: var(--ir-primary);
178
+ }
179
+
180
+ .ir-fields {
181
+ display: grid;
182
+ grid-template-columns: 1fr 1fr;
183
+ gap: 1rem;
184
+ margin-bottom: 1.5rem;
185
+ }
186
+
187
+ .ir-field {
188
+ display: flex;
189
+ flex-direction: column;
190
+ gap: 0.5rem;
191
+ }
192
+
193
+ .ir-label {
194
+ font-size: 0.75rem;
195
+ font-weight: 700;
196
+ color: var(--ir-text-muted);
197
+ text-transform: uppercase;
198
+ letter-spacing: 0.05em;
199
+ }
200
+
201
+ .ir-input {
202
+ width: 100%;
203
+ padding: 0.75rem 1rem;
204
+ border-radius: 0.75rem;
205
+ border: 1px solid var(--ir-border);
206
+ background: var(--ir-bg-card);
207
+ color: var(--ir-text-main);
208
+ font-weight: 600;
209
+ font-size: 1.125rem;
210
+ text-align: center;
211
+ transition: all 0.3s ease;
212
+ }
213
+
214
+ .ir-input:focus {
215
+ outline: none;
216
+ border-color: var(--ir-primary);
217
+ box-shadow: 0 0 0 3px hsl(220deg, 90%, 56%, 0.1);
218
+ }
219
+
220
+ .ir-factor-display {
221
+ margin-top: 1rem;
222
+ padding: 1rem;
223
+ background: var(--ir-primary-light);
224
+ border-radius: 0.75rem;
225
+ border: 1px solid var(--ir-primary);
226
+ display: flex;
227
+ justify-content: space-between;
228
+ align-items: center;
229
+ }
230
+
231
+ .ir-factor-label {
232
+ font-size: 0.875rem;
233
+ font-weight: 600;
234
+ color: var(--ir-text-muted);
235
+ }
236
+
237
+ .ir-factor-value {
238
+ font-size: 2rem;
239
+ font-weight: 800;
240
+ color: var(--ir-primary);
241
+ }
242
+
243
+ .ir-textarea-container {
244
+ display: flex;
245
+ flex-direction: column;
246
+ height: 100%;
247
+ gap: 0.5rem;
248
+ }
249
+
250
+ .ir-textarea {
251
+ width: 100%;
252
+ flex: 1;
253
+ min-height: 200px;
254
+ padding: 1rem;
255
+ border-radius: 0.75rem;
256
+ border: 1px solid var(--ir-border);
257
+ background: var(--ir-bg-card);
258
+ color: var(--ir-text-main);
259
+ font-size: 0.875rem;
260
+ resize: none;
261
+ line-height: 1.6;
262
+ transition: all 0.3s ease;
263
+ }
264
+
265
+ .ir-textarea:focus {
266
+ outline: none;
267
+ border-color: var(--ir-primary);
268
+ box-shadow: 0 0 0 3px hsl(220deg, 90%, 56%, 0.1);
269
+ }
270
+
271
+ .ir-textarea::placeholder {
272
+ color: hsl(210deg, 15%, 75%);
273
+ }
274
+
275
+ .ir-results-card {
276
+ background: var(--ir-text-main);
277
+ border-radius: 1.25rem;
278
+ border: 1px solid var(--ir-border);
279
+ overflow: hidden;
280
+ box-shadow: var(--ir-shadow-lg);
281
+ }
282
+
283
+ .ir-results-header {
284
+ padding: 1rem 1.5rem;
285
+ background: hsl(210deg, 30%, 15%);
286
+ border-bottom: 1px solid hsl(210deg, 30%, 25%);
287
+ display: flex;
288
+ justify-content: space-between;
289
+ align-items: center;
290
+ }
291
+
292
+ :global(.theme-dark) .ir-results-header {
293
+ background: hsl(220deg, 25%, 8%);
294
+ border-bottom-color: hsl(220deg, 25%, 20%);
295
+ }
296
+
297
+ .ir-results-title {
298
+ color: var(--ir-bg-card);
299
+ font-weight: 700;
300
+ display: flex;
301
+ align-items: center;
302
+ gap: 0.5rem;
303
+ }
304
+
305
+ .ir-copy-btn {
306
+ font-size: 0.75rem;
307
+ background: hsl(210deg, 30%, 35%);
308
+ color: var(--ir-bg-card);
309
+ padding: 0.5rem 1rem;
310
+ border-radius: 0.5rem;
311
+ border: none;
312
+ cursor: pointer;
313
+ transition: all 0.3s ease;
314
+ font-weight: 600;
315
+ display: flex;
316
+ align-items: center;
317
+ gap: 0.5rem;
318
+ }
319
+
320
+ :global(.theme-dark) .ir-copy-btn {
321
+ background: hsl(220deg, 25%, 30%);
322
+ }
323
+
324
+ .ir-copy-btn:hover {
325
+ background: hsl(210deg, 30%, 45%);
326
+ }
327
+
328
+ :global(.theme-dark) .ir-copy-btn:hover {
329
+ background: hsl(220deg, 25%, 40%);
330
+ }
331
+
332
+ .ir-copy-btn.ir-copied {
333
+ background: hsl(142deg, 72%, 45%);
334
+ }
335
+
336
+ .ir-results-container {
337
+ padding: 2rem;
338
+ font-size: 1rem;
339
+ display: flex;
340
+ flex-direction: column;
341
+ gap: 0.75rem;
342
+ min-height: 200px;
343
+ background: var(--ir-bg-card);
344
+ color: var(--ir-text-main);
345
+ }
346
+
347
+ .ir-empty-state {
348
+ height: 100%;
349
+ display: flex;
350
+ flex-direction: column;
351
+ align-items: center;
352
+ justify-content: center;
353
+ gap: 1rem;
354
+ opacity: 0.5;
355
+ color: var(--ir-text-muted);
356
+ }
357
+
358
+ .ir-empty-icon {
359
+ width: 3rem;
360
+ height: 3rem;
361
+ }
362
+
363
+ .ir-result-row {
364
+ display: flex;
365
+ justify-content: space-between;
366
+ align-items: center;
367
+ background: var(--ir-bg-app);
368
+ padding: 0.75rem;
369
+ border-radius: 0.5rem;
370
+ border-left: 4px solid transparent;
371
+ transition: all 0.3s ease;
372
+ }
373
+
374
+ .ir-result-row:hover {
375
+ background: var(--ir-primary-light);
376
+ border-left-color: var(--ir-primary);
377
+ }
378
+
379
+ .ir-original-amount {
380
+ color: hsl(210deg, 15%, 75%);
381
+ font-size: 0.75rem;
382
+ text-decoration: line-through;
383
+ opacity: 0.75;
384
+ }
385
+
386
+ .ir-new-value {
387
+ color: var(--ir-primary);
388
+ font-weight: 800;
389
+ font-size: 1.125rem;
390
+ }
391
+
392
+ .ir-no-amount-row {
393
+ color: var(--ir-text-muted);
394
+ font-style: italic;
395
+ font-size: 0.875rem;
396
+ padding: 0.5rem;
397
+ background: transparent;
398
+ }
399
+ </style>
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  import { Icon } from "astro-icon/components";
3
- import "./KitchenTimer.css";
4
3
 
5
4
  interface Props {
6
5
  ui: Record<string, string>;
@@ -339,3 +338,329 @@ const { ui } = Astro.props;
339
338
  initKitchenTimers();
340
339
  }
341
340
  </script>
341
+
342
+ <style>
343
+ .kitchen-timer-wrapper {
344
+ --kt-primary: #ea580c;
345
+ --kt-secondary: #f97316;
346
+ --kt-bg: #fff;
347
+ --kt-bg-secondary: #f8fafc;
348
+ --kt-border: #e2e8f0;
349
+ --kt-text: #0f172a;
350
+ --kt-text-muted: #64748b;
351
+ --card-br: 1.5rem;
352
+ }
353
+
354
+ :global(.theme-dark) .kitchen-timer-wrapper {
355
+ --kt-primary: #fb923c;
356
+ --kt-secondary: #fdba74;
357
+ --kt-bg: #0f172a;
358
+ --kt-bg-secondary: #1e293b;
359
+ --kt-border: #334155;
360
+ --kt-text: #f8fafc;
361
+ --kt-text-muted: #94a3b8;
362
+ }
363
+
364
+ .kitchen-timer-master-card {
365
+ background: var(--kt-bg);
366
+ border: 1px solid var(--kt-border);
367
+ border-radius: var(--card-br);
368
+ box-shadow: var(--sc-shadow-lg);
369
+ overflow: hidden;
370
+ }
371
+
372
+ .timers-grid {
373
+ display: grid;
374
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
375
+ gap: 0;
376
+ }
377
+
378
+ .timer-card {
379
+ background: transparent;
380
+ border: none;
381
+ border-right: 1px solid var(--kt-border);
382
+ border-bottom: 1px solid var(--kt-border);
383
+ border-radius: 0;
384
+ position: relative;
385
+ overflow: hidden;
386
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
387
+ box-shadow: none;
388
+ }
389
+
390
+ .timer-card:hover {
391
+ transform: none;
392
+ background: var(--kt-bg-secondary);
393
+ }
394
+
395
+ .progress-bar {
396
+ position: absolute;
397
+ top: 0;
398
+ left: 0;
399
+ width: 100%;
400
+ height: 4px;
401
+ background: var(--kt-bg-secondary);
402
+ }
403
+
404
+ .progress-fill {
405
+ width: 100%;
406
+ height: 100%;
407
+ background: var(--kt-primary);
408
+ transform-origin: left;
409
+ transform: scaleX(0);
410
+ transition: transform 0.1s linear;
411
+ }
412
+
413
+ .timer-content {
414
+ padding: 1.5rem;
415
+ }
416
+
417
+ .timer-header {
418
+ display: flex;
419
+ justify-content: space-between;
420
+ align-items: center;
421
+ margin-bottom: 1.5rem;
422
+ }
423
+
424
+ .timer-name-wrapper {
425
+ flex: 1;
426
+ min-width: 0;
427
+ margin-right: 0.5rem;
428
+ }
429
+
430
+ .timer-name {
431
+ background: transparent;
432
+ border: none;
433
+ border-bottom: 2px solid transparent;
434
+ font-weight: 700;
435
+ font-size: 1.1rem;
436
+ color: var(--kt-text);
437
+ width: 100%;
438
+ outline: none;
439
+ transition: border-color 0.2s;
440
+ white-space: nowrap;
441
+ overflow: hidden;
442
+ text-overflow: ellipsis;
443
+ }
444
+
445
+ .timer-name:focus {
446
+ border-color: var(--kt-primary);
447
+ }
448
+
449
+ .status-badge {
450
+ padding: 0.25rem 0.75rem;
451
+ background: var(--kt-bg-secondary);
452
+ border-radius: 2rem;
453
+ font-size: 0.75rem;
454
+ font-weight: 700;
455
+ color: var(--kt-text-muted);
456
+ border: 1px solid var(--kt-border);
457
+ flex-shrink: 0;
458
+ }
459
+
460
+ .timer-display {
461
+ display: flex;
462
+ align-items: center;
463
+ justify-content: center;
464
+ gap: 1rem;
465
+ margin: 2rem 0;
466
+ }
467
+
468
+ .time-input-group {
469
+ display: flex;
470
+ flex-direction: column;
471
+ align-items: center;
472
+ gap: 0.5rem;
473
+ }
474
+
475
+ .time-input {
476
+ width: 80px;
477
+ background: var(--kt-bg-secondary);
478
+ border: 2px solid var(--kt-border);
479
+ border-radius: 1rem;
480
+ font-size: 2.5rem;
481
+ font-weight: 900;
482
+ text-align: center;
483
+ color: var(--kt-text);
484
+ padding: 0.5rem;
485
+ outline: none;
486
+ transition: all 0.2s;
487
+ }
488
+
489
+ .time-input:focus {
490
+ border-color: var(--kt-primary);
491
+ background: var(--kt-bg);
492
+ }
493
+
494
+ .time-label {
495
+ font-size: 0.65rem;
496
+ font-weight: 800;
497
+ text-transform: uppercase;
498
+ letter-spacing: 0.1em;
499
+ color: var(--kt-text-muted);
500
+ }
501
+
502
+ .time-separator {
503
+ font-size: 2rem;
504
+ font-weight: 900;
505
+ color: var(--kt-border);
506
+ margin-top: -1.5rem;
507
+ }
508
+
509
+ .timer-controls {
510
+ display: flex;
511
+ flex-direction: column;
512
+ gap: 1rem;
513
+ }
514
+
515
+ .timer-buttons {
516
+ display: grid;
517
+ grid-template-columns: 1fr 1fr;
518
+ gap: 0.75rem;
519
+ }
520
+
521
+ .btn-toggle, .btn-reset {
522
+ padding: 0.75rem;
523
+ border-radius: 1rem;
524
+ font-weight: 700;
525
+ cursor: pointer;
526
+ display: flex;
527
+ align-items: center;
528
+ justify-content: center;
529
+ gap: 0.5rem;
530
+ transition: all 0.2s;
531
+ border: none;
532
+ }
533
+
534
+ .btn-toggle {
535
+ background: var(--kt-primary);
536
+ color: var(--kt-bg);
537
+ }
538
+
539
+ .btn-toggle:hover:not(:disabled) {
540
+ background: var(--kt-secondary);
541
+ transform: scale(1.02);
542
+ }
543
+
544
+ .btn-toggle:disabled {
545
+ opacity: 0.5;
546
+ cursor: not-allowed;
547
+ }
548
+
549
+ .btn-reset {
550
+ background: var(--kt-bg-secondary);
551
+ color: var(--kt-text);
552
+ border: 1px solid var(--kt-border);
553
+ }
554
+
555
+ .btn-reset:hover {
556
+ border-color: var(--kt-primary);
557
+ }
558
+
559
+ .timer-quick-buttons {
560
+ display: flex;
561
+ gap: 0.5rem;
562
+ }
563
+
564
+ .timer-quick-buttons button {
565
+ flex: 1;
566
+ padding: 0.5rem;
567
+ border-radius: 0.75rem;
568
+ background: var(--kt-bg-secondary);
569
+ border: 1px solid var(--kt-border);
570
+ font-size: 0.8rem;
571
+ font-weight: 600;
572
+ color: var(--kt-text-muted);
573
+ cursor: pointer;
574
+ transition: all 0.2s;
575
+ }
576
+
577
+ .timer-quick-buttons button:hover {
578
+ color: var(--kt-primary);
579
+ border-color: var(--kt-primary);
580
+ }
581
+
582
+ .add-timer-container {
583
+ padding: 1.5rem 2.5rem;
584
+ display: flex;
585
+ align-items: center;
586
+ justify-content: space-between;
587
+ background: var(--kt-bg-secondary);
588
+ border-top: 1px solid var(--kt-border);
589
+ gap: 1.5rem;
590
+ }
591
+
592
+ .add-timer-btn {
593
+ background: var(--kt-primary);
594
+ border: none;
595
+ border-radius: 1rem;
596
+ width: auto;
597
+ padding: 0.75rem 2rem;
598
+ height: auto;
599
+ display: flex;
600
+ flex-direction: row;
601
+ align-items: center;
602
+ justify-content: center;
603
+ gap: 0.75rem;
604
+ color: var(--kt-bg);
605
+ font-weight: 700;
606
+ font-size: 1rem;
607
+ cursor: pointer;
608
+ transition: all 0.2s;
609
+ box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.2);
610
+ }
611
+
612
+ .add-timer-btn:hover {
613
+ background: var(--kt-secondary);
614
+ transform: translateY(-2px);
615
+ box-shadow: 0 10px 15px -3px rgba(234, 88, 12, 0.3);
616
+ }
617
+
618
+ .add-timer-icon {
619
+ font-size: 1.25rem;
620
+ display: flex;
621
+ align-items: center;
622
+ }
623
+
624
+ .stop-all-container {
625
+ flex-shrink: 0;
626
+ }
627
+
628
+ .stop-all-btn {
629
+ background: #1e293b;
630
+ padding: 0.75rem 1.5rem;
631
+ border-radius: 1rem;
632
+ color: var(--kt-bg);
633
+ border: 1px solid rgba(255, 255, 255, 0.1);
634
+ font-weight: 700;
635
+ font-size: 0.9rem;
636
+ display: flex;
637
+ align-items: center;
638
+ gap: 0.5rem;
639
+ cursor: pointer;
640
+ transition: all 0.2s;
641
+ }
642
+
643
+ .stop-all-btn:hover {
644
+ background: #000;
645
+ transform: translateY(-2px);
646
+ }
647
+
648
+ .timer-card.finished {
649
+ animation: pulse-border 1.5s infinite;
650
+ }
651
+
652
+ @keyframes pulse-border {
653
+ 0% {
654
+ border-color: var(--kt-primary);
655
+ box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.4);
656
+ }
657
+ 70% {
658
+ border-color: var(--kt-secondary);
659
+ box-shadow: 0 0 0 15px rgba(234, 88, 12, 0);
660
+ }
661
+ 100% {
662
+ border-color: var(--kt-primary);
663
+ box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
664
+ }
665
+ }
666
+ </style>