@jjlmoya/utils-audiovisual 1.3.0 → 1.5.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,5 +1,4 @@
1
1
  ---
2
- import './style.css';
3
2
  ---
4
3
 
5
4
  <div class="ic-dashboard" id="image-compressor-root">
@@ -260,3 +259,502 @@ import './style.css';
260
259
  });
261
260
  });
262
261
  </script>
262
+
263
+ <style>
264
+ .ic-dashboard {
265
+ max-width: 900px;
266
+ margin: 0 auto;
267
+ display: flex;
268
+ flex-direction: column;
269
+ gap: 1rem;
270
+
271
+ --ic-bg: #fff;
272
+ --ic-bg-muted: #f8fafc;
273
+ --ic-border: #e2e8f0;
274
+ --ic-text: #111827;
275
+ --ic-text-muted: #6b7280;
276
+ --ic-accent: #10b981;
277
+ --ic-accent-dark: #059669;
278
+ --ic-accent-light: #f0fdf4;
279
+ --ic-success: #10b981;
280
+ --ic-error: #ef4444;
281
+ --ic-error-dark: #dc2626;
282
+ --ic-warning: #f59e0b;
283
+ --ic-shadow: rgba(0, 0, 0, 0.03);
284
+ }
285
+
286
+ :global(.theme-dark) .ic-dashboard {
287
+ --ic-bg: #0f172a;
288
+ --ic-bg-muted: #1e293b;
289
+ --ic-border: #334155;
290
+ --ic-text: #f1f5f9;
291
+ --ic-text-muted: #cbd5e1;
292
+ --ic-accent: #10b981;
293
+ --ic-accent-dark: #059669;
294
+ --ic-accent-light: rgba(16, 185, 129, 0.1);
295
+ --ic-shadow: rgba(0, 0, 0, 0.4);
296
+ }
297
+
298
+ .ic-global-settings {
299
+ display: flex;
300
+ justify-content: flex-end;
301
+ gap: 1.5rem;
302
+ background: rgba(255, 255, 255, 0.5);
303
+ backdrop-filter: blur(8px);
304
+ padding: 0.75rem 1.5rem;
305
+ border-radius: 0.75rem;
306
+ border: 1px solid rgba(255, 255, 255, 0.35);
307
+ color: #374151;
308
+ flex-wrap: wrap;
309
+ }
310
+
311
+ :global(.theme-dark) .ic-global-settings {
312
+ background: rgba(30, 41, 59, 0.6);
313
+ border-color: rgba(71, 85, 105, 0.5);
314
+ color: var(--ic-text-muted);
315
+ }
316
+
317
+ .ic-toggle-group {
318
+ display: flex;
319
+ align-items: center;
320
+ gap: 0.5rem;
321
+ }
322
+
323
+ .ic-webp-switch {
324
+ position: relative;
325
+ display: inline-block;
326
+ width: 44px;
327
+ height: 24px;
328
+ }
329
+
330
+ .ic-webp-switch input {
331
+ opacity: 0;
332
+ width: 0;
333
+ height: 0;
334
+ }
335
+
336
+ .ic-webp-slider {
337
+ position: absolute;
338
+ cursor: pointer;
339
+ inset: 0;
340
+ background: var(--ic-border);
341
+ border-radius: 24px;
342
+ transition: 0.3s;
343
+ }
344
+
345
+ .ic-webp-slider::before {
346
+ content: '';
347
+ position: absolute;
348
+ width: 18px;
349
+ height: 18px;
350
+ left: 3px;
351
+ bottom: 3px;
352
+ background: var(--ic-bg);
353
+ border-radius: 50%;
354
+ transition: 0.3s;
355
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
356
+ }
357
+
358
+ .ic-webp-switch input:checked + .ic-webp-slider {
359
+ background: var(--ic-accent);
360
+ }
361
+
362
+ .ic-webp-switch input:checked + .ic-webp-slider::before {
363
+ transform: translateX(20px);
364
+ }
365
+
366
+ .ic-toggle-label {
367
+ font-size: 0.9rem;
368
+ font-weight: 600;
369
+ }
370
+
371
+ .ic-settings-group {
372
+ display: flex;
373
+ align-items: center;
374
+ gap: 0.75rem;
375
+ font-size: 0.9rem;
376
+ font-weight: 600;
377
+ }
378
+
379
+ .ic-mini-slider {
380
+ width: 100px;
381
+ accent-color: var(--ic-accent);
382
+ }
383
+
384
+ .ic-drop-zone {
385
+ position: relative;
386
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.45) 100%);
387
+ border: 3px dashed var(--ic-accent);
388
+ border-radius: 1.5rem;
389
+ padding: 4rem 2rem;
390
+ text-align: center;
391
+ cursor: pointer;
392
+ transition: all 0.3s ease;
393
+ backdrop-filter: blur(12px);
394
+ box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
395
+ }
396
+
397
+ :global(.theme-dark) .ic-drop-zone {
398
+ background: linear-gradient(180deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.6) 100%);
399
+ }
400
+
401
+ .ic-drop-zone.ic-dragover,
402
+ .ic-drop-zone:hover {
403
+ transform: scale(1.01);
404
+ border-color: var(--ic-accent-dark);
405
+ background: linear-gradient(180deg, var(--ic-accent-light) 0%, rgba(255, 255, 255, 0.6) 100%);
406
+ }
407
+
408
+ :global(.theme-dark) .ic-drop-zone.ic-dragover,
409
+ :global(.theme-dark) .ic-drop-zone:hover {
410
+ background: linear-gradient(180deg, rgba(6, 78, 59, 0.4) 0%, rgba(15, 23, 42, 0.6) 100%);
411
+ }
412
+
413
+ .ic-file-label {
414
+ display: flex;
415
+ flex-direction: column;
416
+ align-items: center;
417
+ gap: 0.5rem;
418
+ cursor: pointer;
419
+ pointer-events: none;
420
+ }
421
+
422
+ .ic-upload-icon {
423
+ color: var(--ic-accent);
424
+ margin-bottom: 0.5rem;
425
+ }
426
+
427
+ .ic-upload-text {
428
+ font-size: 1.5rem;
429
+ font-weight: 700;
430
+ color: var(--ic-text);
431
+ }
432
+
433
+ .ic-upload-subtext {
434
+ color: var(--ic-text-muted);
435
+ font-size: 1rem;
436
+ margin-bottom: 1rem;
437
+ }
438
+
439
+ .ic-upload-btn {
440
+ background: var(--ic-text);
441
+ color: var(--ic-bg);
442
+ padding: 0.75rem 2rem;
443
+ border-radius: 9999px;
444
+ font-weight: 600;
445
+ font-size: 0.95rem;
446
+ pointer-events: auto;
447
+ transition: background 0.2s;
448
+ }
449
+
450
+ .ic-upload-btn:hover {
451
+ background: var(--ic-text-muted);
452
+ }
453
+
454
+ .ic-drop-zone input[type="file"] {
455
+ position: absolute;
456
+ inset: 0;
457
+ width: 100%;
458
+ height: 100%;
459
+ opacity: 0;
460
+ cursor: pointer;
461
+ }
462
+
463
+ .ic-file-list-container {
464
+ margin-top: 1.5rem;
465
+ }
466
+
467
+ .ic-list-header {
468
+ display: flex;
469
+ justify-content: space-between;
470
+ align-items: center;
471
+ margin-bottom: 1rem;
472
+ padding: 0 0.5rem;
473
+ }
474
+
475
+ .ic-list-header h3 {
476
+ font-size: 1.25rem;
477
+ font-weight: 700;
478
+ color: var(--ic-text);
479
+ margin: 0;
480
+ }
481
+
482
+ .ic-total-savings {
483
+ font-weight: 700;
484
+ font-size: 1rem;
485
+ }
486
+
487
+ .ic-file-list {
488
+ list-style: none;
489
+ padding: 1rem;
490
+ margin: 0;
491
+ display: flex;
492
+ flex-direction: column;
493
+ gap: 0.75rem;
494
+ background: var(--ic-bg-muted);
495
+ border-radius: 1rem;
496
+ border: 1px solid var(--ic-border);
497
+ }
498
+
499
+ .ic-file-item {
500
+ background: var(--ic-bg);
501
+ border-radius: 0.75rem;
502
+ padding: 0.75rem 1.25rem;
503
+ display: grid;
504
+ grid-template-columns: 2fr 2.5rem 2fr;
505
+ align-items: center;
506
+ gap: 1rem;
507
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
508
+ transition: box-shadow 0.2s;
509
+ }
510
+
511
+ .ic-file-item:hover {
512
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
513
+ }
514
+
515
+ .ic-preview-col {
516
+ display: flex;
517
+ align-items: center;
518
+ gap: 1rem;
519
+ overflow: hidden;
520
+ }
521
+
522
+ .ic-preview-wrapper {
523
+ width: 48px;
524
+ height: 48px;
525
+ border-radius: 0.5rem;
526
+ overflow: hidden;
527
+ background: var(--ic-bg-muted);
528
+ flex-shrink: 0;
529
+ }
530
+
531
+ .ic-preview-img {
532
+ width: 100%;
533
+ height: 100%;
534
+ object-fit: cover;
535
+ }
536
+
537
+ .ic-file-info {
538
+ display: flex;
539
+ flex-direction: column;
540
+ overflow: hidden;
541
+ }
542
+
543
+ .ic-filename {
544
+ font-weight: 600;
545
+ color: var(--ic-text);
546
+ white-space: nowrap;
547
+ overflow: hidden;
548
+ text-overflow: ellipsis;
549
+ font-size: 0.9rem;
550
+ }
551
+
552
+ .ic-orig-size {
553
+ color: var(--ic-text-muted);
554
+ font-size: 0.8rem;
555
+ }
556
+
557
+ .ic-arrow-col {
558
+ display: flex;
559
+ justify-content: center;
560
+ }
561
+
562
+ .ic-arrow-circle {
563
+ background: var(--ic-accent-light);
564
+ color: var(--ic-accent);
565
+ width: 36px;
566
+ height: 36px;
567
+ border-radius: 50%;
568
+ display: flex;
569
+ align-items: center;
570
+ justify-content: center;
571
+ flex-shrink: 0;
572
+ }
573
+
574
+ .ic-result-col {
575
+ display: flex;
576
+ align-items: center;
577
+ justify-content: flex-end;
578
+ gap: 1.25rem;
579
+ }
580
+
581
+ .ic-savings-pill {
582
+ display: flex;
583
+ flex-direction: column;
584
+ align-items: center;
585
+ }
586
+
587
+ .ic-new-size {
588
+ font-weight: 700;
589
+ color: var(--ic-text);
590
+ font-size: 0.95rem;
591
+ }
592
+
593
+ .ic-savings-pct {
594
+ color: var(--ic-accent);
595
+ font-weight: 800;
596
+ font-size: 0.85rem;
597
+ }
598
+
599
+ .ic-savings-pill-negative .ic-savings-pct {
600
+ color: var(--ic-error);
601
+ }
602
+
603
+ .ic-item-actions {
604
+ display: flex;
605
+ gap: 0.4rem;
606
+ }
607
+
608
+ .ic-icon-btn {
609
+ background: var(--ic-bg-muted);
610
+ border: none;
611
+ color: var(--ic-text-muted);
612
+ width: 36px;
613
+ height: 36px;
614
+ border-radius: 0.5rem;
615
+ display: flex;
616
+ align-items: center;
617
+ justify-content: center;
618
+ cursor: pointer;
619
+ transition: background 0.2s, color 0.2s;
620
+ text-decoration: none;
621
+ flex-shrink: 0;
622
+ }
623
+
624
+ .ic-icon-btn:hover {
625
+ background: var(--ic-border);
626
+ color: var(--ic-text);
627
+ }
628
+
629
+ .ic-download-btn {
630
+ background: var(--ic-accent);
631
+ color: var(--ic-bg);
632
+ }
633
+
634
+ .ic-download-btn:hover {
635
+ background: var(--ic-accent-dark);
636
+ color: var(--ic-bg);
637
+ }
638
+
639
+ .ic-inline-editor {
640
+ grid-column: 1 / -1;
641
+ background: var(--ic-bg-muted);
642
+ border-radius: 0.75rem;
643
+ padding: 1rem 1.25rem;
644
+ margin-top: 0.25rem;
645
+ display: flex;
646
+ justify-content: space-between;
647
+ align-items: center;
648
+ gap: 1rem;
649
+ border: 1px solid var(--ic-border);
650
+ animation: ic-slide-down 0.2s ease-out;
651
+ }
652
+
653
+ @keyframes ic-slide-down {
654
+ from {
655
+ opacity: 0;
656
+ transform: translateY(-4px);
657
+ }
658
+ to {
659
+ opacity: 1;
660
+ transform: translateY(0);
661
+ }
662
+ }
663
+
664
+ .ic-editor-controls {
665
+ display: flex;
666
+ gap: 1.5rem;
667
+ flex-wrap: wrap;
668
+ }
669
+
670
+ .ic-editor-group {
671
+ display: flex;
672
+ flex-direction: column;
673
+ gap: 0.25rem;
674
+ font-size: 0.85rem;
675
+ font-weight: 600;
676
+ color: var(--ic-text-muted);
677
+ }
678
+
679
+ .ic-editor-group input[type="range"] {
680
+ accent-color: var(--ic-accent);
681
+ }
682
+
683
+ .ic-editor-group input[type="number"] {
684
+ padding: 0.25rem 0.5rem;
685
+ border: 1px solid var(--ic-border);
686
+ border-radius: 0.375rem;
687
+ font-size: 0.85rem;
688
+ background: var(--ic-bg);
689
+ color: var(--ic-text);
690
+ }
691
+
692
+ .ic-editor-close {
693
+ background: var(--ic-border);
694
+ border: none;
695
+ padding: 0.4rem 0.875rem;
696
+ border-radius: 0.375rem;
697
+ font-weight: 600;
698
+ font-size: 0.85rem;
699
+ cursor: pointer;
700
+ transition: background 0.2s;
701
+ color: var(--ic-text-muted);
702
+ white-space: nowrap;
703
+ }
704
+
705
+ .ic-editor-close:hover {
706
+ background: var(--ic-border);
707
+ }
708
+
709
+ .ic-global-actions {
710
+ margin-top: 1.5rem;
711
+ display: flex;
712
+ justify-content: center;
713
+ }
714
+
715
+ .ic-primary-btn {
716
+ background: var(--ic-text);
717
+ color: var(--ic-bg);
718
+ border: none;
719
+ padding: 1rem 3rem;
720
+ border-radius: 9999px;
721
+ font-weight: 700;
722
+ font-size: 1.1rem;
723
+ cursor: pointer;
724
+ transition: background 0.2s, transform 0.1s;
725
+ }
726
+
727
+ .ic-primary-btn:hover {
728
+ background: var(--ic-text-muted);
729
+ }
730
+
731
+ .ic-primary-btn:active {
732
+ transform: scale(0.98);
733
+ }
734
+
735
+ @media (max-width: 600px) {
736
+ .ic-file-item {
737
+ grid-template-columns: 1fr;
738
+ justify-items: center;
739
+ text-align: center;
740
+ }
741
+
742
+ .ic-preview-col {
743
+ flex-direction: column;
744
+ }
745
+
746
+ .ic-arrow-col {
747
+ transform: rotate(90deg);
748
+ }
749
+
750
+ .ic-result-col {
751
+ width: 100%;
752
+ justify-content: space-around;
753
+ }
754
+
755
+ .ic-global-settings {
756
+ flex-direction: column;
757
+ align-items: flex-start;
758
+ }
759
+ }
760
+ </style>