diff --git a/app/components/common/AppLogo.vue b/app/components/common/AppLogo.vue index 43ffcab..84241fb 100644 --- a/app/components/common/AppLogo.vue +++ b/app/components/common/AppLogo.vue @@ -36,7 +36,13 @@ const logoHover = () => { logoObserver?.kill() - gsap.set(logoRef.value.children[1] as HTMLElement, { + // Ensure children exist before attempting to animate them + const firstChild = logoRef.value.children[0] as HTMLElement + const secondChild = logoRef.value.children[1] as HTMLElement + + if (!firstChild || !secondChild) return + + gsap.set(secondChild, { opacity: 0, visibility: 'hidden', y: 0, @@ -45,12 +51,12 @@ const logoHover = () => { logoObserver = ScrollTrigger.observe({ target: logoRef.value, onHover: (self) => { - gsap.to(self.target.children[0] as HTMLElement, { + gsap.to(firstChild, { y: -10, duration: 0.3, ease: 'power2.out', }) - gsap.to(self.target.children[1] as HTMLElement, { + gsap.to(secondChild, { y: 10, duration: 0.3, ease: 'power2.out', @@ -59,12 +65,12 @@ const logoHover = () => { }) }, onHoverEnd: (self) => { - gsap.to(self.target.children[0] as HTMLElement, { + gsap.to(firstChild, { y: 0, duration: 0.3, ease: 'power2.out', }) - gsap.to(self.target.children[1] as HTMLElement, { + gsap.to(secondChild, { y: 0, duration: 0.3, ease: 'power2.out', diff --git a/app/components/home/HomeHero.vue b/app/components/home/HomeHero.vue index e63efaa..981a6e6 100644 --- a/app/components/home/HomeHero.vue +++ b/app/components/home/HomeHero.vue @@ -1,8 +1,11 @@