Make Location hover preview images global on env
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
# Options
|
# Options
|
||||||
VITE_LIMIT_TIME=2 * 7 * 24 * 60 * 60 * 1000
|
VITE_LIMIT_TIME=2 * 7 * 24 * 60 * 60 * 1000
|
||||||
|
VITE_PREVIEW_COUNT=4
|
||||||
|
|
||||||
# API related
|
# API related
|
||||||
# VITE_API_URL_DEV="http://192.168.1.19:8055"
|
# VITE_API_URL_DEV="http://192.168.1.19:8055"
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
// Change photo index from mouse position percentage
|
// 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
|
// Leaving mouseover
|
||||||
@@ -76,7 +76,8 @@
|
|||||||
{#each location.photos as photo, index}
|
{#each location.photos as photo, index}
|
||||||
<Image
|
<Image
|
||||||
class={index === photoIndex ? 'is-visible' : null}
|
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}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
date_updated
|
date_updated
|
||||||
photos (sort: "-date_created", limit: 4) {
|
photos (sort: "-date_created", limit: ${import.meta.env.VITE_PREVIEW_COUNT}) {
|
||||||
image {
|
image {
|
||||||
id
|
id
|
||||||
title
|
title
|
||||||
|
|||||||
Reference in New Issue
Block a user