fix(gallery): sometimes, in 2d mode, scale wasn't animated in the transition
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user