source: Klonkt/src/assets/css/embed.css@ 71e8fa5

main
Last change on this file since 71e8fa5 was d43ea3f, checked in by roboburr <roboburr@…>, 3 months ago

feat(embed): YouTube playlist/album as audio on the site

An audio-only YouTube embed with ?list=… now renders as an album card (same
style as own albums): cover + album name + numbered track list (titles via the
oEmbed proxy; video IDs via getPlaylist). Clicking a track or the album art
plays via the site audio player (loadPlaylist on index → next/prev within the
album; title/cover update per track; row highlight via #track-<videoId>).
Duration per track is empty (—:—) — not available without a YouTube Data API key.
busters audio-player.js?v=23, embed-player.js?v=12, embed.css?v=7.

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 8.9 KB
RevLine 
[4c9f29a]1/* ============================================================
2 * embed.css — eigen, in-huisstijl media-embeds (embed-player.js)
3 * YouTube/SoundCloud = volledig eigen controls; Spotify = onze frame + hun UI.
4 * Gebruikt de site-tokens (--paper/--ink/--accent/--rule/--radius) → past zich
5 * automatisch aan elk thema (light/dark/varianten) aan.
6 * ============================================================ */
7
8.folio-embed.pcms-embed-card {
9 margin: 2rem 0;
10 border: 1px solid var(--rule, #e8e2d5);
11 border-radius: var(--radius, 8px);
12 background: var(--paper-2, #f2ede0);
13 overflow: hidden;
14 position: relative;
15}
16
17/* Placeholder vóór embed-player.js de kaart opbouwt (of als JS uitstaat). */
18.pcms-embed-card.pcms-embed-loading {
19 min-height: 64px;
20}
21/* Fallback-tekst zolang JS de kaart nog niet heeft opgebouwd (of als JS uitstaat).
22 * buildCard() haalt .pcms-embed-loading weg → deze ::after verdwijnt vanzelf. */
23.pcms-embed-card.pcms-embed-loading::after {
24 content: "Speler laden\2026";
25 display: block;
26 padding: 1.25rem 1.5rem;
27 color: var(--ink-faint, #a8a29e);
28 font-size: .85rem;
29 font-family: var(--font-mono, monospace);
30}
31
32/* ---- Video-stage (YouTube): 16:9 ---- */
33.pcms-embed-stage {
34 position: relative;
35 width: 100%;
36 aspect-ratio: 16 / 9;
37 background: #000;
38}
39.pcms-embed-stage .pcms-embed-mount,
40.pcms-embed-stage iframe {
41 position: absolute;
42 inset: 0;
43 width: 100% !important;
44 height: 100% !important;
45 border: 0;
46}
47.pcms-embed-poster {
48 position: absolute;
49 inset: 0;
50 width: 100%;
51 height: 100%;
52 border: 0;
53 padding: 0;
54 cursor: pointer;
55 background-size: cover;
56 background-position: center;
57 background-color: #000;
58 display: grid;
59 place-items: center;
60 transition: opacity var(--transition, 180ms);
61}
62.pcms-embed-card.is-mounted .pcms-embed-poster { display: none; }
63
64/* ---- Audio-layout (SoundCloud / Spotify-facade) ---- */
65.pcms-embed-audio {
66 display: flex;
67 align-items: stretch;
68 gap: 0;
69 min-height: 96px;
70}
71.pcms-embed-art {
72 flex: 0 0 96px;
73 width: 96px;
74 height: 96px;
75 border: 0;
76 padding: 0;
77 cursor: pointer;
78 background: var(--paper, #faf8f3) center / cover no-repeat;
79 display: grid;
80 place-items: center;
81 color: var(--ink, #1a1a1a);
82}
83.pcms-embed-art.has-art .pcms-embed-bigplay {
84 background: rgba(0,0,0,.45);
85 border-radius: 50%;
86}
87.pcms-embed-info {
88 flex: 1 1 auto;
89 min-width: 0;
90 display: flex;
91 flex-direction: column;
92 justify-content: center;
93 gap: .2rem;
94 padding: .75rem 1rem;
95}
96.pcms-embed-info .pcms-embed-title {
97 font-weight: 600;
98 font-size: .95rem;
99 color: var(--ink, #1a1a1a);
100 overflow: hidden;
101 text-overflow: ellipsis;
102 white-space: nowrap;
103}
104.pcms-embed-info .pcms-embed-sub {
105 font-size: .8rem;
106 color: var(--ink-muted, #6b6560);
107 overflow: hidden;
108 text-overflow: ellipsis;
109 white-space: nowrap;
110}
111
112/* SoundCloud-iframe: functioneel maar onzichtbaar (we sturen via de Widget-API
113 * en tonen onze eigen balk). Off-screen i.p.v. display:none zodat de widget
114 * betrouwbaar initialiseert + audio blijft spelen. */
115.pcms-embed-card--soundcloud .pcms-embed-mount {
116 position: absolute;
117 left: -99999px;
118 top: 0;
119 width: 320px;
120 height: 60px;
121 opacity: 0;
122 pointer-events: none;
123}
[9e6b54f]124/* Verborgen YouTube-audio-speler ván de site-audiospeler (onderbalk). Off-screen
125 * met echte grootte zodat de browser 'm niet pauzeert; alleen het geluid telt. */
126#pcms-yt-host {
127 position: absolute;
128 left: -99999px;
129 top: 0;
130 width: 320px;
131 height: 180px;
132 opacity: 0;
133 pointer-events: none;
134}
[d43ea3f]135/* YouTube-afspeellijst als album-kaart: geen losse embed-card-chrome, de
136 * .post-album-stijl (uit style.css) stuurt de weergave. */
137.pcms-ytalbum { background: none; border: 0; padding: 0; margin: 1.5rem 0; }
138.pcms-ytalbum-msg { padding: .75rem 1rem; color: var(--ink-soft, #6b6560); font-size: .9rem; }
139
[9e6b54f]140/* Audio-only embed-kaart die nu via de onderbalk speelt = launcher-hint. */
141.pcms-embed-elsewhere { opacity: .9; }
142.pcms-embed-elsewhere .pcms-embed-title::after {
143 content: ' — speelt in de speler ↓';
144 font-weight: normal;
145 opacity: .6;
146 font-size: .85em;
147}
148
[73b41eb]149/* Audio-only YouTube: de YT-speler draait verborgen (off-screen) maar moet een
150 * echte grootte houden, anders pauzeert de browser 'm. Alleen het geluid telt. */
151.pcms-embed-card--youtube.pcms-embed-audio-mode .pcms-embed-mount {
152 position: absolute;
153 left: -99999px;
154 top: 0;
155 width: 320px;
156 height: 180px;
157 opacity: 0;
158 pointer-events: none;
159}
[4c9f29a]160
161/* Spotify: hun iframe IS de speler → tonen. Onze facade (art+info) verdwijnt
162 * zodra de controller gemount is. */
163.pcms-embed-card--spotify .pcms-embed-mount { display: block; width: 100%; }
164.pcms-embed-card--spotify .pcms-embed-mount iframe {
165 width: 100% !important;
166 border: 0;
167 display: block;
168}
169.pcms-embed-card--spotify.is-mounted .pcms-embed-art,
170.pcms-embed-card--spotify.is-mounted .pcms-embed-info { display: none; }
171.pcms-embed-card--spotify:not(.is-mounted) .pcms-embed-mount { display: none; }
172
[7f46817d]173/* Spotify in een nette witte box (Robin 2026-06-15): witte rand + rounded +
174 * schaduw. Hogere specificity (.folio-embed.pcms-embed-card--spotify) zodat dit
175 * de generieke .folio-embed.pcms-embed-card-basis (gelijke specificity) wint —
176 * staat ook later in het bestand. */
177.folio-embed.pcms-embed-card--spotify {
[52badd3]178 border: 3px solid #ffffff; /* witte rand blijft */
[7f46817d]179 border-radius: 16px;
180 box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
[52badd3]181 /* bg + overflow:hidden erven van de basis-kaart → de binnenste box krijgt
182 * weer de thema-kleur (var(--paper-2)) i.p.v. wit; facade-tekst gebruikt de
183 * gewone thema-tokens en blijft dus leesbaar. */
[7f46817d]184}
185
[4c9f29a]186/* ---- Grote play-knop (poster/art) ---- */
187.pcms-embed-bigplay {
188 width: 64px;
189 height: 64px;
190 display: grid;
191 place-items: center;
192 border-radius: 50%;
193 background: var(--accent, #c2410c);
194 color: #fff;
195 box-shadow: 0 4px 16px rgba(0,0,0,.35);
196 transition: transform var(--transition, 180ms);
197}
198.pcms-embed-art .pcms-embed-bigplay { width: 44px; height: 44px; }
199.pcms-embed-bigplay svg { width: 42%; height: 42%; }
200.pcms-embed-poster:hover .pcms-embed-bigplay,
201.pcms-embed-art:hover .pcms-embed-bigplay { transform: scale(1.08); }
202
203/* ---- Onze controlebalk (YouTube/SoundCloud) ---- */
204.pcms-embed-bar {
205 display: flex;
206 align-items: center;
207 gap: .65rem;
208 padding: .55rem .75rem;
209 border-top: 1px solid var(--rule, #e8e2d5);
210 background: var(--paper, #faf8f3);
211}
212.pcms-embed-pp {
213 flex: 0 0 auto;
214 width: 38px;
215 height: 38px;
216 border: 0;
217 border-radius: 50%;
218 cursor: pointer;
219 background: var(--accent, #c2410c);
220 color: #fff;
221 display: grid;
222 place-items: center;
223}
224.pcms-embed-pp svg { width: 18px; height: 18px; }
225.pcms-embed-cur, .pcms-embed-dur {
226 flex: 0 0 auto;
227 font-size: .75rem;
228 color: var(--ink-muted, #6b6560);
229 font-variant-numeric: tabular-nums;
230 min-width: 2.6em;
231 text-align: center;
232}
[557a76f]233/* Volume: mute-knop + compacte schuif (alleen YT/SC — eigen controls). */
234.pcms-embed-mute {
235 flex: 0 0 auto;
236 width: 28px; height: 28px;
237 border: 0; background: none; padding: 0;
238 color: var(--ink-muted, #6b6560);
239 cursor: pointer;
240 display: grid; place-items: center;
241}
242.pcms-embed-mute svg { width: 18px; height: 18px; }
243.pcms-embed-vol {
244 flex: 0 0 auto;
245 width: 64px;
246 cursor: pointer;
247 accent-color: var(--accent, #c2410c);
248}
249@media (max-width: 480px) {
250 /* Smal scherm: schuif weg, alleen de mute-knop houden (ruimte). */
251 .pcms-embed-vol { display: none; }
252}
[4c9f29a]253.pcms-embed-seek {
254 position: relative;
255 flex: 1 1 auto;
256 height: 16px;
257 cursor: pointer;
258}
259.pcms-embed-seek::before {
260 content: "";
261 position: absolute;
262 left: 0; right: 0; top: 50%;
263 transform: translateY(-50%);
264 height: 4px;
265 border-radius: 2px;
266 background: var(--rule-2, #d4ccb8);
267}
268.pcms-embed-seek-fill {
269 position: absolute;
270 left: 0; top: 50%;
271 transform: translateY(-50%);
272 height: 4px;
273 width: 0%;
274 border-radius: 2px;
275 background: var(--accent, #c2410c);
276 pointer-events: none;
277 z-index: 1;
278}
279.pcms-embed-badge {
280 flex: 0 0 auto;
281 font-size: .68rem;
282 letter-spacing: .04em;
283 text-transform: uppercase;
284 color: var(--ink-faint, #a8a29e);
285 text-decoration: none;
286}
287.pcms-embed-badge:hover { color: var(--accent, #c2410c); }
288
289/* Provider-accent op de badge */
290.pcms-embed-card--youtube .pcms-embed-badge { color: #ff0033; }
291.pcms-embed-card--soundcloud .pcms-embed-badge { color: #ff5500; }
292
293/* ---- Spotify-frame-badge (geen eigen balk) ---- */
294.pcms-embed-frame-badge {
295 padding: .4rem .75rem;
296 border-top: 1px solid var(--rule, #e8e2d5);
297 background: var(--paper, #faf8f3);
298 font-size: .68rem;
299 letter-spacing: .04em;
300 text-transform: uppercase;
301}
302.pcms-embed-frame-badge a { color: #1db954; text-decoration: none; }
303.pcms-embed-frame-badge a:hover { text-decoration: underline; }
304.pcms-embed-card--spotify.is-mounted .pcms-embed-frame-badge { display: none; }
305
306/* ---- Busy / error ---- */
307.pcms-embed-card.pcms-embed-busy { cursor: progress; }
308.pcms-embed-card.pcms-embed-error .pcms-embed-sub { color: #c0392b; }
309
310.pcms-embed-bigplay,
311.pcms-embed-pp,
312.pcms-embed-poster { -webkit-tap-highlight-color: transparent; }
Note: See TracBrowser for help on using the repository browser.