mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-24 18:25:41 +03:00
Add lazy loading to all images
This commit is contained in:
parent
767b092ac6
commit
45b7d42d38
1 changed files with 4 additions and 0 deletions
|
@ -81,6 +81,7 @@ function Media({ media, showOriginal, onClick }) {
|
|||
alt={description}
|
||||
width={width}
|
||||
height={height}
|
||||
loading="lazy"
|
||||
style={
|
||||
!showOriginal && {
|
||||
backgroundColor:
|
||||
|
@ -163,6 +164,7 @@ function Media({ media, showOriginal, onClick }) {
|
|||
alt={description}
|
||||
width={width}
|
||||
height={height}
|
||||
loading="lazy"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
@ -215,6 +217,7 @@ function Card({ card }) {
|
|||
src={image}
|
||||
width={width}
|
||||
height={height}
|
||||
loading="lazy"
|
||||
alt=""
|
||||
onError={() => {
|
||||
this.style.display = 'none';
|
||||
|
@ -245,6 +248,7 @@ function Card({ card }) {
|
|||
width={width}
|
||||
height={height}
|
||||
alt={title || description}
|
||||
loading="lazy"
|
||||
style={{
|
||||
height: 'auto',
|
||||
aspectRatio: `${width}/${height}`,
|
||||
|
|
Loading…
Reference in a new issue