ferst-core 0.14.0 → 0.16.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.
- package/README.md +13 -4
- package/bin/ferst-media.mjs +96 -0
- package/cms/config.template.yml +11 -0
- package/components/Card.astro +53 -51
- package/components/PostCard.astro +138 -136
- package/components/SiteHeader.astro +1356 -1273
- package/components/blocks/Grid.astro +49 -48
- package/components/blocks/Heading.astro +4 -1
- package/components/recipes/Banner.astro +146 -146
- package/components/recipes/Book.astro +39 -4
- package/components/recipes/FeatureCards.astro +112 -118
- package/components/recipes/Gallery.astro +57 -59
- package/components/recipes/Hero.astro +638 -533
- package/components/recipes/LatestPosts.astro +295 -292
- package/components/recipes/Locations.astro +146 -143
- package/components/recipes/Marquee.astro +75 -75
- package/components/recipes/MediaCards.astro +213 -219
- package/components/recipes/Pricing.astro +149 -150
- package/components/recipes/Stats.astro +150 -157
- package/components/recipes/Tiles.astro +342 -296
- package/content/blocks.ts +1072 -1024
- package/content/imageSlots.mjs +542 -0
- package/content/schemas.ts +35 -2
- package/examples/recipes.ts +4 -0
- package/fonts/OFL.txt +1332 -287
- package/fonts/anton-latin-400-normal.woff2 +0 -0
- package/fonts/bangers-latin-400-normal.woff2 +0 -0
- package/fonts/bebas-neue-latin-400-normal.woff2 +0 -0
- package/fonts/bowlby-one-latin-400-normal.woff2 +0 -0
- package/fonts/fredoka-latin-400-normal.woff2 +0 -0
- package/fonts/fredoka-latin-600-normal.woff2 +0 -0
- package/fonts/fredoka-latin-700-normal.woff2 +0 -0
- package/fonts/knewave-latin-400-normal.woff2 +0 -0
- package/fonts/lora-latin-400-normal.woff2 +0 -0
- package/fonts/lora-latin-600-normal.woff2 +0 -0
- package/fonts/lora-latin-700-normal.woff2 +0 -0
- package/fonts/merriweather-latin-400-normal.woff2 +0 -0
- package/fonts/merriweather-latin-600-normal.woff2 +0 -0
- package/fonts/merriweather-latin-700-normal.woff2 +0 -0
- package/fonts/nunito-latin-400-normal.woff2 +0 -0
- package/fonts/nunito-latin-600-normal.woff2 +0 -0
- package/fonts/nunito-latin-700-normal.woff2 +0 -0
- package/fonts/oswald-latin-400-normal.woff2 +0 -0
- package/fonts/oswald-latin-600-normal.woff2 +0 -0
- package/fonts/oswald-latin-700-normal.woff2 +0 -0
- package/fonts/rubik-dirt-latin-400-normal.woff2 +0 -0
- package/integration.mjs +253 -249
- package/layouts/Base.astro +13 -3
- package/lib/book.ts +94 -1
- package/lib/fonts.ts +130 -0
- package/lib/gridRows.ts +197 -0
- package/lib/image-fields.ts +140 -0
- package/lib/image-size.mjs +108 -0
- package/lib/image-sizes.ts +16 -0
- package/lib/logo-header.ts +46 -0
- package/lib/media-check.mjs +524 -0
- package/lib/theme-preview.ts +203 -140
- package/lib/themeTokens.ts +235 -220
- package/package.json +3 -2
- package/styles/fonts.css +239 -76
- package/styles/theme.css +228 -160
- package/lib/gridColumns.ts +0 -22
|
@@ -1,533 +1,638 @@
|
|
|
1
|
-
---
|
|
2
|
-
/**
|
|
3
|
-
* Hero — the first Level-2 recipe: a curated page-opening band that composes
|
|
4
|
-
* primitives (Heading + Button) into a designed layout. Presets: `centered`
|
|
5
|
-
* (stacked and centred), `split` (text beside an image) and `media` (text over a
|
|
6
|
-
* background — a looping video, a slow crossfade of images, or one image). A
|
|
7
|
-
* media hero can be a band, `tall`, or fill the first `screen` edge to edge.
|
|
8
|
-
* Recipes are locked components so quality can't drift (BLOCK-ARCHITECTURE §6).
|
|
9
|
-
*
|
|
10
|
-
* Moving backgrounds (video, slideshow) are accessible by construction: a pause
|
|
11
|
-
* button (WCAG 2.2.2), still under prefers-reduced-motion (the poster / first
|
|
12
|
-
* image), and the slideshow pauses while off-screen or the tab is hidden.
|
|
13
|
-
*/
|
|
14
|
-
import Heading from '../blocks/Heading.astro';
|
|
15
|
-
import Button from '../Button.astro';
|
|
16
|
-
import { backgroundEmbed, videoEmbed } from '../../lib/video';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
let
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
.
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
.b-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
.b-
|
|
358
|
-
position:
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
.b-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
background: rgba(8, 10, 18, 0.
|
|
476
|
-
}
|
|
477
|
-
.b-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
height:
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* Hero — the first Level-2 recipe: a curated page-opening band that composes
|
|
4
|
+
* primitives (Heading + Button) into a designed layout. Presets: `centered`
|
|
5
|
+
* (stacked and centred), `split` (text beside an image) and `media` (text over a
|
|
6
|
+
* background — a looping video, a slow crossfade of images, or one image). A
|
|
7
|
+
* media hero can be a band, `tall`, or fill the first `screen` edge to edge.
|
|
8
|
+
* Recipes are locked components so quality can't drift (BLOCK-ARCHITECTURE §6).
|
|
9
|
+
*
|
|
10
|
+
* Moving backgrounds (video, slideshow) are accessible by construction: a pause
|
|
11
|
+
* button (WCAG 2.2.2), still under prefers-reduced-motion (the poster / first
|
|
12
|
+
* image), and the slideshow pauses while off-screen or the tab is hidden.
|
|
13
|
+
*/
|
|
14
|
+
import Heading from '../blocks/Heading.astro';
|
|
15
|
+
import Button from '../Button.astro';
|
|
16
|
+
import { backgroundEmbed, videoEmbed } from '../../lib/video';
|
|
17
|
+
import { imageSizeOf } from '../../lib/image-sizes';
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
eyebrow?: string;
|
|
21
|
+
title: string;
|
|
22
|
+
titleImage?: { src: string; width?: 'small' | 'medium' | 'large'; shadow?: boolean };
|
|
23
|
+
titleHidden?: boolean;
|
|
24
|
+
subtitle?: string;
|
|
25
|
+
cta?: { label: string; href: string };
|
|
26
|
+
image?: { src: string; alt?: string };
|
|
27
|
+
media?: { image?: string; images?: string[]; video?: string; poster?: string; overlay?: number; link?: string; linkLabel?: string; fit?: 'cover' | 'contain' };
|
|
28
|
+
layout?: 'centered' | 'split' | 'media';
|
|
29
|
+
size?: 'compact' | 'standard' | 'tall' | 'screen';
|
|
30
|
+
parallax?: boolean;
|
|
31
|
+
background?: 'none' | 'mesh';
|
|
32
|
+
fullBleed?: boolean;
|
|
33
|
+
focus?: string;
|
|
34
|
+
}
|
|
35
|
+
const { eyebrow, title, titleImage, titleHidden = false, subtitle, cta, image, media, layout = 'centered', size = 'standard', parallax = false, background = 'none', fullBleed = false, focus } = Astro.props;
|
|
36
|
+
// A YouTube / Vimeo link plays as an embedded background (after consent); anything else
|
|
37
|
+
// in `video` is a file for a native <video>.
|
|
38
|
+
const embed = media?.video ? backgroundEmbed(media.video) : null;
|
|
39
|
+
const slides = !media?.video && (media?.images?.length ?? 0) >= 2 ? media!.images! : [];
|
|
40
|
+
const still = media?.image ?? media?.images?.[0];
|
|
41
|
+
const isMedia = layout === 'media' && media && (media.video || slides.length || still);
|
|
42
|
+
const motion = isMedia ? (embed ? 'embed' : media?.video ? 'video' : slides.length ? 'slides' : undefined) : undefined;
|
|
43
|
+
const overlay = (media?.overlay ?? 45) / 100;
|
|
44
|
+
const isMesh = background === 'mesh' && !isMedia;
|
|
45
|
+
// The background can lead somewhere — e.g. the full video on YouTube (new tab; the app on phones).
|
|
46
|
+
const linkTo = media?.link ?? embed?.watchUrl; // an embedded video links to itself by default
|
|
47
|
+
const bgLink = isMedia && linkTo && /^(https?:\/\/|\/)/i.test(linkTo) ? linkTo : undefined;
|
|
48
|
+
const provider = bgLink ? videoEmbed(bgLink)?.provider : undefined;
|
|
49
|
+
const watchLabel = media?.linkLabel || (provider ? `Watch the full video on ${provider}` : 'Watch the full video');
|
|
50
|
+
// The still: the image (no motion), or an embed's poster until the player may load.
|
|
51
|
+
const stillSrc = embed ? media?.poster ?? still : !media?.video && !slides.length ? still : undefined;
|
|
52
|
+
// Drawn as a real <img>, never a CSS background: a picture set through a CSS variable is
|
|
53
|
+
// found late (never by the preload scanner), so the hero sat grey until it arrived, and
|
|
54
|
+
// some browsers kept it grey. A real image, loaded first, is found early and painted.
|
|
55
|
+
const heroImg = isMedia && stillSrc ? stillSrc : undefined;
|
|
56
|
+
// The title as a picture (a wordmark): drawn inside the h1, described by the title, with its
|
|
57
|
+
// own width and height when the build read them, so its box keeps the picture's shape.
|
|
58
|
+
const titleImageSize = imageSizeOf(titleImage?.src);
|
|
59
|
+
const titleAlt = title.replace(/\s+/g, ' ').trim();
|
|
60
|
+
// A title hidden from view stays the h1 (titleHidden). A title picture is already the
|
|
61
|
+
// visible title, so it stays shown.
|
|
62
|
+
const hideTitle = titleHidden && !titleImage;
|
|
63
|
+
// A picture shown whole (media.fit "contain"), e.g. a designed poster: the band takes the
|
|
64
|
+
// picture's own shape (when the build read it), with no scrim or drift, and the words sit
|
|
65
|
+
// below it. A video always covers.
|
|
66
|
+
const contain = Boolean(isMedia && media?.fit === 'contain' && !media.video);
|
|
67
|
+
const posterSize = contain ? imageSizeOf(heroImg ?? slides[0]) : undefined;
|
|
68
|
+
const wordsBelow = Boolean(eyebrow || subtitle || cta || !hideTitle);
|
|
69
|
+
const heroStyle = isMedia
|
|
70
|
+
? `--hero-overlay: ${overlay}${focus ? `; --hero-focus: ${focus}` : ''}${posterSize ? `; --hero-ratio: ${posterSize.width} / ${posterSize.height}` : ''}`
|
|
71
|
+
: undefined;
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
<section
|
|
75
|
+
class="b-hero"
|
|
76
|
+
data-layout={layout}
|
|
77
|
+
data-size={isMedia ? size : undefined}
|
|
78
|
+
data-bg={isMesh ? 'mesh' : undefined}
|
|
79
|
+
data-motion={motion}
|
|
80
|
+
data-linked={bgLink ? 'true' : undefined}
|
|
81
|
+
data-parallax={isMedia && parallax && !contain ? 'true' : undefined}
|
|
82
|
+
data-full-bleed={isMedia && fullBleed ? 'true' : undefined}
|
|
83
|
+
data-fit={contain ? 'contain' : undefined}
|
|
84
|
+
data-title-hidden={hideTitle ? '' : undefined}
|
|
85
|
+
style={heroStyle}
|
|
86
|
+
>
|
|
87
|
+
{isMedia && (
|
|
88
|
+
<div class="b-hero__bg" aria-hidden="true">
|
|
89
|
+
{heroImg && <img class="b-hero__img" src={heroImg} alt="" width={posterSize?.width} height={posterSize?.height} loading="eager" fetchpriority="high" decoding="async" />}
|
|
90
|
+
{embed && <div class="b-hero__embed" data-embed-url={embed.embedUrl} data-provider={embed.provider}></div>}
|
|
91
|
+
{media?.video && !embed ? (
|
|
92
|
+
<video aria-hidden="true" tabindex="-1" autoplay muted loop playsinline poster={media.poster} preload="metadata">
|
|
93
|
+
<source src={media.video} />
|
|
94
|
+
</video>
|
|
95
|
+
) : null}
|
|
96
|
+
{slides.map((src, i) => (
|
|
97
|
+
<img class:list={['b-hero__slide', { 'is-on': i === 0 }]} src={src} alt="" width={i === 0 ? posterSize?.width : undefined} height={i === 0 ? posterSize?.height : undefined} loading={i === 0 ? 'eager' : 'lazy'} fetchpriority={i === 0 ? 'high' : undefined} decoding="async" />
|
|
98
|
+
))}
|
|
99
|
+
{!contain && <span class="b-hero__scrim"></span>}
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
{bgLink && <a class="b-hero__bglink" href={bgLink} target="_blank" rel="noopener" tabindex="-1" aria-hidden="true"></a>}
|
|
103
|
+
{isMesh && <div class="b-hero__mesh" aria-hidden="true"></div>}
|
|
104
|
+
<div class="b-hero__text" data-display-title data-words={contain && !wordsBelow ? 'none' : undefined}>
|
|
105
|
+
{eyebrow && <p class="b-hero__eyebrow">{eyebrow}</p>}
|
|
106
|
+
<Heading text={title} level={1} align={layout === 'split' ? 'start' : 'center'}>
|
|
107
|
+
{titleImage && (
|
|
108
|
+
<img
|
|
109
|
+
class="b-hero__title-image"
|
|
110
|
+
src={titleImage.src}
|
|
111
|
+
alt={titleAlt}
|
|
112
|
+
width={titleImageSize?.width}
|
|
113
|
+
height={titleImageSize?.height}
|
|
114
|
+
data-width={titleImage.width ?? 'medium'}
|
|
115
|
+
data-shadow={titleImage.shadow ? '' : undefined}
|
|
116
|
+
loading="eager"
|
|
117
|
+
fetchpriority="high"
|
|
118
|
+
decoding="async"
|
|
119
|
+
/>
|
|
120
|
+
)}
|
|
121
|
+
</Heading>
|
|
122
|
+
{subtitle && <p class="b-hero__subtitle">{subtitle}</p>}
|
|
123
|
+
{cta && (
|
|
124
|
+
<div class="b-hero__cta">
|
|
125
|
+
<Button href={cta.href} variant={layout === 'media' ? 'cta' : 'primary'}>{cta.label}</Button>
|
|
126
|
+
</div>
|
|
127
|
+
)}
|
|
128
|
+
</div>
|
|
129
|
+
{bgLink && (
|
|
130
|
+
<a class="b-hero__watch" href={bgLink} target="_blank" rel="noopener">
|
|
131
|
+
<span class="b-hero__watch-icon" aria-hidden="true"></span>{watchLabel}<span class="b-hero__sr"> (opens in a new tab)</span>
|
|
132
|
+
</a>
|
|
133
|
+
)}
|
|
134
|
+
{motion && (
|
|
135
|
+
<button type="button" class="b-hero__pause" aria-pressed="false" aria-label="Pause background" hidden={motion === 'embed'}>
|
|
136
|
+
<span class="b-hero__pause-icon" aria-hidden="true"></span>
|
|
137
|
+
</button>
|
|
138
|
+
)}
|
|
139
|
+
{layout === 'split' && image && (
|
|
140
|
+
<div class="b-hero__media">
|
|
141
|
+
<img src={image.src} alt={image.alt ?? ''} loading="eager" decoding="async" />
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
</section>
|
|
145
|
+
|
|
146
|
+
<script>
|
|
147
|
+
// Moving hero backgrounds: pause button, reduced-motion, the slideshow timer, and an
|
|
148
|
+
// embedded (YouTube / Vimeo) background that loads only once the visitor consents.
|
|
149
|
+
import { hasConsent, onConsentChange } from '../../lib/consent-client';
|
|
150
|
+
import { playerStarted } from '../../lib/video';
|
|
151
|
+
const SLIDE_MS = 6000;
|
|
152
|
+
const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
153
|
+
for (const hero of document.querySelectorAll<HTMLElement>('.b-hero[data-motion]')) {
|
|
154
|
+
const button = hero.querySelector<HTMLButtonElement>('.b-hero__pause');
|
|
155
|
+
const video = hero.querySelector('video');
|
|
156
|
+
const slides = [...hero.querySelectorAll<HTMLElement>('.b-hero__slide')];
|
|
157
|
+
const embedSlot = hero.querySelector<HTMLElement>('.b-hero__embed');
|
|
158
|
+
let player: HTMLIFrameElement | null = null;
|
|
159
|
+
// Play / pause an embedded player by message, with no provider API script.
|
|
160
|
+
const command = (play: boolean) => {
|
|
161
|
+
if (!player?.contentWindow) return;
|
|
162
|
+
const msg = embedSlot!.dataset.provider === 'Vimeo'
|
|
163
|
+
? { method: play ? 'play' : 'pause' }
|
|
164
|
+
: { event: 'command', func: play ? 'playVideo' : 'pauseVideo', args: [] };
|
|
165
|
+
player.contentWindow.postMessage(JSON.stringify(msg), new URL(player.src).origin);
|
|
166
|
+
};
|
|
167
|
+
const loadPlayer = () => {
|
|
168
|
+
if (player || !embedSlot || reduce) return; // reduced motion keeps the still
|
|
169
|
+
player = document.createElement('iframe');
|
|
170
|
+
player.src = embedSlot.dataset.embedUrl!;
|
|
171
|
+
player.title = 'Background video';
|
|
172
|
+
player.tabIndex = -1;
|
|
173
|
+
player.setAttribute('aria-hidden', 'true');
|
|
174
|
+
player.allow = 'autoplay; encrypted-media; picture-in-picture';
|
|
175
|
+
// Keep the poster up until the player says it is PLAYING, then cross-fade: no black,
|
|
176
|
+
// loading player on screen. Ask it to report (YouTube 'listening' / Vimeo listener).
|
|
177
|
+
const provider = embedSlot.dataset.provider!;
|
|
178
|
+
const origin = new URL(player.src).origin;
|
|
179
|
+
window.addEventListener('message', (e) => {
|
|
180
|
+
if (e.origin !== origin || e.source !== player!.contentWindow) return;
|
|
181
|
+
if (playerStarted(provider, e.data)) embedSlot.classList.add('is-on');
|
|
182
|
+
});
|
|
183
|
+
player.addEventListener('load', () => {
|
|
184
|
+
const hello = provider === 'Vimeo' ? { method: 'addEventListener', value: 'play' } : { event: 'listening', id: 1, channel: 'widget' };
|
|
185
|
+
player!.contentWindow?.postMessage(JSON.stringify(hello), origin);
|
|
186
|
+
});
|
|
187
|
+
embedSlot.appendChild(player);
|
|
188
|
+
if (button) button.hidden = false;
|
|
189
|
+
sync();
|
|
190
|
+
};
|
|
191
|
+
let paused = reduce;
|
|
192
|
+
let visible = true;
|
|
193
|
+
let index = 0;
|
|
194
|
+
let timer: number | undefined;
|
|
195
|
+
|
|
196
|
+
const tick = () => {
|
|
197
|
+
slides[index].classList.remove('is-on');
|
|
198
|
+
index = (index + 1) % slides.length;
|
|
199
|
+
slides[index].classList.add('is-on');
|
|
200
|
+
};
|
|
201
|
+
const sync = () => {
|
|
202
|
+
const run = !paused && visible && !document.hidden;
|
|
203
|
+
if (video) {
|
|
204
|
+
if (run) void video.play().catch(() => {});
|
|
205
|
+
else video.pause();
|
|
206
|
+
}
|
|
207
|
+
if (player) command(run);
|
|
208
|
+
if (slides.length > 1) {
|
|
209
|
+
window.clearInterval(timer);
|
|
210
|
+
timer = run ? window.setInterval(tick, SLIDE_MS) : undefined;
|
|
211
|
+
}
|
|
212
|
+
if (button) {
|
|
213
|
+
button.setAttribute('aria-pressed', String(paused));
|
|
214
|
+
button.setAttribute('aria-label', paused ? 'Play background' : 'Pause background');
|
|
215
|
+
}
|
|
216
|
+
hero.toggleAttribute('data-paused', paused);
|
|
217
|
+
};
|
|
218
|
+
button?.addEventListener('click', () => { paused = !paused; sync(); });
|
|
219
|
+
document.addEventListener('visibilitychange', sync);
|
|
220
|
+
new IntersectionObserver(([e]) => { visible = e.isIntersecting; sync(); }).observe(hero);
|
|
221
|
+
if (embedSlot) {
|
|
222
|
+
// Warm the connection the moment it's allowed, so the video starts sooner.
|
|
223
|
+
const preconnect = () => {
|
|
224
|
+
const href = new URL(embedSlot.dataset.embedUrl!).origin;
|
|
225
|
+
if (document.querySelector(`link[rel="preconnect"][href="${href}"]`)) return;
|
|
226
|
+
const l = document.createElement('link');
|
|
227
|
+
l.rel = 'preconnect';
|
|
228
|
+
l.href = href;
|
|
229
|
+
document.head.appendChild(l);
|
|
230
|
+
};
|
|
231
|
+
if (hasConsent()) { preconnect(); loadPlayer(); }
|
|
232
|
+
onConsentChange((allowed) => { if (allowed) { preconnect(); loadPlayer(); } });
|
|
233
|
+
}
|
|
234
|
+
sync();
|
|
235
|
+
}
|
|
236
|
+
// Parallax: the background drifts more slowly than the page. Transform-based, so it works
|
|
237
|
+
// for an image, slides, a <video> or an embedded player alike. Off on touch devices
|
|
238
|
+
// (coarse pointers) and under reduced motion; only runs while the hero is on screen.
|
|
239
|
+
const fine = window.matchMedia('(pointer: fine)').matches;
|
|
240
|
+
for (const hero of document.querySelectorAll<HTMLElement>('.b-hero[data-parallax]')) {
|
|
241
|
+
const bg = hero.querySelector<HTMLElement>('.b-hero__bg');
|
|
242
|
+
if (!bg || reduce || !fine) continue;
|
|
243
|
+
hero.classList.add('is-parallax');
|
|
244
|
+
let ticking = false;
|
|
245
|
+
let onScreen = true;
|
|
246
|
+
const move = () => {
|
|
247
|
+
ticking = false;
|
|
248
|
+
const top = hero.getBoundingClientRect().top;
|
|
249
|
+
bg.style.transform = `translate3d(0, ${Math.round(Math.max(0, -top) * 0.35)}px, 0)`;
|
|
250
|
+
};
|
|
251
|
+
const queue = () => { if (onScreen && !ticking) { ticking = true; requestAnimationFrame(move); } };
|
|
252
|
+
new IntersectionObserver(([e]) => { onScreen = e.isIntersecting; if (onScreen) queue(); }).observe(hero);
|
|
253
|
+
window.addEventListener('scroll', queue, { passive: true });
|
|
254
|
+
move();
|
|
255
|
+
}
|
|
256
|
+
</script>
|
|
257
|
+
|
|
258
|
+
<style>
|
|
259
|
+
.b-hero {
|
|
260
|
+
display: grid;
|
|
261
|
+
gap: 2rem;
|
|
262
|
+
padding-block: 3rem;
|
|
263
|
+
}
|
|
264
|
+
@media (min-width: 48em) {
|
|
265
|
+
.b-hero[data-layout='split'] {
|
|
266
|
+
grid-template-columns: 1fr 1fr;
|
|
267
|
+
align-items: center;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
.b-hero__text {
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-direction: column;
|
|
273
|
+
gap: 1rem;
|
|
274
|
+
}
|
|
275
|
+
.b-hero[data-layout='centered'] .b-hero__text {
|
|
276
|
+
max-width: var(--max);
|
|
277
|
+
margin-inline: auto;
|
|
278
|
+
align-items: center;
|
|
279
|
+
text-align: center;
|
|
280
|
+
}
|
|
281
|
+
.b-hero__eyebrow {
|
|
282
|
+
margin: 0;
|
|
283
|
+
text-transform: uppercase;
|
|
284
|
+
letter-spacing: 0.12em;
|
|
285
|
+
font-size: 0.8125rem;
|
|
286
|
+
font-weight: 600;
|
|
287
|
+
color: var(--gold);
|
|
288
|
+
}
|
|
289
|
+
.b-hero__subtitle {
|
|
290
|
+
margin: 0;
|
|
291
|
+
font-size: 1.125rem;
|
|
292
|
+
line-height: 1.6;
|
|
293
|
+
color: var(--muted);
|
|
294
|
+
max-width: var(--max);
|
|
295
|
+
}
|
|
296
|
+
.b-hero__cta {
|
|
297
|
+
margin-top: 0.5rem;
|
|
298
|
+
}
|
|
299
|
+
/* The title as a picture (a wordmark): a width step on desktop, capped to the screen on
|
|
300
|
+
phones and to its column, never cropped; height follows the picture's own shape. */
|
|
301
|
+
.b-hero__title-image {
|
|
302
|
+
display: block;
|
|
303
|
+
width: min(var(--title-image-w, 32.5rem), 85vw);
|
|
304
|
+
max-width: 100%;
|
|
305
|
+
height: auto;
|
|
306
|
+
margin-inline: auto;
|
|
307
|
+
}
|
|
308
|
+
.b-hero__title-image[data-width='small'] { --title-image-w: 20rem; }
|
|
309
|
+
.b-hero__title-image[data-width='large'] { --title-image-w: 47.5rem; }
|
|
310
|
+
.b-hero[data-layout='split'] .b-hero__title-image { margin-inline: 0; }
|
|
311
|
+
/* A large wordmark may be wider than the text measure; the subtitle keeps its own. */
|
|
312
|
+
.b-hero[data-layout] .b-hero__text:has(.b-hero__title-image) { max-width: max(var(--max), 47.5rem); }
|
|
313
|
+
.b-hero__title-image[data-shadow] { filter: drop-shadow(var(--shadow-logo)); }
|
|
314
|
+
|
|
315
|
+
/* ── Mesh background: a soft, slowly drifting brand gradient behind the text.
|
|
316
|
+
Low opacity + blur keeps normal (dark) text perfectly readable. ── */
|
|
317
|
+
.b-hero[data-bg='mesh'] {
|
|
318
|
+
position: relative;
|
|
319
|
+
isolation: isolate;
|
|
320
|
+
overflow: hidden;
|
|
321
|
+
border-radius: var(--radius);
|
|
322
|
+
padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 4vw, 3rem);
|
|
323
|
+
}
|
|
324
|
+
.b-hero__mesh {
|
|
325
|
+
position: absolute;
|
|
326
|
+
inset: 0;
|
|
327
|
+
z-index: -1;
|
|
328
|
+
background: var(--bg);
|
|
329
|
+
}
|
|
330
|
+
.b-hero__mesh::before {
|
|
331
|
+
content: '';
|
|
332
|
+
position: absolute;
|
|
333
|
+
inset: -25%;
|
|
334
|
+
background:
|
|
335
|
+
radial-gradient(35% 45% at 20% 25%, var(--gold), transparent 70%),
|
|
336
|
+
radial-gradient(35% 45% at 80% 20%, var(--accent-2, var(--gold)), transparent 70%),
|
|
337
|
+
radial-gradient(40% 50% at 65% 85%, var(--gold-light), transparent 70%);
|
|
338
|
+
opacity: 0.35;
|
|
339
|
+
filter: blur(50px);
|
|
340
|
+
animation: b-hero-mesh 20s ease-in-out infinite alternate;
|
|
341
|
+
}
|
|
342
|
+
@keyframes b-hero-mesh {
|
|
343
|
+
from { transform: translate3d(-3%, -2%, 0) scale(1.05); }
|
|
344
|
+
to { transform: translate3d(3%, 4%, 0) scale(1.18); }
|
|
345
|
+
}
|
|
346
|
+
@media (prefers-reduced-motion: reduce) {
|
|
347
|
+
.b-hero__mesh::before { animation: none; }
|
|
348
|
+
}
|
|
349
|
+
.b-hero__media img {
|
|
350
|
+
display: block;
|
|
351
|
+
width: 100%;
|
|
352
|
+
height: auto;
|
|
353
|
+
border-radius: 8px;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/* ── Media layout: image / slideshow / video background with a legibility scrim ── */
|
|
357
|
+
.b-hero[data-layout='media'] {
|
|
358
|
+
position: relative;
|
|
359
|
+
min-height: min(68vh, 38rem);
|
|
360
|
+
display: grid;
|
|
361
|
+
place-items: center;
|
|
362
|
+
text-align: center;
|
|
363
|
+
padding: clamp(3rem, 8vw, 6rem) 1.5rem;
|
|
364
|
+
/* --hero-clear: the room a header logo hanging over this opener needs (Base). */
|
|
365
|
+
padding-top: max(clamp(3rem, 8vw, 6rem), var(--hero-clear, 0px));
|
|
366
|
+
border-radius: var(--radius);
|
|
367
|
+
overflow: hidden;
|
|
368
|
+
isolation: isolate;
|
|
369
|
+
}
|
|
370
|
+
/* A narrow band for a short, wide header strip: close to the strip's own shape, so it
|
|
371
|
+
isn't cropped to its middle and blown up. Less padding and a smaller title to fit. */
|
|
372
|
+
.b-hero[data-size='compact'] {
|
|
373
|
+
min-height: clamp(8rem, 18vw, 16rem);
|
|
374
|
+
padding-block: clamp(1.25rem, 3vw, 2.25rem);
|
|
375
|
+
padding-top: max(clamp(1.25rem, 3vw, 2.25rem), var(--hero-clear, 0px));
|
|
376
|
+
}
|
|
377
|
+
.b-hero[data-size='compact'] :global(h1) {
|
|
378
|
+
font-size: clamp(1.6rem, 3.4vw, 2.6rem);
|
|
379
|
+
}
|
|
380
|
+
/* Edge to edge across the screen, like a full-bleed banner. */
|
|
381
|
+
.b-hero[data-full-bleed='true'] {
|
|
382
|
+
width: 100vw;
|
|
383
|
+
margin-inline: calc(50% - 50vw);
|
|
384
|
+
border-radius: 0;
|
|
385
|
+
}
|
|
386
|
+
.b-hero[data-size='tall'] {
|
|
387
|
+
min-height: min(85vh, 52rem);
|
|
388
|
+
}
|
|
389
|
+
/* The full first screen below the sticky header, edge to edge — breaks out of the page
|
|
390
|
+
column. --header-h is the header's measured full height (SiteHeader); the fallback is
|
|
391
|
+
its usual height until that runs. */
|
|
392
|
+
.b-hero[data-size='screen'] {
|
|
393
|
+
width: 100vw;
|
|
394
|
+
margin-inline: calc(50% - 50vw);
|
|
395
|
+
min-height: calc(100svh - var(--header-h, 60px));
|
|
396
|
+
border-radius: 0;
|
|
397
|
+
}
|
|
398
|
+
@media (min-width: 64em) {
|
|
399
|
+
.b-hero[data-size='screen'] {
|
|
400
|
+
min-height: calc(100svh - var(--header-h, 64px));
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
.b-hero__bg {
|
|
404
|
+
position: absolute;
|
|
405
|
+
inset: 0;
|
|
406
|
+
z-index: -1;
|
|
407
|
+
background-color: var(--bg-section);
|
|
408
|
+
}
|
|
409
|
+
/* The picture (and each rotating slide) covers the band, framed by `focus`. */
|
|
410
|
+
.b-hero__img,
|
|
411
|
+
.b-hero__slide {
|
|
412
|
+
position: absolute;
|
|
413
|
+
inset: 0;
|
|
414
|
+
width: 100%;
|
|
415
|
+
height: 100%;
|
|
416
|
+
object-fit: cover;
|
|
417
|
+
object-position: var(--hero-focus, center);
|
|
418
|
+
display: block;
|
|
419
|
+
max-width: none;
|
|
420
|
+
}
|
|
421
|
+
/* Parallax: give the background room to drift (up to 35% of the hero) without uncovering
|
|
422
|
+
an edge. The room is split evenly above and below, so at rest the picture or video is
|
|
423
|
+
centred on the hero, not pushed down by the extra room. Any gap the drift opens at the
|
|
424
|
+
top stays above the screen. */
|
|
425
|
+
.b-hero.is-parallax .b-hero__bg {
|
|
426
|
+
inset: -17.5% 0 -17.5% 0;
|
|
427
|
+
will-change: transform;
|
|
428
|
+
}
|
|
429
|
+
.b-hero__bg video {
|
|
430
|
+
width: 100%;
|
|
431
|
+
height: 100%;
|
|
432
|
+
object-fit: cover;
|
|
433
|
+
object-position: var(--hero-focus, center);
|
|
434
|
+
}
|
|
435
|
+
/* An embedded background player, sized to COVER the hero like object-fit (16:9 kept,
|
|
436
|
+
overflow cropped). Never interactive; fades in once it has started. */
|
|
437
|
+
.b-hero__embed {
|
|
438
|
+
position: absolute;
|
|
439
|
+
inset: 0;
|
|
440
|
+
overflow: hidden;
|
|
441
|
+
pointer-events: none;
|
|
442
|
+
container-type: size;
|
|
443
|
+
opacity: 0;
|
|
444
|
+
transition: opacity 1.2s ease;
|
|
445
|
+
}
|
|
446
|
+
.b-hero__embed.is-on {
|
|
447
|
+
opacity: 1;
|
|
448
|
+
}
|
|
449
|
+
.b-hero__embed :global(iframe) {
|
|
450
|
+
position: absolute;
|
|
451
|
+
top: 50%;
|
|
452
|
+
left: 50%;
|
|
453
|
+
width: max(100cqw, 177.78cqh);
|
|
454
|
+
height: max(100cqh, 56.25cqw);
|
|
455
|
+
max-width: none; /* the global media reset caps iframes at 100%: cover must overflow */
|
|
456
|
+
transform: translate(-50%, -50%);
|
|
457
|
+
border: 0;
|
|
458
|
+
}
|
|
459
|
+
.b-hero__pause[hidden] {
|
|
460
|
+
display: none;
|
|
461
|
+
}
|
|
462
|
+
.b-hero__slide {
|
|
463
|
+
opacity: 0;
|
|
464
|
+
transition: opacity 1.6s ease-in-out;
|
|
465
|
+
}
|
|
466
|
+
.b-hero__slide.is-on {
|
|
467
|
+
opacity: 1;
|
|
468
|
+
}
|
|
469
|
+
@media (prefers-reduced-motion: reduce) {
|
|
470
|
+
.b-hero__slide { transition: none; }
|
|
471
|
+
}
|
|
472
|
+
.b-hero__scrim {
|
|
473
|
+
position: absolute;
|
|
474
|
+
inset: 0;
|
|
475
|
+
background: rgba(8, 10, 18, var(--hero-overlay, 0.45));
|
|
476
|
+
}
|
|
477
|
+
.b-hero[data-layout='media'] .b-hero__text {
|
|
478
|
+
max-width: var(--max);
|
|
479
|
+
align-items: center;
|
|
480
|
+
color: #fff;
|
|
481
|
+
}
|
|
482
|
+
.b-hero[data-layout='media'] .b-hero__subtitle {
|
|
483
|
+
color: rgba(255, 255, 255, 0.9);
|
|
484
|
+
margin-inline: auto;
|
|
485
|
+
}
|
|
486
|
+
.b-hero[data-layout='media'] .b-hero__eyebrow {
|
|
487
|
+
color: #fff;
|
|
488
|
+
opacity: 0.9;
|
|
489
|
+
}
|
|
490
|
+
.b-hero[data-layout='media'] :global(h1) {
|
|
491
|
+
color: #fff;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/* ── A picture shown whole (media.fit "contain"), e.g. a designed poster: never cropped,
|
|
495
|
+
edge to edge with `screen` or `fullBleed`, and as tall as the picture, not the screen.
|
|
496
|
+
The band takes the picture's shape (--hero-ratio, when the build read it; otherwise the
|
|
497
|
+
picture's own height as it loads). No scrim; the words sit below it, in the page's
|
|
498
|
+
colours, and keep clear of a header logo hanging over a short poster (--hero-clear). ── */
|
|
499
|
+
.b-hero[data-layout='media'][data-fit='contain'] {
|
|
500
|
+
display: flex;
|
|
501
|
+
flex-direction: column;
|
|
502
|
+
gap: 0;
|
|
503
|
+
min-height: 0;
|
|
504
|
+
padding: 0;
|
|
505
|
+
}
|
|
506
|
+
.b-hero[data-fit='contain'] .b-hero__bg {
|
|
507
|
+
position: relative;
|
|
508
|
+
inset: auto;
|
|
509
|
+
z-index: auto;
|
|
510
|
+
aspect-ratio: var(--hero-ratio, auto);
|
|
511
|
+
background-color: transparent;
|
|
512
|
+
}
|
|
513
|
+
.b-hero[data-fit='contain'] .b-hero__img,
|
|
514
|
+
.b-hero[data-fit='contain'] .b-hero__slide {
|
|
515
|
+
object-fit: contain;
|
|
516
|
+
}
|
|
517
|
+
.b-hero[data-fit='contain'] .b-hero__img,
|
|
518
|
+
.b-hero[data-fit='contain'] .b-hero__slide:first-of-type {
|
|
519
|
+
position: relative;
|
|
520
|
+
height: auto;
|
|
521
|
+
}
|
|
522
|
+
.b-hero[data-layout='media'][data-fit='contain'] .b-hero__text {
|
|
523
|
+
align-self: center;
|
|
524
|
+
padding: clamp(1.5rem, 4vw, 2.5rem) 1.5rem 0;
|
|
525
|
+
margin-top: max(0px, calc(var(--hero-clear, 0px) - 100vw / (var(--hero-ratio, 0.0001))));
|
|
526
|
+
color: var(--fg);
|
|
527
|
+
}
|
|
528
|
+
.b-hero[data-fit='contain'] .b-hero__text[data-words='none'] {
|
|
529
|
+
padding: 0;
|
|
530
|
+
margin: 0;
|
|
531
|
+
}
|
|
532
|
+
.b-hero[data-layout='media'][data-fit='contain'] .b-hero__subtitle {
|
|
533
|
+
color: var(--muted);
|
|
534
|
+
}
|
|
535
|
+
.b-hero[data-layout='media'][data-fit='contain'] .b-hero__eyebrow {
|
|
536
|
+
color: var(--gold);
|
|
537
|
+
opacity: 1;
|
|
538
|
+
}
|
|
539
|
+
.b-hero[data-layout='media'][data-fit='contain'] :global(h1) {
|
|
540
|
+
color: var(--fg);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/* A linked background: the whole picture opens the full video; the text and
|
|
544
|
+
its CTA stay clickable on top, and a visible cue carries the keyboard link. */
|
|
545
|
+
.b-hero__bglink {
|
|
546
|
+
position: absolute;
|
|
547
|
+
inset: 0;
|
|
548
|
+
z-index: 0;
|
|
549
|
+
cursor: pointer;
|
|
550
|
+
}
|
|
551
|
+
.b-hero[data-linked] .b-hero__text {
|
|
552
|
+
position: relative;
|
|
553
|
+
z-index: 1;
|
|
554
|
+
pointer-events: none;
|
|
555
|
+
}
|
|
556
|
+
.b-hero[data-linked] .b-hero__text :global(a),
|
|
557
|
+
.b-hero[data-linked] .b-hero__text :global(button) {
|
|
558
|
+
pointer-events: auto;
|
|
559
|
+
}
|
|
560
|
+
.b-hero__watch {
|
|
561
|
+
position: absolute;
|
|
562
|
+
left: clamp(0.75rem, 2vw, 1.25rem);
|
|
563
|
+
bottom: clamp(0.75rem, 2vw, 1.25rem);
|
|
564
|
+
z-index: 2;
|
|
565
|
+
display: inline-flex;
|
|
566
|
+
align-items: center;
|
|
567
|
+
gap: 0.5rem;
|
|
568
|
+
padding: 0.5rem 0.9rem;
|
|
569
|
+
border-radius: 999px;
|
|
570
|
+
border: 1px solid rgba(255, 255, 255, 0.55);
|
|
571
|
+
background: rgba(8, 10, 18, 0.45);
|
|
572
|
+
color: #fff;
|
|
573
|
+
font-size: 0.875rem;
|
|
574
|
+
font-weight: 600;
|
|
575
|
+
text-decoration: none;
|
|
576
|
+
}
|
|
577
|
+
.b-hero__watch:hover {
|
|
578
|
+
background: rgba(8, 10, 18, 0.65);
|
|
579
|
+
}
|
|
580
|
+
.b-hero__watch:focus-visible {
|
|
581
|
+
outline: 3px solid #fff;
|
|
582
|
+
outline-offset: 2px;
|
|
583
|
+
}
|
|
584
|
+
.b-hero__watch-icon {
|
|
585
|
+
width: 0;
|
|
586
|
+
height: 0;
|
|
587
|
+
border-block: 0.35rem solid transparent;
|
|
588
|
+
border-inline-start: 0.6rem solid currentColor;
|
|
589
|
+
}
|
|
590
|
+
/* Read by screen readers, not shown: the watch link's note, and a hidden title (titleHidden). */
|
|
591
|
+
.b-hero__sr,
|
|
592
|
+
.b-hero[data-title-hidden] :global(h1) {
|
|
593
|
+
position: absolute;
|
|
594
|
+
width: 1px;
|
|
595
|
+
height: 1px;
|
|
596
|
+
overflow: hidden;
|
|
597
|
+
clip-path: inset(50%);
|
|
598
|
+
white-space: nowrap;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/* Pause / play for moving backgrounds — small, quiet, always reachable. */
|
|
602
|
+
.b-hero__pause {
|
|
603
|
+
position: absolute;
|
|
604
|
+
z-index: 2;
|
|
605
|
+
right: clamp(0.75rem, 2vw, 1.25rem);
|
|
606
|
+
bottom: clamp(0.75rem, 2vw, 1.25rem);
|
|
607
|
+
width: 2.5rem;
|
|
608
|
+
height: 2.5rem;
|
|
609
|
+
display: grid;
|
|
610
|
+
place-items: center;
|
|
611
|
+
border-radius: 50%;
|
|
612
|
+
border: 1px solid rgba(255, 255, 255, 0.55);
|
|
613
|
+
background: rgba(8, 10, 18, 0.45);
|
|
614
|
+
color: #fff;
|
|
615
|
+
cursor: pointer;
|
|
616
|
+
}
|
|
617
|
+
.b-hero__pause:hover {
|
|
618
|
+
background: rgba(8, 10, 18, 0.65);
|
|
619
|
+
}
|
|
620
|
+
.b-hero__pause:focus-visible {
|
|
621
|
+
outline: 3px solid #fff;
|
|
622
|
+
outline-offset: 2px;
|
|
623
|
+
}
|
|
624
|
+
/* Two bars (pause) → a triangle (play) when paused. */
|
|
625
|
+
.b-hero__pause-icon {
|
|
626
|
+
width: 0.75rem;
|
|
627
|
+
height: 0.875rem;
|
|
628
|
+
border-inline: 0.25rem solid currentColor;
|
|
629
|
+
}
|
|
630
|
+
.b-hero[data-paused] .b-hero__pause-icon {
|
|
631
|
+
width: 0;
|
|
632
|
+
height: 0;
|
|
633
|
+
border-inline: 0;
|
|
634
|
+
border-block: 0.45rem solid transparent;
|
|
635
|
+
border-inline-start: 0.75rem solid currentColor;
|
|
636
|
+
margin-inline-start: 0.2rem;
|
|
637
|
+
}
|
|
638
|
+
</style>
|