Skip to content

Commit

Permalink
[Feature] Add webp loading option.
Browse files Browse the repository at this point in the history
  • Loading branch information
HamsterCoder committed Jan 19, 2024
1 parent 86a31e9 commit 4d36911
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/Picture/Picture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ export const Picture: FunctionComponent<PictureProps> = ({
data-selected={selected}
onClick={onClick}
>
<Image
src={`assets/${image}.jpg`}
alt={image}
title={dictionary[image]}
/>
<picture>
<source srcSet={`assets/${image}.webp`} type="image/webp" />
<Image
src={`assets/${image}.jpg`}
alt={image}
title={dictionary[image]}
/>
</picture>
</Container>
);
};

0 comments on commit 4d36911

Please sign in to comment.