Refactor/optimize ui #24

Merged
zhangxiang merged 33 commits from refactor/optimize-ui into dev 2026-09-01 11:47:02 +08:00
7 changed files with 7 additions and 24 deletions
Showing only changes of commit 7f83ef68f7 - Show all commits
Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 KiB

After

Width:  |  Height:  |  Size: 540 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

@@ -73,7 +73,7 @@ function HeroSection({ data }: { data: AboutData }) {
<span className="relative text-brand font-black">
{line}
<motion.span
className="absolute -bottom-2 left-0 w-full h-[3px] bg-brand"
className="absolute bottom-0 left-0 w-full h-[3px] bg-brand"
style={{ transformOrigin: 'left' }}
initial={{ scaleX: 0 }}
animate={{ scaleX: 1 }}
@@ -89,12 +89,13 @@ jest.mock('lucide-react', () => {
});
describe('HomeContentV15 - 浅色 Hero(暗黑模式 token 友好)', () => {
it('renders the light canvas hero with a brand logo variant', () => {
it('does not repeat the brand logo inside the hero (dedup with header)', () => {
render(<HomeContentV15 />);
expect(screen.getByTestId('hero-section')).toBeInTheDocument();
const heroLogo = screen.getByTestId('mock-next-image');
expect(heroLogo).toHaveAttribute('src', '/logo.svg');
const hero = screen.getByTestId('hero-section');
expect(hero).toBeInTheDocument();
// hero 内不应再有 Logo(导航栏已展示,避免重复);slogan badge 保留
expect(hero.querySelector('img')).toBeNull();
});
it('keeps a single primary CTA and demotes the secondary action to a text link', () => {
+1 -19
View File
@@ -1,7 +1,6 @@
'use client';
import { useRef } from 'react';
import Image from 'next/image';
import { motion } from 'framer-motion';
import { ScrollReveal, StaggerReveal } from '@/components/ui/scroll-reveal';
import { Badge } from '@/components/ui/badge';
@@ -172,24 +171,7 @@ function HeroSection({ heroData, stats }: {
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10 w-full py-16 sm:py-20 md:py-24 lg:py-24">
<div className="grid items-center gap-16 lg:grid-cols-[1.05fr_0.95fr]">
<div className="max-w-4xl">
{/* 品牌标识:浅色画布使用深色版 Logo(深色版见 footer 深色区块) */}
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.35, delay: 0, ease: EASE_OUT }}
className="mb-6"
>
<Image
src="/logo.svg"
alt={`${COMPANY_INFO.name} Logo`}
width={224}
height={56}
className="h-12 w-auto sm:h-14"
priority
/>
</motion.div>
{/* 品牌口号 Badge:浅色画布上的品牌红信号 */}
{/* 品牌口号 Badge:浅色画布上的品牌红信号(hero 不重复渲染 Logo,避免与导航栏重复) */}
{slogan && (
<motion.div
initial={{ opacity: 0, y: 20 }}