Skip to content

Commit

Permalink
Fix example swapOnLoad
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend-Master committed Aug 13, 2024
1 parent 1d6d480 commit cc05950
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ By default, this will transform the image into a jpeg source and a webp source a
class="native-ideal-img"
style="--lqip: url(data:image/webp;base64,UklGRj4AAABXRUJQVlA4IDIAAADQAQCdASoQAAwABUB8JZQAAudcoVPyIAD+uVyF4iJZsGTWpdieB7utExa6oMeh0PusAA==);"
>
<source srcset="assets/native-ideal-image/some-image-b0600-2160.webp 2160w" type="image/webp" />
<source srcset="assets/native-ideal-image/some-image-4cb20-2160.jpeg 2160w" type="image/jpeg" />
<source srcset="assets/native-ideal-image/some-image-b0600-2160.webp" type="image/webp" />
<source srcset="assets/native-ideal-image/some-image-6ee75-2160.jpeg" type="image/jpeg" />
<img loading="lazy" sizes="auto" width="2160" height="1620" />
</picture>
```
Expand Down
2 changes: 1 addition & 1 deletion example/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const config: Config = {
{
presets: {
card: {
sizes: [600, 1000],
sizes: [600, 800, 1000],
formats: ['avif', 'webp', 'jpeg'],
},
},
Expand Down
6 changes: 5 additions & 1 deletion example/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ export default function Home(): JSX.Element {
function Card(props: { name: string; image: LoaderOutput; swapOnLoad?: boolean }) {
return (
<div className={clsx(styles.card, 'pagination-nav__link')}>
<NativeIdealImage img={props.image} className={styles.cardImage} />
<NativeIdealImage
img={props.image}
className={styles.cardImage}
swapOnLoad={props.swapOnLoad}
/>
<div>{props.name}</div>
</div>
)
Expand Down

0 comments on commit cc05950

Please sign in to comment.