Files
AndreaSlopFotografie/web/src/content/heroContent.ts
T
SluijsensandClaude Sonnet 5.5 ad0b114828 Hero from the CMS: markers HERO-HTML and HERO-PRELOAD, hero key in the data block, picture per ratio, baked fallback
The prerendered hero is plain HTML between the markers (first photo, h1, buttons), the slider takes over after hydration with the hero of the host block, the API or the build. The head preload is added to the finished HTML. Hero texts move into nl.json. The stand-in host and the e2e tests cover the hero.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 16:48:00 +01:00

116 lines
2.7 KiB
TypeScript

import { t } from '../i18n/index.ts';
import type { HeroData, HeroSlide } from '../lib/hero.ts';
// Images
import hero1 from '../assets/hero-1.jpg';
import hero2 from '../assets/hero-2.jpg';
import hero3 from '../assets/hero-3.jpg';
import hero4 from '../assets/hero-4.jpg';
import hero5 from '../assets/hero-5.jpg';
import hero6 from '../assets/hero-6.jpg';
import hero7 from '../assets/hero-7.jpg';
import hero8 from '../assets/hero-8.jpg';
// The hero the build bakes into the page: what the visitor sees until the CMS
// host (or the API) gives another one, and again when that fails. The same
// shape as what the CMS gives (lib/hero), so one component shows both. The
// photos have no wide/tall variants: the plain file is used everywhere.
// focus: where the subject is (0..1), used as object-position.
const slide = (
id: string,
src: string,
alt: string,
width: number,
height: number,
x: number,
y: number,
): HeroSlide => ({
id,
alt,
decorative: false,
image: { width, height, focus: { x, y }, src, variants: [] },
});
const heroContent: HeroData = {
display: 'slideshow',
title: t('hero.baked.title'),
tagline: t('hero.baked.tagline'),
buttons: [{ label: t('hero.baked.button'), target: '/over-mij' }],
slides: [
slide(
'hero-8',
hero8,
t('hero.baked.alt.hero8'),
1600,
1067,
0.5,
0.55,
),
slide(
'hero-7',
hero7,
t('hero.baked.alt.hero7'),
1600,
1067,
0.45,
0.5,
),
slide(
'hero-1',
hero1,
t('hero.baked.alt.hero1'),
2560,
1702,
0.55,
0.6,
),
slide(
'hero-2',
hero2,
t('hero.baked.alt.hero2'),
1600,
1067,
0.45,
0.45,
),
slide(
'hero-3',
hero3,
t('hero.baked.alt.hero3'),
1600,
1067,
0.45,
0.4,
),
slide(
'hero-4',
hero4,
t('hero.baked.alt.hero4'),
2048,
1362,
0.45,
0.35,
),
slide(
'hero-5',
hero5,
t('hero.baked.alt.hero5'),
1600,
1067,
0.5,
0.55,
),
slide(
'hero-6',
hero6,
t('hero.baked.alt.hero6'),
2048,
1362,
0.5,
0.35,
),
],
};
export default heroContent;