Make Location hover preview images global on env

This commit is contained in:
2021-10-02 20:55:27 +02:00
parent 7b73ac5952
commit 6c1dcf7535
3 changed files with 5 additions and 3 deletions

View File

@@ -36,7 +36,7 @@
}))
// Change photo index from mouse position percentage
photoIndex = Math.round(lerp(0, 3, moveProgress))
photoIndex = Math.round(lerp(0, Number(import.meta.env.VITE_PREVIEW_COUNT) - 1, moveProgress))
}
// Leaving mouseover
@@ -76,7 +76,8 @@
{#each location.photos as photo, index}
<Image
class={index === photoIndex ? 'is-visible' : null}
id={photo.image.id} alt={photo.image.title} width={240} height={160} quality={70}
id={photo.image.id} alt={photo.image.title}
width={340} height={226} quality={70}
/>
{/each}
</div>