@jjlmoya/utils-audiovisual 1.4.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,7 +1,6 @@
1
1
  ---
2
2
  import { Icon } from 'astro-icon/components';
3
3
  import type { PrintQualityCalculatorUI } from './index';
4
- import './style.css';
5
4
 
6
5
  interface Props {
7
6
  ui: PrintQualityCalculatorUI;
@@ -316,3 +315,489 @@ const { ui } = Astro.props;
316
315
  }
317
316
  document.addEventListener("astro:page-load", initPQCalc);
318
317
  </script>
318
+
319
+ <style>
320
+ :root {
321
+ --pq-bg: #fff;
322
+ --pq-border: #cbd5e1;
323
+ --pq-primary: #6366f1;
324
+ --pq-primary-light: #e0e7ff;
325
+ --pq-accent: #4f46e5;
326
+ }
327
+
328
+ :global(.theme-dark) {
329
+ --pq-bg: #0f172a;
330
+ --pq-border: #334155;
331
+ --pq-primary: #6366f1;
332
+ --pq-primary-light: rgba(99, 102, 241, 0.2);
333
+ --pq-accent: #818cf8;
334
+ }
335
+
336
+ .pq-wrapper {
337
+ width: 100%;
338
+ max-width: 56rem;
339
+ margin: 0 auto;
340
+ display: flex;
341
+ flex-direction: column;
342
+ gap: 2rem;
343
+ padding: 1rem;
344
+ }
345
+
346
+ .pq-hidden {
347
+ display: none;
348
+ }
349
+
350
+ .pq-drop-zone {
351
+ position: relative;
352
+ cursor: pointer;
353
+ border: 2px dashed var(--pq-border);
354
+ border-radius: 1rem;
355
+ padding: 3rem;
356
+ transition: border-color 0.3s, background 0.3s;
357
+ }
358
+
359
+ :global(.theme-dark) .pq-drop-zone {
360
+ border-color: var(--pq-border);
361
+ }
362
+ .pq-drop-zone:hover,
363
+ .pq-drop-zone.pq-drop-active {
364
+ border-color: var(--pq-primary);
365
+ background: rgba(99, 102, 241, 0.04);
366
+ }
367
+ .pq-drop-inner {
368
+ display: flex;
369
+ flex-direction: column;
370
+ align-items: center;
371
+ justify-content: center;
372
+ text-align: center;
373
+ gap: 1rem;
374
+ }
375
+ .pq-upload-icon-wrap {
376
+ width: 5rem;
377
+ height: 5rem;
378
+ background: var(--pq-primary-light);
379
+ border-radius: 50%;
380
+ display: flex;
381
+ align-items: center;
382
+ justify-content: center;
383
+ color: var(--pq-accent);
384
+ transition: transform 0.3s;
385
+ }
386
+
387
+ :global(.theme-dark) .pq-upload-icon-wrap {
388
+ background: rgba(99, 102, 241, 0.2);
389
+ color: #818cf8;
390
+ }
391
+ .pq-drop-zone:hover .pq-upload-icon-wrap {
392
+ transform: scale(1.1);
393
+ }
394
+ .pq-drop-title {
395
+ font-size: 1.25rem;
396
+ font-weight: 700;
397
+ color: #0f172a;
398
+ margin: 0;
399
+ }
400
+
401
+ :global(.theme-dark) .pq-drop-title {
402
+ color: #f1f5f9;
403
+ }
404
+ .pq-drop-sub {
405
+ color: #64748b;
406
+ margin: 0.25rem 0 0;
407
+ font-size: 0.95rem;
408
+ }
409
+ .pq-drop-overlay {
410
+ position: absolute;
411
+ inset: 0;
412
+ background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(168,85,247,0.04));
413
+ border-radius: 1rem;
414
+ opacity: 0;
415
+ pointer-events: none;
416
+ transition: opacity 0.3s;
417
+ }
418
+ .pq-drop-zone:hover .pq-drop-overlay { opacity: 1; }
419
+
420
+ .pq-results {
421
+ display: flex;
422
+ flex-direction: column;
423
+ gap: 2rem;
424
+ animation: pq-fade-up 0.5s ease-out;
425
+ }
426
+
427
+ @keyframes pq-fade-up {
428
+ from {
429
+ opacity: 0;
430
+ transform: translateY(1.25rem);
431
+ }
432
+ to {
433
+ opacity: 1;
434
+ transform: translateY(0);
435
+ }
436
+ }
437
+
438
+ .pq-file-card {
439
+ background: #fff;
440
+ border: 1px solid #e2e8f0;
441
+ border-radius: 0.75rem;
442
+ box-shadow: 0 4px 24px -8px rgba(0,0,0,0.1);
443
+ padding: 1.5rem;
444
+ }
445
+
446
+ :global(.theme-dark) .pq-file-card {
447
+ background: #0f172a;
448
+ border-color: #1e293b;
449
+ }
450
+ .pq-file-left {
451
+ display: flex;
452
+ align-items: center;
453
+ gap: 1.5rem;
454
+ }
455
+ .pq-preview-wrap {
456
+ position: relative;
457
+ width: 8rem;
458
+ height: 8rem;
459
+ flex-shrink: 0;
460
+ }
461
+ .pq-preview-img {
462
+ width: 100%;
463
+ height: 100%;
464
+ object-fit: cover;
465
+ border-radius: 0.5rem;
466
+ box-shadow: 0 2px 8px rgba(0,0,0,0.15);
467
+ }
468
+ .pq-file-name {
469
+ font-weight: 700;
470
+ color: #0f172a;
471
+ font-size: 1rem;
472
+ margin: 0 0 0.5rem;
473
+ overflow: hidden;
474
+ text-overflow: ellipsis;
475
+ white-space: nowrap;
476
+ max-width: 20rem;
477
+ }
478
+
479
+ :global(.theme-dark) .pq-file-name {
480
+ color: #f1f5f9;
481
+ }
482
+ .pq-file-meta {
483
+ display: flex;
484
+ flex-wrap: wrap;
485
+ gap: 1rem;
486
+ }
487
+ .pq-meta-item {
488
+ display: flex;
489
+ align-items: center;
490
+ gap: 0.25rem;
491
+ font-size: 0.85rem;
492
+ color: #64748b;
493
+ }
494
+
495
+ .pq-main-grid {
496
+ display: grid;
497
+ grid-template-columns: 1fr 1fr;
498
+ gap: 2rem;
499
+ }
500
+
501
+ @media (max-width: 640px) {
502
+ .pq-main-grid { grid-template-columns: 1fr; }
503
+ }
504
+
505
+ .pq-config-panel {
506
+ background: #f8fafc;
507
+ border: 1px solid #e2e8f0;
508
+ border-radius: 0.75rem;
509
+ padding: 1.5rem;
510
+ }
511
+
512
+ :global(.theme-dark) .pq-config-panel {
513
+ background: rgba(30, 41, 59, 0.5);
514
+ border-color: var(--pq-border);
515
+ }
516
+ .pq-config-label {
517
+ display: block;
518
+ font-size: 0.875rem;
519
+ font-weight: 500;
520
+ color: #475569;
521
+ margin-bottom: 1rem;
522
+ }
523
+
524
+ :global(.theme-dark) .pq-config-label {
525
+ color: #94a3b8;
526
+ }
527
+ .pq-slider {
528
+ width: 100%;
529
+ height: 0.5rem;
530
+ background: #e2e8f0;
531
+ border-radius: 0.5rem;
532
+ appearance: none;
533
+ cursor: pointer;
534
+ accent-color: #6366f1;
535
+ margin-bottom: 1rem;
536
+ }
537
+
538
+ :global(.theme-dark) .pq-slider {
539
+ background: #334155;
540
+ }
541
+ .pq-dpi-row {
542
+ display: flex;
543
+ align-items: center;
544
+ gap: 1rem;
545
+ margin-bottom: 1.5rem;
546
+ }
547
+ .pq-dpi-number {
548
+ width: 6rem;
549
+ border: 1px solid #e2e8f0;
550
+ border-radius: 0.5rem;
551
+ background: #fff;
552
+ color: #0f172a;
553
+ font-size: 1rem;
554
+ font-weight: 700;
555
+ text-align: center;
556
+ padding: 0.4rem 0.5rem;
557
+ outline: none;
558
+ }
559
+ .pq-dpi-number:focus { border-color: var(--pq-primary); }
560
+
561
+ :global(.theme-dark) .pq-dpi-number {
562
+ background: #0f172a;
563
+ border-color: var(--pq-border);
564
+ color: #f1f5f9;
565
+ }
566
+ .pq-dpi-label {
567
+ font-size: 0.875rem;
568
+ color: #64748b;
569
+ }
570
+ .pq-presets {
571
+ display: flex;
572
+ flex-wrap: wrap;
573
+ gap: 0.5rem;
574
+ }
575
+ .pq-preset-btn {
576
+ padding: 0.25rem 0.75rem;
577
+ font-size: 0.75rem;
578
+ font-weight: 500;
579
+ border-radius: 999px;
580
+ background: #e2e8f0;
581
+ color: #475569;
582
+ border: none;
583
+ cursor: pointer;
584
+ transition: background 0.15s, color 0.15s;
585
+ }
586
+ .pq-preset-btn:hover { background: #cbd5e1; }
587
+
588
+ :global(.theme-dark) .pq-preset-btn {
589
+ background: #334155;
590
+ color: #94a3b8;
591
+ }
592
+
593
+ :global(.theme-dark) .pq-preset-btn:hover {
594
+ background: #475569;
595
+ }
596
+ .pq-preset-active {
597
+ background: var(--pq-primary-light);
598
+ color: #4338ca;
599
+ box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
600
+ }
601
+
602
+ :global(.theme-dark) .pq-preset-active {
603
+ background: rgba(99, 102, 241, 0.3);
604
+ color: #a5b4fc;
605
+ }
606
+
607
+ .pq-output-panel {
608
+ display: flex;
609
+ }
610
+ .pq-output-gradient {
611
+ flex: 1;
612
+ display: flex;
613
+ flex-direction: column;
614
+ justify-content: center;
615
+ background: linear-gradient(135deg, #6366f1, #a855f7);
616
+ border-radius: 0.75rem;
617
+ padding: 1.5rem;
618
+ color: #fff;
619
+ box-shadow: 0 10px 40px -10px rgba(99,102,241,0.4);
620
+ position: relative;
621
+ overflow: hidden;
622
+ }
623
+ .pq-output-blur-bg {
624
+ position: absolute;
625
+ top: 0; right: 0;
626
+ width: 8rem; height: 8rem;
627
+ background: rgba(255,255,255,0.1);
628
+ border-radius: 50%;
629
+ filter: blur(2rem);
630
+ transform: translate(2rem, -2rem);
631
+ pointer-events: none;
632
+ }
633
+ .pq-output-subtitle {
634
+ font-size: 0.75rem;
635
+ font-weight: 500;
636
+ text-transform: uppercase;
637
+ letter-spacing: 0.05em;
638
+ color: rgba(224,231,255,0.9);
639
+ margin: 0 0 0.5rem;
640
+ position: relative;
641
+ }
642
+ .pq-output-size {
643
+ display: flex;
644
+ align-items: baseline;
645
+ gap: 0.5rem;
646
+ font-size: 2.5rem;
647
+ font-weight: 900;
648
+ margin-bottom: 0.25rem;
649
+ position: relative;
650
+ }
651
+ .pq-size-sep {
652
+ font-size: 1.5rem;
653
+ opacity: 0.5;
654
+ }
655
+ .pq-size-unit {
656
+ font-size: 1.5rem;
657
+ }
658
+ .pq-output-inches {
659
+ color: rgba(199, 210, 254, 0.8);
660
+ font-size: 0.875rem;
661
+ margin-bottom: 1.5rem;
662
+ position: relative;
663
+ }
664
+ .pq-quality-section {
665
+ padding-top: 1rem;
666
+ border-top: 1px solid rgba(255,255,255,0.2);
667
+ position: relative;
668
+ }
669
+ .pq-quality-badge {
670
+ display: inline-flex;
671
+ align-items: center;
672
+ gap: 0.375rem;
673
+ padding: 0.25rem 0.75rem;
674
+ border-radius: 999px;
675
+ font-size: 0.875rem;
676
+ font-weight: 700;
677
+ background: rgba(255,255,255,0.2);
678
+ backdrop-filter: blur(4px);
679
+ margin-bottom: 0.5rem;
680
+ }
681
+ .pq-badge-green {
682
+ background: rgba(16, 185, 129, 0.25);
683
+ box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.3);
684
+ }
685
+
686
+ .pq-badge-yellow {
687
+ background: rgba(234, 179, 8, 0.25);
688
+ box-shadow: 0 0 0 1px rgba(253, 224, 71, 0.3);
689
+ }
690
+
691
+ .pq-badge-red {
692
+ background: rgba(239, 68, 68, 0.25);
693
+ box-shadow: 0 0 0 1px rgba(252, 165, 165, 0.3);
694
+ }
695
+
696
+ .pq-badge-slate {
697
+ background: rgba(100, 116, 139, 0.25);
698
+ box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.3);
699
+ }
700
+ .pq-quality-desc {
701
+ font-size: 0.875rem;
702
+ color: rgba(199,210,254,0.9);
703
+ line-height: 1.4;
704
+ margin: 0;
705
+ }
706
+
707
+ .pq-formats-card {
708
+ background: #fff;
709
+ border: 1px solid #e2e8f0;
710
+ border-radius: 0.75rem;
711
+ padding: 1.5rem;
712
+ }
713
+
714
+ :global(.theme-dark) .pq-formats-card {
715
+ background: #0f172a;
716
+ border-color: #1e293b;
717
+ }
718
+ .pq-formats-title {
719
+ display: flex;
720
+ align-items: center;
721
+ gap: 0.5rem;
722
+ font-weight: 700;
723
+ font-size: 1rem;
724
+ color: #0f172a;
725
+ margin: 0 0 1rem;
726
+ }
727
+
728
+ :global(.theme-dark) .pq-formats-title {
729
+ color: #f1f5f9;
730
+ }
731
+ .pq-formats-scroll {
732
+ overflow-x: auto;
733
+ }
734
+ .pq-formats-table {
735
+ width: 100%;
736
+ border-collapse: collapse;
737
+ font-size: 0.875rem;
738
+ }
739
+ .pq-formats-table th {
740
+ text-align: left;
741
+ padding: 0.75rem 1rem;
742
+ font-size: 0.75rem;
743
+ font-weight: 700;
744
+ text-transform: uppercase;
745
+ letter-spacing: 0.05em;
746
+ color: #475569;
747
+ background: #f8fafc;
748
+ }
749
+
750
+ :global(.theme-dark) .pq-formats-table th {
751
+ background: #1e293b;
752
+ color: #94a3b8;
753
+ }
754
+ .pq-formats-row {
755
+ border-bottom: 1px solid #f1f5f9;
756
+ transition: background 0.15s;
757
+ }
758
+
759
+ .pq-formats-row:hover {
760
+ background: #f8fafc;
761
+ }
762
+
763
+ :global(.theme-dark) .pq-formats-row {
764
+ border-color: #1e293b;
765
+ }
766
+
767
+ :global(.theme-dark) .pq-formats-row:hover {
768
+ background: #1e293b;
769
+ }
770
+ .pq-td {
771
+ padding: 0.75rem 1rem;
772
+ color: #475569;
773
+ }
774
+
775
+ :global(.theme-dark) .pq-td {
776
+ color: #94a3b8;
777
+ }
778
+ .pq-td-name {
779
+ font-weight: 600;
780
+ color: #0f172a;
781
+ }
782
+
783
+ :global(.theme-dark) .pq-td-name {
784
+ color: #f1f5f9;
785
+ }
786
+ .pq-status {
787
+ display: inline-flex;
788
+ align-items: center;
789
+ gap: 0.35rem;
790
+ font-weight: 600;
791
+ font-size: 0.8rem;
792
+ }
793
+ .pq-status-ok { color: #16a34a; }
794
+ .pq-status-no { color: #d97706; }
795
+
796
+ :global(.theme-dark) .pq-status-ok {
797
+ color: #4ade80;
798
+ }
799
+
800
+ :global(.theme-dark) .pq-status-no {
801
+ color: #fbbf24;
802
+ }
803
+ </style>