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>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { screen, within } from '@testing-library/react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import type { ContentImage } from '@/content/types';
|
||||
import { axeResults } from '@/test/axe';
|
||||
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||
import PhotoDuo from './PhotoDuo';
|
||||
|
||||
const photos: [ContentImage, ContentImage] = [
|
||||
{
|
||||
src: '/concert.jpg',
|
||||
alt: 'Concert vanaf het podium',
|
||||
width: 1200,
|
||||
height: 798,
|
||||
},
|
||||
{ src: '/kat.jpg', alt: 'Slapende grijze kat', width: 1200, height: 800 },
|
||||
];
|
||||
|
||||
describe('PhotoDuo', () => {
|
||||
it('shows both photos in a named list', async () => {
|
||||
const { container } = await renderWithProviders(
|
||||
<PhotoDuo photos={photos} label="Foto's" />,
|
||||
);
|
||||
const list = screen.getByRole('list', { name: "Foto's" });
|
||||
const images = within(list).getAllByRole('img');
|
||||
expect(images).toHaveLength(2);
|
||||
expect(images[0]).toHaveAccessibleName('Concert vanaf het podium');
|
||||
expect(images[1]).toHaveAccessibleName('Slapende grijze kat');
|
||||
expect(images[0]).toHaveAttribute('width', '1200');
|
||||
expect(images[0]).toHaveAttribute('height', '798');
|
||||
expect(await axeResults(container)).toHaveNoViolations();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,59 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user