diff --git a/app/pages/gallery.vue b/app/pages/gallery.vue index 1e80450..f7e4c99 100644 --- a/app/pages/gallery.vue +++ b/app/pages/gallery.vue @@ -2,8 +2,13 @@ import { LazyGalleryModal } from "#components"; import type { InternalApi } from "nitropack/types"; +// TODO: only play intro anim ONCE +// currently, if lane count changes, the animation is being replayed and it's shit + const images = ref([]); +const resized = ref(false); + const scrollArea = ref(); const overlay = useOverlay(); const galleryModal = overlay.create(LazyGalleryModal); @@ -26,6 +31,7 @@ const openModal = async (index: number) => { const lanes = ref(3); const updateLanes = () => { + const previousValue = lanes.value; if (window.innerWidth < 768) { lanes.value = 1; } else if (window.innerWidth < 1152) { @@ -33,6 +39,10 @@ const updateLanes = () => { } else { lanes.value = 3; } + + if (previousValue !== lanes.value) { + resized.value = true; + } }; const { data: galleryPhotos } = await useAsyncData("gallery", () => @@ -94,9 +104,15 @@ onUnmounted(() => {