'use client'; import { useEffect, useState } from 'react'; import { motion } from 'framer-motion'; import { StaticLink } from '@/components/ui/static-link'; import { RippleButton, SealButton } from '@/components/ui/ripple-button'; import { MagneticButton, BlurReveal, CounterWithEffect } from '@/lib/animations'; import { COMPANY_INFO, STATS } from '@/lib/constants'; import { ArrowRight, Shield, Zap, Award } from 'lucide-react'; import { useReducedMotion } from '@/hooks/use-reduced-motion'; import { trackButtonClick, trackServiceInterest } from '@/lib/analytics'; interface HeroContentProps { isVisible: boolean; } const features = [ { icon: Shield, text: '安全可靠' }, { icon: Zap, text: '高效便捷' }, { icon: Award, text: '专业服务' }, ]; function scrollTo(id: string) { const element = document.getElementById(id); if (element) { element.scrollIntoView({ behavior: 'smooth' }); } } function handleKeyDown(event: React.KeyboardEvent, id: string) { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); scrollTo(id); } } export function HeroContent({ isVisible }: HeroContentProps) { const shouldReduceMotion = useReducedMotion(); return ( 智连未来,成长伙伴 ); } export function HeroTitle({ isVisible }: HeroContentProps) { const shouldReduceMotion = useReducedMotion(); return ( {COMPANY_INFO.shortName} ); } export function HeroDescription(_props: HeroContentProps) { return (

企业数字化转型服务商

以智慧连接数字趋势,以伙伴身份陪您成长——您的数字化转型同行者

); } export function HeroButtons({ isVisible }: HeroContentProps) { const shouldReduceMotion = useReducedMotion(); const handleConsultClick = () => { trackButtonClick('consult_now', 'hero_section'); trackServiceInterest('consultation'); }; const handleLearnMoreClick = () => { trackButtonClick('learn_more', 'hero_section'); scrollTo('about'); }; return ( 立即咨询 handleKeyDown(e, 'about')} className="min-w-45" > 了解更多 ); } export function HeroFeatures({ isVisible }: HeroContentProps) { const shouldReduceMotion = useReducedMotion(); return ( {features.map((feature, index) => ( {feature.text} ))} ); } export function HeroStats() { const [statsVisible, setStatsVisible] = useState(true); const shouldReduceMotion = useReducedMotion(); useEffect(() => { const statsEl = document.getElementById('stats-section'); if (!statsEl) {return;} const observer = new IntersectionObserver( ([entry]) => { if (entry?.isIntersecting) { setStatsVisible(true); } }, { threshold: 0.5 } ); observer.observe(statsEl); return () => observer.disconnect(); }, []); return (
{STATS.map((stat, index) => ( ))}
); } function HeroStatItem({ stat, index, shouldAnimate, shouldReduceMotion }: { stat: { value: string; label: string }; index: number; shouldAnimate: boolean; shouldReduceMotion: boolean; }) { const numericValue = parseInt(stat.value.replace(/\D/g, '')); const suffix = stat.value.replace(/[\d]/g, ''); return (
{shouldAnimate ? ( ) : ( 0{suffix} )}
{stat.label}
); }