source: Klonkt/src/assets/css/embed.css@ 73b41eb

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

feat(embed): YouTube audio-only option in posts

Per embed you now choose audio-only or video. [[embed:audio:URL]] (YouTube)
renders as an audio card with our controls (play/seek/volume + thumbnail as
cover); the YT player runs hidden off-screen and provides only the sound.
[[embed:URL]] stays video. The editor embed button asks for audio or video
when a YouTube URL is given. Server: audio:/video: prefix in the shortcode
→ data-embed-mode. busters embed-player.js?v=8, embed.css?v=5.

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

  • Property mode set to 100644
File size: 8.1 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}
[73b41eb]124/* Audio-only YouTube: de YT-speler draait verborgen (off-screen) maar moet een
125 * echte grootte houden, anders pauzeert de browser 'm. Alleen het geluid telt. */
126.pcms-embed-card--youtube.pcms-embed-audio-mode .pcms-embed-mount {
127 position: absolute;
128 left: -99999px;
129 top: 0;
130 width: 320px;
131 height: 180px;
132 opacity: 0;
133 pointer-events: none;
134}
[4c9f29a]135
136/* Spotify: hun iframe IS de speler → tonen. Onze facade (art+info) verdwijnt
137 * zodra de controller gemount is. */
138.pcms-embed-card--spotify .pcms-embed-mount { display: block; width: 100%; }
139.pcms-embed-card--spotify .pcms-embed-mount iframe {
140 width: 100% !important;
141 border: 0;
142 display: block;
143}
144.pcms-embed-card--spotify.is-mounted .pcms-embed-art,
145.pcms-embed-card--spotify.is-mounted .pcms-embed-info { display: none; }
146.pcms-embed-card--spotify:not(.is-mounted) .pcms-embed-mount { display: none; }
147
[7f46817d]148/* Spotify in een nette witte box (Robin 2026-06-15): witte rand + rounded +
149 * schaduw. Hogere specificity (.folio-embed.pcms-embed-card--spotify) zodat dit
150 * de generieke .folio-embed.pcms-embed-card-basis (gelijke specificity) wint —
151 * staat ook later in het bestand. */
152.folio-embed.pcms-embed-card--spotify {
[52badd3]153 border: 3px solid #ffffff; /* witte rand blijft */
[7f46817d]154 border-radius: 16px;
155 box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
[52badd3]156 /* bg + overflow:hidden erven van de basis-kaart → de binnenste box krijgt
157 * weer de thema-kleur (var(--paper-2)) i.p.v. wit; facade-tekst gebruikt de
158 * gewone thema-tokens en blijft dus leesbaar. */
[7f46817d]159}
160
[4c9f29a]161/* ---- Grote play-knop (poster/art) ---- */
162.pcms-embed-bigplay {
163 width: 64px;
164 height: 64px;
165 display: grid;
166 place-items: center;
167 border-radius: 50%;
168 background: var(--accent, #c2410c);
169 color: #fff;
170 box-shadow: 0 4px 16px rgba(0,0,0,.35);
171 transition: transform var(--transition, 180ms);
172}
173.pcms-embed-art .pcms-embed-bigplay { width: 44px; height: 44px; }
174.pcms-embed-bigplay svg { width: 42%; height: 42%; }
175.pcms-embed-poster:hover .pcms-embed-bigplay,
176.pcms-embed-art:hover .pcms-embed-bigplay { transform: scale(1.08); }
177
178/* ---- Onze controlebalk (YouTube/SoundCloud) ---- */
179.pcms-embed-bar {
180 display: flex;
181 align-items: center;
182 gap: .65rem;
183 padding: .55rem .75rem;
184 border-top: 1px solid var(--rule, #e8e2d5);
185 background: var(--paper, #faf8f3);
186}
187.pcms-embed-pp {
188 flex: 0 0 auto;
189 width: 38px;
190 height: 38px;
191 border: 0;
192 border-radius: 50%;
193 cursor: pointer;
194 background: var(--accent, #c2410c);
195 color: #fff;
196 display: grid;
197 place-items: center;
198}
199.pcms-embed-pp svg { width: 18px; height: 18px; }
200.pcms-embed-cur, .pcms-embed-dur {
201 flex: 0 0 auto;
202 font-size: .75rem;
203 color: var(--ink-muted, #6b6560);
204 font-variant-numeric: tabular-nums;
205 min-width: 2.6em;
206 text-align: center;
207}
[557a76f]208/* Volume: mute-knop + compacte schuif (alleen YT/SC — eigen controls). */
209.pcms-embed-mute {
210 flex: 0 0 auto;
211 width: 28px; height: 28px;
212 border: 0; background: none; padding: 0;
213 color: var(--ink-muted, #6b6560);
214 cursor: pointer;
215 display: grid; place-items: center;
216}
217.pcms-embed-mute svg { width: 18px; height: 18px; }
218.pcms-embed-vol {
219 flex: 0 0 auto;
220 width: 64px;
221 cursor: pointer;
222 accent-color: var(--accent, #c2410c);
223}
224@media (max-width: 480px) {
225 /* Smal scherm: schuif weg, alleen de mute-knop houden (ruimte). */
226 .pcms-embed-vol { display: none; }
227}
[4c9f29a]228.pcms-embed-seek {
229 position: relative;
230 flex: 1 1 auto;
231 height: 16px;
232 cursor: pointer;
233}
234.pcms-embed-seek::before {
235 content: "";
236 position: absolute;
237 left: 0; right: 0; top: 50%;
238 transform: translateY(-50%);
239 height: 4px;
240 border-radius: 2px;
241 background: var(--rule-2, #d4ccb8);
242}
243.pcms-embed-seek-fill {
244 position: absolute;
245 left: 0; top: 50%;
246 transform: translateY(-50%);
247 height: 4px;
248 width: 0%;
249 border-radius: 2px;
250 background: var(--accent, #c2410c);
251 pointer-events: none;
252 z-index: 1;
253}
254.pcms-embed-badge {
255 flex: 0 0 auto;
256 font-size: .68rem;
257 letter-spacing: .04em;
258 text-transform: uppercase;
259 color: var(--ink-faint, #a8a29e);
260 text-decoration: none;
261}
262.pcms-embed-badge:hover { color: var(--accent, #c2410c); }
263
264/* Provider-accent op de badge */
265.pcms-embed-card--youtube .pcms-embed-badge { color: #ff0033; }
266.pcms-embed-card--soundcloud .pcms-embed-badge { color: #ff5500; }
267
268/* ---- Spotify-frame-badge (geen eigen balk) ---- */
269.pcms-embed-frame-badge {
270 padding: .4rem .75rem;
271 border-top: 1px solid var(--rule, #e8e2d5);
272 background: var(--paper, #faf8f3);
273 font-size: .68rem;
274 letter-spacing: .04em;
275 text-transform: uppercase;
276}
277.pcms-embed-frame-badge a { color: #1db954; text-decoration: none; }
278.pcms-embed-frame-badge a:hover { text-decoration: underline; }
279.pcms-embed-card--spotify.is-mounted .pcms-embed-frame-badge { display: none; }
280
281/* ---- Busy / error ---- */
282.pcms-embed-card.pcms-embed-busy { cursor: progress; }
283.pcms-embed-card.pcms-embed-error .pcms-embed-sub { color: #c0392b; }
284
285.pcms-embed-bigplay,
286.pcms-embed-pp,
287.pcms-embed-poster { -webkit-tap-highlight-color: transparent; }
Note: See TracBrowser for help on using the repository browser.