diff --git a/components/content/magical-marbles/index.vue b/components/content/magical-marbles/index.vue index 6f98ecec..3dfe616f 100644 --- a/components/content/magical-marbles/index.vue +++ b/components/content/magical-marbles/index.vue @@ -106,6 +106,8 @@ const uniforms = reactive({ }) onMounted(() => { + if (!mainRef.value) return + ctx = gsap.context(() => { }, mainRef.value) }) @@ -135,6 +137,8 @@ const updateBackground = (immediate = false) => { } else { ctx.add(() => { + if(!sphereRef.value) return + tl = gsap.timeline({ onStart: () => { tlInProgress.value = true @@ -156,14 +160,14 @@ const updateBackground = (immediate = false) => { duration: .75, ease: 'power1.out', }, 'sphereAnimation+=.15') - .to(sphereRef.value.value.scale, { + .to(sphereRef.value.instance.scale, { x: .95, y: .95, z: .95, duration: 0.35, ease: 'power1.inOut', }, 'sphereAnimation+=.15') - .to(sphereRef.value.value.scale, { + .to(sphereRef.value.instance.scale, { x: 1, y: 1, z: 1, @@ -190,24 +194,12 @@ onLoop(({ delta }) => {