mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 02:35:39 +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}
|
alt={description}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
|
loading="lazy"
|
||||||
style={
|
style={
|
||||||
!showOriginal && {
|
!showOriginal && {
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
|
@ -163,6 +164,7 @@ function Media({ media, showOriginal, onClick }) {
|
||||||
alt={description}
|
alt={description}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -215,6 +217,7 @@ function Card({ card }) {
|
||||||
src={image}
|
src={image}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
|
loading="lazy"
|
||||||
alt=""
|
alt=""
|
||||||
onError={() => {
|
onError={() => {
|
||||||
this.style.display = 'none';
|
this.style.display = 'none';
|
||||||
|
@ -245,6 +248,7 @@ function Card({ card }) {
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
alt={title || description}
|
alt={title || description}
|
||||||
|
loading="lazy"
|
||||||
style={{
|
style={{
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
aspectRatio: `${width}/${height}`,
|
aspectRatio: `${width}/${height}`,
|
||||||
|
|
Loading…
Reference in a new issue