Adds the introduction block with a framed photo of Andrea and a link to the about page. Brings in FramedImage and an underline link variant for the later blocks, and narrows the load margin of deferred photos so nothing below the hero starts loading before the hero has painted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.5 KiB
TypeScript
46 lines
1.5 KiB
TypeScript
import { Box } from '@chakra-ui/react';
|
|
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
|
import type { ContentImage } from '@/content/types';
|
|
|
|
type FramedImageProps = {
|
|
image: ContentImage;
|
|
// CSS aspect ratio of the visible crop, e.g. '4 / 3'
|
|
aspectRatio: string;
|
|
};
|
|
|
|
// 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) {
|
|
return (
|
|
<Box
|
|
position="relative"
|
|
// Own stacking context, so the block can sit behind the photo
|
|
isolation="isolate"
|
|
_before={{
|
|
content: '""',
|
|
display: { base: 'none', sm: 'block' },
|
|
position: 'absolute',
|
|
left: '-1.5rem',
|
|
bottom: '-1.5rem',
|
|
width: '55%',
|
|
height: '55%',
|
|
bg: 'sand',
|
|
zIndex: -1,
|
|
}}
|
|
>
|
|
<DeferredImage
|
|
image={image}
|
|
display="block"
|
|
w="100%"
|
|
h="auto"
|
|
aspectRatio={aspectRatio}
|
|
objectFit="cover"
|
|
// Shown until the deferred photo arrives
|
|
bg="paper.deep"
|
|
/>
|
|
</Box>
|
|
);
|
|
}
|