feat(i18n): 添加首页英雄区域的多语言支持
为首页英雄区域添加中英文翻译内容,包括服务列表、描述文本和按钮文字 同时优化AppLogo组件的动画安全检查和HomeHero组件的布局与动画效果
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user