- 删 3 个零渲染点组件 service-value / solution-value / micro-interactions 及其 3 个测试文件与 barrel 导出(dead-modules 被 barrel 再导出遮住,见 OPEN-16) - 批1:section-header 等价类 / service-card 去 hover 抬升与装饰阴影 / standalone 详情 8 处圆角 + 2 处红面改中性底 - 批2:/about/brand font-black 11 → font-bold、rounded-full 5、hover:shadow 2 - MARKETING_HIT_CEILINGS R13 19→3 / R14 7→5 / R15 7→1 / R16 8→5 / R17 13→1;分母 80→77 - 基线 /about/brand 5 张(预测 5、实写 5);回滚重建实测 1 passed 证明失败全由本批引起 - 全量只读复跑 225 passed / 0 failed / EXIT=0(21.9 分钟) - 门禁:type-check 0 · lint 0 error/88 warning · coverage 159 套件 1883 例 EXIT=0
101 lines
2.9 KiB
TypeScript
101 lines
2.9 KiB
TypeScript
'use client';
|
|
|
|
import { motion } from 'framer-motion';
|
|
import { useReducedMotion } from '@/hooks/use-reduced-motion';
|
|
|
|
interface SectionHeaderProps {
|
|
/** English label shown above title (e.g. "What We Do") */
|
|
label: string;
|
|
/** Main title text */
|
|
title: string;
|
|
/** Optional highlighted part of the title (rendered in brand red) */
|
|
highlight?: string;
|
|
/** Optional description below the title */
|
|
desc?: string;
|
|
/** Whether this header is on a dark background */
|
|
light?: boolean;
|
|
className?: string;
|
|
}
|
|
|
|
const EASE = [0.22, 1, 0.36, 1] as const;
|
|
|
|
export function SectionHeader({
|
|
label,
|
|
title,
|
|
highlight,
|
|
desc,
|
|
light = false,
|
|
className = '',
|
|
}: SectionHeaderProps) {
|
|
const shouldReduceMotion = useReducedMotion();
|
|
|
|
return (
|
|
<motion.div
|
|
className={`mb-12 md:mb-16 lg:mb-20 ${className}`}
|
|
initial={shouldReduceMotion ? {} : { opacity: 0, y: 24 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true, margin: '-40px' }}
|
|
transition={{ duration: 0.28, ease: EASE }}
|
|
>
|
|
{/* Eyebrow label with brand accent bar */}
|
|
<div className="flex items-center gap-3 mb-4 md:mb-5">
|
|
{/* Brand accent bar — grows from bottom on entry */}
|
|
<motion.div
|
|
className="w-1 origin-bottom"
|
|
style={{
|
|
height: '1rem',
|
|
backgroundColor: light
|
|
? 'rgba(255,255,255,0.5)'
|
|
: 'var(--color-brand)',
|
|
}}
|
|
initial={shouldReduceMotion ? {} : { scaleY: 0 }}
|
|
whileInView={{ scaleY: 1 }}
|
|
viewport={{ once: true, margin: '-40px' }}
|
|
transition={{ duration: 0.28, delay: 0.1, ease: EASE }}
|
|
/>
|
|
<motion.div
|
|
className="text-[10px] tracking-[4px] uppercase font-medium"
|
|
style={{
|
|
color: light
|
|
? 'rgba(255,255,255,0.5)'
|
|
: 'var(--color-brand)',
|
|
}}
|
|
initial={shouldReduceMotion ? {} : { opacity: 0, x: -8 }}
|
|
whileInView={{ opacity: 1, x: 0 }}
|
|
viewport={{ once: true, margin: '-40px' }}
|
|
transition={{ duration: 0.28, delay: 0.2, ease: EASE }}
|
|
>
|
|
{label}
|
|
</motion.div>
|
|
</div>
|
|
|
|
{/* Title */}
|
|
<h2
|
|
className="font-sans text-[clamp(28px,6vw,52px)] font-bold leading-[1.1] tracking-[-1px] mb-4 md:mb-5"
|
|
style={{ color: light ? '#FFFFFF' : 'var(--color-text-primary)' }}
|
|
>
|
|
{title}
|
|
{highlight && (
|
|
<span style={{ color: 'var(--color-brand)' }}>
|
|
{highlight}
|
|
</span>
|
|
)}
|
|
</h2>
|
|
|
|
{/* Description */}
|
|
{desc && (
|
|
<p
|
|
className="text-[15px] leading-relaxed max-w-[480px]"
|
|
style={{
|
|
color: light
|
|
? 'rgba(255,255,255,0.5)'
|
|
: 'var(--color-text-muted)',
|
|
}}
|
|
>
|
|
{desc}
|
|
</p>
|
|
)}
|
|
</motion.div>
|
|
);
|
|
}
|