Lazy load media
This commit is contained in:
parent
c09f576cc1
commit
848ccf0ff3
3 changed files with 5 additions and 1 deletions
|
|
@ -16,8 +16,11 @@ export const generate = ({
|
||||||
}): html => `
|
}): html => `
|
||||||
${container ? `<div class="figure-container">` : ''}
|
${container ? `<div class="figure-container">` : ''}
|
||||||
<img tabindex="0"
|
<img tabindex="0"
|
||||||
|
loading="lazy"
|
||||||
srcset="${image.srcSet}"
|
srcset="${image.srcSet}"
|
||||||
sizes="${sizes}"
|
sizes="${sizes}"
|
||||||
|
width="${image.width}"
|
||||||
|
height="${image.height}"
|
||||||
src="${last(image.images)?.path}"
|
src="${last(image.images)?.path}"
|
||||||
alt="${alt}"
|
alt="${alt}"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ export const generate = ({
|
||||||
container: boolean;
|
container: boolean;
|
||||||
}): html => `
|
}): html => `
|
||||||
${container ? `<div class="figure-container">` : ''}
|
${container ? `<div class="figure-container">` : ''}
|
||||||
<video ${options} ${poster ? `poster="${poster}` : ''}" >
|
<video loading="lazy" ${options} ${poster ? `poster="${poster}` : ''}" >
|
||||||
<source src="${webm}" type="video/webm"/>
|
<source src="${webm}" type="video/webm"/>
|
||||||
<source src="${mp4}" type="video/mp4"/>
|
<source src="${mp4}" type="video/mp4"/>
|
||||||
</video>
|
</video>
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ html {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: -2;
|
z-index: -2;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue