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:
@@ -1,4 +1,4 @@
|
||||
import { Box } from '@chakra-ui/react';
|
||||
import { Box, Image, type ImageProps } from '@chakra-ui/react';
|
||||
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
||||
import type { ContentImage } from '@/content/types';
|
||||
|
||||
@@ -6,13 +6,30 @@ type FramedImageProps = {
|
||||
image: ContentImage;
|
||||
// CSS aspect ratio of the visible crop, e.g. '4 / 3'
|
||||
aspectRatio: string;
|
||||
// For a photo at the top of a page, likely the largest paint: load it
|
||||
// straight away with high priority instead of after the page has loaded
|
||||
priority?: boolean;
|
||||
};
|
||||
|
||||
// A photo with a soft sand-coloured block offset behind its lower left
|
||||
// corner (design .about__media). The block is pure decoration (a CSS
|
||||
// pseudo-element), so assistive technology never announces it. On phones it
|
||||
// is left out, since it would stick out past the page edge.
|
||||
export default function FramedImage({ image, aspectRatio }: FramedImageProps) {
|
||||
export default function FramedImage({
|
||||
image,
|
||||
aspectRatio,
|
||||
priority = false,
|
||||
}: FramedImageProps) {
|
||||
const style: ImageProps = {
|
||||
display: 'block',
|
||||
w: '100%',
|
||||
h: 'auto',
|
||||
aspectRatio,
|
||||
objectFit: 'cover',
|
||||
// Shown until the photo arrives
|
||||
bg: 'paper.deep',
|
||||
};
|
||||
|
||||
return (
|
||||
<Box
|
||||
position="relative"
|
||||
@@ -30,16 +47,19 @@ export default function FramedImage({ image, aspectRatio }: FramedImageProps) {
|
||||
zIndex: -1,
|
||||
}}
|
||||
>
|
||||
<DeferredImage
|
||||
image={image}
|
||||
display="block"
|
||||
w="100%"
|
||||
h="auto"
|
||||
aspectRatio={aspectRatio}
|
||||
objectFit="cover"
|
||||
// Shown until the deferred photo arrives
|
||||
bg="paper.deep"
|
||||
/>
|
||||
{priority ? (
|
||||
<Image
|
||||
src={image.src}
|
||||
alt={image.alt}
|
||||
htmlWidth={image.width}
|
||||
htmlHeight={image.height}
|
||||
fetchPriority="high"
|
||||
decoding="async"
|
||||
{...style}
|
||||
/>
|
||||
) : (
|
||||
<DeferredImage image={image} {...style} />
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user