source: Klonkt/src/assets/css/embed.css@ 6b5d7da

main
Last change on this file since 6b5d7da was cb95343, checked in by Robin Genis <roboburr@…>, 2 months ago

fix(embeds): plain responsive iframe on mobile/touch

The custom JS-mounted player cards need the platform API + an i.ytimg.com poster, both
of which mobile Safari tracking-protection blocks → a blank/black box. On touch / coarse-
pointer devices, render the plain platform iframe directly (YouTube/SoundCloud/Spotify),
using a padding-ratio wrapper that reserves height on every browser incl. old iOS Safari.
Desktop keeps the rich card. embed.css v9, embed-player.js v17.

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