fix(gallery): sometimes, in 2d mode, scale wasn't animated in the transition

This commit is contained in:
2026-02-26 12:27:54 +01:00
parent 8d18e1ddbb
commit 7e416c2b02
2 changed files with 7 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ const store = useGalleryStore();
const { assets } = useAssets(); const { assets } = useAssets();
onMounted(() => { onMounted(() => {
store.cleanup();
if (store.shouldAnimateOutro) { if (store.shouldAnimateOutro) {
store.shouldAnimateOutro = false; store.shouldAnimateOutro = false;
store.animateOutro(); store.animateOutro();

View File

@@ -40,6 +40,12 @@ export const useGalleryStore = defineStore("gallery", {
}), }),
actions: { actions: {
cleanup() {
gsap.killTweensOf(this.zoom);
gsap.killTweensOf(this.intro);
gsap.killTweensOf(this.outro);
},
animateIntro() { animateIntro() {
this.isIntro = true; this.isIntro = true;
this.isOutro = false; this.isOutro = false;