@dudgy/podcast-widget 0.1.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.
@@ -0,0 +1,773 @@
1
+ /*
2
+ * podcast-widget — Podcast Player Styles
3
+ *
4
+ * Theming: Define these CSS custom properties on a parent element:
5
+ *
6
+ * --player-surface Player background
7
+ * --player-surface-variant Secondary background (playlist hover, hero)
8
+ * --player-on-surface Primary text color
9
+ * --player-on-surface-variant Secondary text color
10
+ * --player-on-surface-rgb RGB triplet for rgba overlays (e.g. "131, 148, 150")
11
+ * --player-outline Borders
12
+ * --player-outline-variant Subtle borders
13
+ * --md-primary Accent color (play button, active episode)
14
+ * --md-on-primary Text on accent color
15
+ * --md-secondary Secondary accent (saved position indicator)
16
+ * --md-on-secondary Text on secondary accent
17
+ */
18
+
19
+ /* ================================================================
20
+ BASE — shared across all player modes
21
+ ================================================================ */
22
+
23
+ .pw-mini,
24
+ .pw-full {
25
+ font-family: 'Roboto', 'Segoe UI', system-ui, sans-serif;
26
+ box-sizing: border-box;
27
+ }
28
+
29
+ .pw-mini *, .pw-full * {
30
+ box-sizing: border-box;
31
+ }
32
+
33
+ /* ================================================================
34
+ MINI PLAYER
35
+ ================================================================ */
36
+
37
+ .pw-mini {
38
+ display: flex;
39
+ align-items: center;
40
+ gap: 12px;
41
+ padding: 0 12px;
42
+ flex: 1;
43
+ min-width: 0;
44
+ position: relative;
45
+ }
46
+
47
+ .pw-mini-artwork {
48
+ width: 48px;
49
+ height: 48px;
50
+ border-radius: 4px;
51
+ object-fit: cover;
52
+ flex-shrink: 0;
53
+ box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
54
+ }
55
+
56
+ .pw-mini-info {
57
+ flex: 1;
58
+ min-width: 0;
59
+ display: flex;
60
+ flex-direction: column;
61
+ gap: 2px;
62
+ }
63
+
64
+ .pw-mini-title {
65
+ font-size: 14px;
66
+ font-weight: 500;
67
+ color: var(--player-on-surface);
68
+ white-space: nowrap;
69
+ overflow: hidden;
70
+ text-overflow: ellipsis;
71
+ }
72
+
73
+ .pw-mini-show {
74
+ font-size: 12px;
75
+ color: var(--player-on-surface-variant);
76
+ white-space: nowrap;
77
+ overflow: hidden;
78
+ text-overflow: ellipsis;
79
+ }
80
+
81
+ .pw-mini-controls {
82
+ display: flex;
83
+ gap: 8px;
84
+ flex-shrink: 0;
85
+ align-items: center;
86
+ }
87
+
88
+ .pw-mini-progress {
89
+ position: absolute;
90
+ top: 0;
91
+ left: 0;
92
+ right: 0;
93
+ height: 3px;
94
+ background: var(--player-outline-variant);
95
+ cursor: pointer;
96
+ }
97
+
98
+ .pw-mini-progress-bar {
99
+ height: 100%;
100
+ background: var(--md-primary);
101
+ transition: width 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
102
+ }
103
+
104
+ /* Inline playlist dropdown (mini/expanded) */
105
+ .pw-mini-playlist {
106
+ background: var(--player-surface);
107
+ border-top: 1px solid var(--player-outline-variant);
108
+ max-height: 300px;
109
+ overflow-y: auto;
110
+ padding: 4px 8px;
111
+ }
112
+
113
+ /* ================================================================
114
+ BUTTONS (shared)
115
+ ================================================================ */
116
+
117
+ .pw-btn {
118
+ width: 40px;
119
+ height: 40px;
120
+ border-radius: 50%;
121
+ border: none;
122
+ background: transparent;
123
+ color: var(--player-on-surface);
124
+ cursor: pointer;
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: center;
128
+ transition: all 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
129
+ position: relative;
130
+ padding: 0;
131
+ }
132
+
133
+ .pw-btn svg {
134
+ width: 20px;
135
+ height: 20px;
136
+ }
137
+
138
+ .pw-btn:hover {
139
+ background-color: rgba(var(--player-on-surface-rgb), 0.08);
140
+ }
141
+
142
+ .pw-btn:active {
143
+ background-color: rgba(var(--player-on-surface-rgb), 0.12);
144
+ }
145
+
146
+ .pw-btn:disabled {
147
+ opacity: 0.38;
148
+ cursor: not-allowed;
149
+ }
150
+
151
+ /* Play/pause — larger and elevated */
152
+ .pw-btn--play {
153
+ width: 48px;
154
+ height: 48px;
155
+ background: var(--md-primary);
156
+ color: var(--md-on-primary);
157
+ box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15);
158
+ }
159
+
160
+ .pw-btn--play svg {
161
+ width: 24px;
162
+ height: 24px;
163
+ }
164
+
165
+ .pw-btn--play:hover {
166
+ box-shadow: 0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3);
167
+ background: var(--md-primary);
168
+ transform: scale(1.05);
169
+ }
170
+
171
+ .pw-btn--play:active {
172
+ box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
173
+ transform: scale(0.98);
174
+ }
175
+
176
+ /* Skip buttons */
177
+ .pw-btn--skip {
178
+ color: var(--md-primary);
179
+ }
180
+
181
+ .pw-btn--skip svg {
182
+ width: 24px;
183
+ height: 24px;
184
+ }
185
+
186
+ /* Expand button */
187
+ .pw-btn--expand svg {
188
+ width: 20px;
189
+ height: 20px;
190
+ }
191
+
192
+ /* Close button (full player) */
193
+ .pw-btn-close {
194
+ position: absolute;
195
+ top: 4px;
196
+ right: 8px;
197
+ z-index: 3;
198
+ width: 36px;
199
+ height: 36px;
200
+ border-radius: 50%;
201
+ border: none;
202
+ background: rgba(0, 0, 0, 0.3);
203
+ color: #fff;
204
+ cursor: pointer;
205
+ display: flex;
206
+ align-items: center;
207
+ justify-content: center;
208
+ transition: all 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
209
+ }
210
+
211
+ .pw-btn-close svg {
212
+ width: 20px;
213
+ height: 20px;
214
+ }
215
+
216
+ .pw-btn-close:hover {
217
+ background: rgba(0, 0, 0, 0.5);
218
+ }
219
+
220
+ /* ================================================================
221
+ FULL PLAYER (OVERLAY)
222
+ ================================================================ */
223
+
224
+ /* Backdrop */
225
+ .pw-backdrop {
226
+ position: fixed;
227
+ top: 0;
228
+ left: 0;
229
+ right: 0;
230
+ bottom: 0;
231
+ background: rgba(0, 0, 0, 0.5);
232
+ z-index: 1001;
233
+ cursor: pointer;
234
+ }
235
+
236
+ /* Full player container — consumer sets display:none initially */
237
+ .pw-full {
238
+ position: fixed;
239
+ top: 50%;
240
+ left: 50%;
241
+ transform: translate(-50%, -50%);
242
+ width: 90%;
243
+ max-width: 800px;
244
+ max-height: 90vh;
245
+ background: var(--player-surface);
246
+ border-radius: 16px;
247
+ box-shadow: 0 8px 12px 6px rgba(0,0,0,0.15), 0 4px 4px rgba(0,0,0,0.3);
248
+ overflow: hidden;
249
+ z-index: 1002;
250
+ display: flex;
251
+ flex-direction: column;
252
+ }
253
+
254
+ /* Hero section — flex-shrink: 0 ensures controls aren't compressed by playlist */
255
+ .pw-hero {
256
+ position: relative;
257
+ overflow: hidden;
258
+ flex-shrink: 0;
259
+ }
260
+
261
+ .pw-hero::after {
262
+ content: '';
263
+ position: absolute;
264
+ inset: 0;
265
+ background: rgba(0, 0, 0, 0.45);
266
+ z-index: 1;
267
+ pointer-events: none;
268
+ opacity: 0;
269
+ transition: opacity 0.3s ease;
270
+ }
271
+
272
+ .pw-hero:has(.pw-hero-bg.pw-active)::after {
273
+ opacity: 1;
274
+ }
275
+
276
+ .pw-hero-bg {
277
+ position: absolute;
278
+ top: -30px;
279
+ left: -30px;
280
+ right: -30px;
281
+ bottom: -30px;
282
+ background-size: cover;
283
+ background-position: center;
284
+ filter: blur(28px) saturate(1.2);
285
+ z-index: 0;
286
+ opacity: 0;
287
+ transition: opacity 0.4s ease;
288
+ pointer-events: none;
289
+ }
290
+
291
+ .pw-hero-bg.pw-active {
292
+ opacity: 1;
293
+ }
294
+
295
+ /* Hero children sit above blur + overlay */
296
+ .pw-hero > .pw-now-playing,
297
+ .pw-hero > .pw-controls {
298
+ position: relative;
299
+ z-index: 2;
300
+ }
301
+
302
+ /* Now playing */
303
+ .pw-now-playing {
304
+ padding: 16px;
305
+ padding-top: 40px;
306
+ display: flex;
307
+ align-items: center;
308
+ gap: 16px;
309
+ border-bottom: 1px solid var(--player-outline-variant);
310
+ }
311
+
312
+ .pw-hero .pw-now-playing {
313
+ background: transparent;
314
+ border-bottom: none;
315
+ }
316
+
317
+ .pw-artwork {
318
+ width: 60px;
319
+ height: 60px;
320
+ border-radius: 8px;
321
+ object-fit: cover;
322
+ box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
323
+ flex-shrink: 0;
324
+ }
325
+
326
+ .pw-track-info {
327
+ flex: 1;
328
+ min-width: 0;
329
+ }
330
+
331
+ .pw-track-name {
332
+ font-size: 14px;
333
+ font-weight: 500;
334
+ line-height: 20px;
335
+ color: var(--player-on-surface);
336
+ margin-bottom: 4px;
337
+ white-space: nowrap;
338
+ overflow: hidden;
339
+ text-overflow: ellipsis;
340
+ }
341
+
342
+ .pw-track-time {
343
+ font-size: 12px;
344
+ font-weight: 400;
345
+ color: var(--player-on-surface-variant);
346
+ font-variant-numeric: tabular-nums;
347
+ }
348
+
349
+ /* Controls area */
350
+ .pw-controls {
351
+ padding: 12px 16px;
352
+ display: flex;
353
+ flex-direction: column;
354
+ gap: 12px;
355
+ }
356
+
357
+ .pw-hero .pw-controls {
358
+ background: transparent;
359
+ }
360
+
361
+ .pw-main-controls {
362
+ display: flex;
363
+ justify-content: center;
364
+ align-items: center;
365
+ gap: 8px;
366
+ }
367
+
368
+ /* Progress bar */
369
+ .pw-progress {
370
+ height: 4px;
371
+ background: var(--player-outline-variant);
372
+ border-radius: 2px;
373
+ position: relative;
374
+ cursor: pointer;
375
+ overflow: hidden;
376
+ transition: height 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
377
+ }
378
+
379
+ .pw-progress:hover {
380
+ height: 6px;
381
+ }
382
+
383
+ .pw-progress-bar {
384
+ height: 100%;
385
+ background: var(--md-primary);
386
+ border-radius: 2px;
387
+ transition: width 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
388
+ position: relative;
389
+ }
390
+
391
+ .pw-progress-bar::after {
392
+ content: '';
393
+ position: absolute;
394
+ right: 0;
395
+ top: 50%;
396
+ transform: translateY(-50%);
397
+ width: 12px;
398
+ height: 12px;
399
+ background: var(--md-primary);
400
+ border-radius: 50%;
401
+ opacity: 0;
402
+ transition: opacity 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
403
+ }
404
+
405
+ .pw-progress:hover .pw-progress-bar::after {
406
+ opacity: 1;
407
+ }
408
+
409
+ /* Secondary controls (volume + speed) */
410
+ .pw-secondary-controls {
411
+ display: flex;
412
+ align-items: center;
413
+ justify-content: space-between;
414
+ gap: 12px;
415
+ }
416
+
417
+ .pw-volume {
418
+ display: flex;
419
+ align-items: center;
420
+ gap: 8px;
421
+ flex: 1;
422
+ max-width: 150px;
423
+ }
424
+
425
+ .pw-volume--mini {
426
+ max-width: 100px;
427
+ }
428
+
429
+ .pw-volume-icon {
430
+ width: 20px;
431
+ height: 20px;
432
+ color: var(--player-on-surface-variant);
433
+ flex-shrink: 0;
434
+ display: flex;
435
+ }
436
+
437
+ .pw-volume-icon svg {
438
+ width: 20px;
439
+ height: 20px;
440
+ }
441
+
442
+ .pw-volume-slider {
443
+ flex: 1;
444
+ height: 4px;
445
+ -webkit-appearance: none;
446
+ appearance: none;
447
+ background: var(--player-outline-variant);
448
+ border-radius: 2px;
449
+ outline: none;
450
+ }
451
+
452
+ .pw-volume-slider::-webkit-slider-thumb {
453
+ -webkit-appearance: none;
454
+ width: 12px;
455
+ height: 12px;
456
+ background: var(--md-primary);
457
+ border-radius: 50%;
458
+ cursor: pointer;
459
+ transition: transform 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
460
+ }
461
+
462
+ .pw-volume-slider::-webkit-slider-thumb:hover {
463
+ transform: scale(1.2);
464
+ }
465
+
466
+ .pw-volume-slider::-moz-range-thumb {
467
+ width: 12px;
468
+ height: 12px;
469
+ background: var(--md-primary);
470
+ border-radius: 50%;
471
+ cursor: pointer;
472
+ border: none;
473
+ transition: transform 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
474
+ }
475
+
476
+ .pw-volume-slider::-moz-range-thumb:hover {
477
+ transform: scale(1.2);
478
+ }
479
+
480
+ /* Speed select */
481
+ .pw-speed-select {
482
+ height: 32px;
483
+ padding: 0 8px;
484
+ border: 1px solid var(--player-outline);
485
+ background: var(--player-surface);
486
+ color: var(--player-on-surface);
487
+ border-radius: 4px;
488
+ font-size: 12px;
489
+ font-weight: 500;
490
+ cursor: pointer;
491
+ transition: all 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
492
+ font-variant-numeric: tabular-nums;
493
+ }
494
+
495
+ .pw-speed-select:hover {
496
+ border-color: var(--player-on-surface);
497
+ background-color: var(--player-surface-variant);
498
+ }
499
+
500
+ .pw-speed-select:focus-visible {
501
+ outline: 2px solid var(--md-primary);
502
+ outline-offset: 2px;
503
+ border-color: var(--md-primary);
504
+ }
505
+
506
+ /* ================================================================
507
+ PLAYLIST
508
+ ================================================================ */
509
+
510
+ .pw-playlist {
511
+ background: var(--player-surface);
512
+ border-top: 1px solid var(--player-outline-variant);
513
+ flex: 1;
514
+ min-height: 0;
515
+ overflow: hidden;
516
+ display: flex;
517
+ flex-direction: column;
518
+ }
519
+
520
+ .pw-playlist-header {
521
+ padding: 12px 16px;
522
+ font-size: 12px;
523
+ font-weight: 500;
524
+ letter-spacing: 0.1px;
525
+ color: var(--player-on-surface-variant);
526
+ text-transform: uppercase;
527
+ }
528
+
529
+ .pw-playlist-items {
530
+ flex: 1;
531
+ overflow-y: auto;
532
+ padding: 0 8px 8px;
533
+ }
534
+
535
+ .pw-playlist-items::-webkit-scrollbar {
536
+ width: 8px;
537
+ }
538
+
539
+ .pw-playlist-items::-webkit-scrollbar-track {
540
+ background: transparent;
541
+ }
542
+
543
+ .pw-playlist-items::-webkit-scrollbar-thumb {
544
+ background: var(--player-outline-variant);
545
+ border-radius: 4px;
546
+ }
547
+
548
+ .pw-playlist-items::-webkit-scrollbar-thumb:hover {
549
+ background: var(--player-outline);
550
+ }
551
+
552
+ /* Playlist item */
553
+ .pw-playlist-item {
554
+ display: flex;
555
+ align-items: center;
556
+ gap: 12px;
557
+ padding: 8px 12px;
558
+ min-height: 64px;
559
+ border-radius: 8px;
560
+ cursor: pointer;
561
+ transition: background-color 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
562
+ position: relative;
563
+ }
564
+
565
+ .pw-playlist-item:hover {
566
+ background-color: rgba(var(--player-on-surface-rgb), 0.08);
567
+ }
568
+
569
+ .pw-playlist-item.pw-playing {
570
+ background-color: var(--md-primary);
571
+ color: var(--md-on-primary);
572
+ }
573
+
574
+ .pw-playlist-item.pw-playing .pw-episode-show,
575
+ .pw-playlist-item.pw-playing .pw-episode-title,
576
+ .pw-playlist-item.pw-playing .pw-episode-date,
577
+ .pw-playlist-item.pw-playing .pw-episode-duration {
578
+ color: var(--md-on-primary);
579
+ }
580
+
581
+ .pw-playlist-item.pw-playing::before {
582
+ content: '';
583
+ position: absolute;
584
+ left: 0;
585
+ top: 50%;
586
+ transform: translateY(-50%);
587
+ width: 3px;
588
+ height: 60%;
589
+ background: var(--md-on-primary);
590
+ border-radius: 0 2px 2px 0;
591
+ }
592
+
593
+ .pw-playlist-item.pw-has-saved::after {
594
+ content: '';
595
+ position: absolute;
596
+ left: 8px;
597
+ top: 8px;
598
+ width: 4px;
599
+ height: 4px;
600
+ background: var(--md-secondary);
601
+ border-radius: 50%;
602
+ }
603
+
604
+ .pw-playlist-item.pw-loading,
605
+ .pw-playlist-item.pw-empty {
606
+ justify-content: center;
607
+ color: var(--player-on-surface-variant);
608
+ font-style: italic;
609
+ }
610
+
611
+ /* Episode image */
612
+ .pw-episode-image {
613
+ width: 48px;
614
+ height: 48px;
615
+ border-radius: 4px;
616
+ object-fit: cover;
617
+ flex-shrink: 0;
618
+ box-shadow: 0 1px 2px rgba(0,0,0,0.1);
619
+ }
620
+
621
+ /* Episode info */
622
+ .pw-episode-info {
623
+ flex: 1;
624
+ min-width: 0;
625
+ }
626
+
627
+ .pw-episode-show {
628
+ font-size: 13px;
629
+ font-weight: 500;
630
+ line-height: 18px;
631
+ color: var(--player-on-surface);
632
+ margin-bottom: 2px;
633
+ }
634
+
635
+ .pw-episode-title {
636
+ font-size: 12px;
637
+ font-weight: 400;
638
+ line-height: 16px;
639
+ color: var(--player-on-surface-variant);
640
+ margin-bottom: 2px;
641
+ white-space: nowrap;
642
+ overflow: hidden;
643
+ text-overflow: ellipsis;
644
+ }
645
+
646
+ .pw-episode-date {
647
+ font-size: 11px;
648
+ font-weight: 400;
649
+ line-height: 14px;
650
+ color: var(--player-on-surface-variant);
651
+ opacity: 0.7;
652
+ }
653
+
654
+ .pw-saved-position {
655
+ font-size: 11px;
656
+ color: var(--md-secondary);
657
+ margin-top: 2px;
658
+ display: flex;
659
+ align-items: center;
660
+ gap: 4px;
661
+ }
662
+
663
+ .pw-saved-position::before {
664
+ content: '●';
665
+ font-size: 6px;
666
+ }
667
+
668
+ /* Episode actions */
669
+ .pw-episode-actions {
670
+ display: flex;
671
+ flex-direction: column;
672
+ align-items: flex-end;
673
+ gap: 4px;
674
+ flex-shrink: 0;
675
+ padding-left: 8px;
676
+ }
677
+
678
+ .pw-episode-duration {
679
+ font-size: 11px;
680
+ font-weight: 500;
681
+ color: var(--player-on-surface-variant);
682
+ flex-shrink: 0;
683
+ font-variant-numeric: tabular-nums;
684
+ }
685
+
686
+ .pw-view-feed {
687
+ display: flex;
688
+ align-items: center;
689
+ justify-content: center;
690
+ width: 24px;
691
+ height: 24px;
692
+ border-radius: 50%;
693
+ color: var(--player-on-surface-variant);
694
+ opacity: 0.5;
695
+ transition: all 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
696
+ text-decoration: none;
697
+ }
698
+
699
+ .pw-view-feed svg {
700
+ width: 16px;
701
+ height: 16px;
702
+ }
703
+
704
+ .pw-view-feed:hover {
705
+ opacity: 1;
706
+ color: var(--md-primary);
707
+ background: rgba(var(--player-on-surface-rgb), 0.08);
708
+ }
709
+
710
+ /* ================================================================
711
+ RESPONSIVE
712
+ ================================================================ */
713
+
714
+ @media (max-width: 768px) {
715
+ .pw-full {
716
+ width: 95%;
717
+ max-height: 95vh;
718
+ }
719
+
720
+ .pw-mini {
721
+ padding: 0 8px;
722
+ }
723
+
724
+ .pw-mini-artwork {
725
+ width: 40px;
726
+ height: 40px;
727
+ }
728
+
729
+ .pw-mini-title {
730
+ font-size: 13px;
731
+ }
732
+
733
+ .pw-mini-show {
734
+ font-size: 11px;
735
+ }
736
+
737
+ .pw-now-playing {
738
+ padding: 12px;
739
+ }
740
+
741
+ .pw-artwork {
742
+ width: 50px;
743
+ height: 50px;
744
+ }
745
+
746
+ .pw-controls {
747
+ padding: 8px 12px;
748
+ }
749
+
750
+ .pw-playlist-items {
751
+ padding: 0 4px 4px;
752
+ }
753
+
754
+ .pw-playlist-item {
755
+ min-height: 56px;
756
+ gap: 8px;
757
+ padding: 8px;
758
+ }
759
+
760
+ .pw-episode-image {
761
+ width: 40px;
762
+ height: 40px;
763
+ }
764
+
765
+ .pw-secondary-controls {
766
+ flex-direction: column;
767
+ align-items: stretch;
768
+ }
769
+
770
+ .pw-volume {
771
+ max-width: 100%;
772
+ }
773
+ }