From 554011f0e751ba9face37a4421a12c91a2c2a378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Sat, 21 Feb 2026 22:58:09 +0800 Subject: [PATCH] feat: redesign hero section with dark tech theme and framer-motion --- src/components/sections/hero-section.tsx | 233 +++++++++++------------ 1 file changed, 115 insertions(+), 118 deletions(-) diff --git a/src/components/sections/hero-section.tsx b/src/components/sections/hero-section.tsx index c7b1555..22a66b6 100644 --- a/src/components/sections/hero-section.tsx +++ b/src/components/sections/hero-section.tsx @@ -1,18 +1,21 @@ 'use client'; import { useEffect, useRef, useState } from 'react'; -import { CTAButton } from '@/components/ui/cta-button'; -import { AnimatedNumber } from '@/components/ui/animated-number'; -import { SealParticle } from '@/components/effects/seal-particle'; -import { SealAnimationEnhanced } from '@/components/effects/seal-animation-enhanced'; -import { StampAnimation } from '@/components/effects/stamp-animation'; +import { motion } from 'framer-motion'; +import { Button } from '@/components/ui/button'; import { COMPANY_INFO, STATS } from '@/lib/constants'; -import { ArrowRight, Sparkles } from 'lucide-react'; +import { ArrowRight, Sparkles, Code2, Cloud, Shield, BarChart3 } from 'lucide-react'; + +const iconMap = { + Code: Code2, + Cloud: Cloud, + BarChart3: BarChart3, + Shield: Shield, +}; export function HeroSection() { const [isVisible, setIsVisible] = useState(false); const sectionRef = useRef(null); - const statsRef = useRef(null); const [statsVisible, setStatsVisible] = useState(false); useEffect(() => { @@ -33,7 +36,8 @@ export function HeroSection() { }, []); useEffect(() => { - if (!statsRef.current) return; + const statsEl = document.getElementById('stats-section'); + if (!statsEl) return; const observer = new IntersectionObserver( ([entry]) => { @@ -44,7 +48,7 @@ export function HeroSection() { { threshold: 0.5 } ); - observer.observe(statsRef.current); + observer.observe(statsEl); return () => observer.disconnect(); }, []); @@ -59,126 +63,91 @@ export function HeroSection() {
- - - {/* 增强版印章动画 - 桌面端显示 */} -
- console.log('Animation stage:', stage)} - className="opacity-80" - /> +
+
+
+
-
-
+ + + + + + + +
-
-
+ -
- -
-
-
-
- - - 印章文化 × 现代科技 - -
-
+ + + 科技创新 · 智慧未来 + + -

- - {COMPANY_INFO.name} - -

+ {COMPANY_INFO.shortName} +
+ 企业数字化转型服务商 + -

- {COMPANY_INFO.slogan.split(',')[0]} - ,{COMPANY_INFO.slogan.split(',')[1]} -

- -

{COMPANY_INFO.description} -

+ -
- handleScrollTo('about')} - icon={} - iconPosition="right" + className="min-w-[160px]" > 了解更多 - - + +
+ + -
-
+
{STATS.map((stat, index) => ( ))}
-
+
-
-
+
); } @@ -207,18 +175,47 @@ function StatItem({ stat, index, shouldAnimate }: { const suffix = stat.value.replace(/[\d]/g, ''); return ( -
-
- + +
+ {shouldAnimate ? ( + + ) : ( + `0${suffix}` + )}
-
+
{stat.label}
-
+
); } + +function AnimatedCounter({ value, suffix }: { value: number; suffix: string }) { + const [count, setCount] = useState(0); + + useEffect(() => { + const duration = 2000; + const steps = 60; + const increment = value / steps; + let current = 0; + + const timer = setInterval(() => { + current += increment; + if (current >= value) { + setCount(value); + clearInterval(timer); + } else { + setCount(Math.floor(current)); + } + }, duration / steps); + + return () => clearInterval(timer); + }, [value]); + + return <>{count}{suffix}; +}