diff --git a/.env.local b/.env.local index 8d5a462..a9986a5 100644 --- a/.env.local +++ b/.env.local @@ -1,5 +1,6 @@ # Options VITE_LIMIT_TIME=2 * 7 * 24 * 60 * 60 * 1000 +VITE_PREVIEW_COUNT=4 # API related # VITE_API_URL_DEV="http://192.168.1.19:8055" diff --git a/src/components/molecules/Location.svelte b/src/components/molecules/Location.svelte index a92bede..9fdb512 100644 --- a/src/components/molecules/Location.svelte +++ b/src/components/molecules/Location.svelte @@ -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} {photo.image.title} {/each} diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 80e4c27..951e563 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -36,7 +36,7 @@ } } date_updated - photos (sort: "-date_created", limit: 4) { + photos (sort: "-date_created", limit: ${import.meta.env.VITE_PREVIEW_COUNT}) { image { id title