mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 21:44:55 +03:00
feat: add lazy loading to images and thumbs
This commit is contained in:
parent
483f069d81
commit
b0803fa28d
@ -112,6 +112,7 @@ export function GallerySlider({ gameDetails }: GallerySliderProps) {
|
||||
(image: SteamScreenshot, i: number) => (
|
||||
<img
|
||||
key={"image-" + i}
|
||||
loading="lazy"
|
||||
className={styles.gallerySliderMedia}
|
||||
src={image.path_full}
|
||||
style={{ translate: `${-100 * mediaIndex}%` }}
|
||||
@ -146,6 +147,7 @@ export function GallerySlider({ gameDetails }: GallerySliderProps) {
|
||||
gameDetails.movies?.map((video: SteamMovies, i: number) => (
|
||||
<img
|
||||
key={video.id}
|
||||
loading="lazy"
|
||||
onClick={() => setMediaIndex(i)}
|
||||
src={video.thumbnail}
|
||||
className={`${styles.gallerySliderMediaPreview} ${mediaIndex === i ? styles.gallerySliderMediaPreviewActive : ""}`}
|
||||
@ -156,6 +158,7 @@ export function GallerySlider({ gameDetails }: GallerySliderProps) {
|
||||
(image: SteamScreenshot, i: number) => (
|
||||
<img
|
||||
key={"image-thumb-" + i}
|
||||
loading="lazy"
|
||||
onClick={() =>
|
||||
setMediaIndex(
|
||||
i + (gameDetails.movies ? gameDetails.movies.length : 0)
|
||||
|
Loading…
Reference in New Issue
Block a user