Files
AndreaSlopFotografie/web/src/components/PhotoDuo/PhotoDuo.tsx
T
SluijsensandClaude Opus 5.5 e15215393e Adds the Over mij page
Replaces the placeholder with the page from the design and the texts from
the live site: Andrea's introduction with her portrait, how it started,
two photos, life outside photography and a booking button. The page is
now indexed, with its own title, description, preview image and AboutPage
data about Andrea.

The portrait loads straight away instead of after the page, since on
phones it is the largest paint. Lighthouse no longer lets every indexed
page use the homepage's lower mobile performance target; it now only
applies to the homepage itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 01:17:33 +02:00

60 lines
2.2 KiB
TypeScript

import { chakra } from '@chakra-ui/react';
import DeferredImage from '@/components/DeferredImage/DeferredImage';
import Reveal from '@/components/Reveal/Reveal';
import type { ContentImage } from '@/content/types';
type PhotoDuoProps = {
photos: [ContentImage, ContentImage];
// Accessible name of the photo list, e.g. "Foto's"
label: string;
'data-testid'?: string;
};
// Two landscape photos side by side (design .intro-gallery--duo), one below
// the other on phones. Each zooms in gently on hover, as in the homepage
// gallery, except with reduced motion.
export default function PhotoDuo({
photos,
label,
'data-testid': testId,
}: PhotoDuoProps) {
return (
<Reveal>
<chakra.ul
listStyleType="none"
aria-label={label}
data-testid={testId}
display="grid"
gridTemplateColumns={{ base: '1fr', sm: 'repeat(2, 1fr)' }}
gap="gridGap"
>
{photos.map((photo) => (
<chakra.li key={photo.src}>
<chakra.figure
overflow="hidden"
// Shown until the deferred photo arrives
bg="paper.deep"
css={{
'&:hover img': { transform: 'scale(1.05)' },
}}
>
<DeferredImage
image={photo}
display="block"
w="100%"
h="auto"
aspectRatio="3 / 2"
objectFit="cover"
transitionProperty="transform"
transitionDuration="fade"
transitionTimingFunction="smooth"
_motionReduce={{ transition: 'none' }}
/>
</chakra.figure>
</chakra.li>
))}
</chakra.ul>
</Reveal>
);
}