diff --git a/app/components/Gallery/TopScreen/TopScreen.vue b/app/components/Gallery/TopScreen/TopScreen.vue index 293395b..6c039fd 100644 --- a/app/components/Gallery/TopScreen/TopScreen.vue +++ b/app/components/Gallery/TopScreen/TopScreen.vue @@ -4,6 +4,7 @@ const store = useGalleryStore(); const { assets } = useAssets(); onMounted(() => { + store.cleanup(); if (store.shouldAnimateOutro) { store.shouldAnimateOutro = false; store.animateOutro(); diff --git a/app/stores/gallery.ts b/app/stores/gallery.ts index 5fe0a1c..2781d93 100644 --- a/app/stores/gallery.ts +++ b/app/stores/gallery.ts @@ -40,6 +40,12 @@ export const useGalleryStore = defineStore("gallery", { }), actions: { + cleanup() { + gsap.killTweensOf(this.zoom); + gsap.killTweensOf(this.intro); + gsap.killTweensOf(this.outro); + }, + animateIntro() { this.isIntro = true; this.isOutro = false;