feat(hub): 首屏改 A 类影像片,覆盖 18/20 条路由(OPEN-01 终版)

第一版按 ADR-0011 §4.2 做的 B 类矢量原语(层叠体块 + 水平线)上线前被用户否决:
「右侧的矩形条是什么设计?有出处吗?不太好看呢」。复盘是语义错位——浅底上的
灰阶堆叠读成骨架屏/条形图,不是建筑;建筑感来自透视与材质,矢量剪影给不了。
这与 ADR-0011 §2.4 记的 brand-visuals 抽象几何被弃是同一个坑。

改判走 A 类本地生成影像,并相应修订 ADR-0011 §4.1(A 类允许进首屏引言区的构图位)。

- 新增 ui/hero-plate.tsx + 四张 4:5 建筑静帧(facade/glass/hall/truss,
  1000x1250 webp,97–199KB/张),均为抽象结构、无人物/无文字/无标识/无地标
- 覆盖 16 个文件 / 18 条路由:六 hub、四类详情、关于/团队/方法论/联系、ERP 专题、
  详情页共享壳;排除 /privacy /terms(法律文本)与 /cases/[slug](零数据 + 大数字构图)
- R22 改为守 <HeroPlate 或 <Image>,仍 22/22 + 四向自证
- 撤除 span-field.tsx / span-field.test.tsx
- 基线:受影响 24 页 × 5 project 全量重采(157 张),只读复跑 225 passed / 0 failed

门禁:type-check 0 · lint 0 error/88 warning · jest 160 套件/1887 例
(89.90/88.47/89.57/89.90)· grammar 22/22 · accents 违规 0 · a11y 34 页 0 问题 ·
security 8/8 · e2e:fast 59 passed(firefox 已恢复)· lighthouse 33 次运行全通过
(a11y 11/11 均 100,perf 97–100,SEO 100)
This commit is contained in:
zhangxiang committed 2026-12-01 18:44:07 +08:00
1 parent a17fd6f4ab
commit 84ac9b2123
186 files changed
+337 -311

No files matched your search

@@ -5,6 +5,7 @@ import { CTAButton } from '@/components/ui/cta-button';
import { MetricsBasisNote } from '@/components/ui/metrics-basis-note';
import { weakestBasis, type MetricBasis } from '@/lib/constants/metrics-basis';
import { ContentUnavailableState } from '@/components/ui/content-unavailable';
import { HeroPlate } from '@/components/ui/hero-plate';
import {
Trophy,
Shield, Award, Zap,
@@ -52,8 +53,8 @@ function HeroSection({ data }: { data: AboutData }) {
return (
<section className="relative min-h-[60vh] flex items-center overflow-hidden bg-bg-primary">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10 w-full py-24 sm:py-32 lg:py-40">
<div className="max-w-4xl">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10 w-full py-24 sm:py-32 lg:py-40 grid grid-cols-1 lg:grid-cols-12 lg:items-center gap-12 lg:gap-10">
<div className="max-w-4xl lg:col-span-7">
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
@@ -114,6 +115,10 @@ function HeroSection({ data }: { data: AboutData }) {
</CTAButton>
</motion.div>
</div>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="facade" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
);
@@ -8,7 +8,7 @@ import {
type CaseStudy,
} from '@/lib/constants/cases';
import { EARLY_ACCESS } from '@/lib/constants/company';
import { SpanField } from '@/components/ui/span-field';
import { HeroPlate } from '@/components/ui/hero-plate';
import { cn } from '@/lib/utils';
const EASE_OUT = [0.22, 1, 0.36, 1] as const;
@@ -198,13 +198,9 @@ export default function CasesContentV3({
</motion.div>
</div>
{/* B 类原语,第四组参数:六层、贴左 —— 案例页首屏此前完全没有视觉支点。 */}
<SpanField
className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]"
layers={6}
density="regular"
align="left"
/>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="truss" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
@@ -24,6 +24,7 @@ import {
import { trackContactForm } from '@/lib/analytics';
import { BreadcrumbSchema } from '@/components/seo/structured-data';
import { LegacyTooltip as Tooltip } from '@/components/ui/tooltip';
import { HeroPlate } from '@/components/ui/hero-plate';
const EASE_OUT = [0.22, 1, 0.36, 1] as const;
@@ -242,8 +243,8 @@ function ContactFormContent({ data }: { data: ContactData }) {
{/* Hero Section —— critique P2(2026-09-19):80vh 巨幅把转化表单推出首屏,
转化页按 DESIGN.md 紧凑档处理:无 min-h、py 收窄,表单回到首屏视野。 */}
<section className="relative flex items-center overflow-hidden bg-bg-primary">
<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 lg:py-28">
<div className="max-w-4xl">
<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 lg:py-28 grid grid-cols-1 lg:grid-cols-12 lg:items-center gap-12 lg:gap-10">
<div className="max-w-4xl lg:col-span-7">
{data.heroSubtitle && (
<motion.div
initial={{ opacity: 0, y: 20 }}
@@ -297,6 +298,10 @@ function ContactFormContent({ data }: { data: ContactData }) {
</motion.p>
)}
</div>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="glass" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
@@ -6,7 +6,7 @@ import { ScrollReveal } from '@/components/ui/scroll-reveal';
import { CTAButton } from '@/components/ui/cta-button';
import { COMPANY_INFO } from '@/lib/constants';
import { cn } from '@/lib/utils';
import { SpanField } from '@/components/ui/span-field';
import { HeroPlate } from '@/components/ui/hero-plate';
import { ArrowRight } from 'lucide-react';
export type InsightKind = 'methodology' | 'case' | 'writing';
@@ -93,13 +93,9 @@ export default function InsightsContent({ entries }: { entries: InsightEntry[] }
</ScrollReveal>
</div>
{/* B 类原语,第六组参数:六层、线密、贴左。 */}
<SpanField
className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[24rem]"
layers={6}
density="dense"
align="left"
/>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="glass" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
@@ -5,6 +5,7 @@ import { ScrollReveal, StaggerReveal } from '@/components/ui/scroll-reveal';
import { CTAButton } from '@/components/ui/cta-button';
import { CTA_LABELS } from '@/lib/constants/cta-labels';
import { EASE_OUT } from '@/components/ui/page-decoration';
import { HeroPlate } from '@/components/ui/hero-plate';
import { CheckCircle2 } from 'lucide-react';
interface MethodologyPhase {
@@ -30,8 +31,8 @@ export function MethodologyContent({ data }: MethodologyContentProps) {
<div>
{/* Hero:品牌化定位,轻量 CTA */}
<section className="relative min-h-[60vh] flex items-center overflow-hidden bg-bg-primary">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10 w-full py-24 sm:py-28 lg:py-32">
<div className="max-w-4xl">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10 w-full py-24 sm:py-28 lg:py-32 grid grid-cols-1 lg:grid-cols-12 lg:items-center gap-12 lg:gap-10">
<div className="max-w-4xl lg:col-span-7">
<motion.div
initial={{ opacity: 0, y: 30 }}
animate={{ opacity: 1, y: 0 }}
@@ -57,6 +58,10 @@ export function MethodologyContent({ data }: MethodologyContentProps) {
{heroDescription}
</motion.p>
</div>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="truss" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
+4 -8
View File
@@ -13,7 +13,7 @@ import { Search, Calendar, ArrowRight, Newspaper, ChevronLeft, ChevronRight } fr
import { COMPANY_INFO } from '@/lib/constants';
import { type NewsItem } from '@/lib/constants/news';
import { SectionLabel, EASE_OUT } from '@/components/ui/page-decoration';
import { SpanField } from '@/components/ui/span-field';
import { HeroPlate } from '@/components/ui/hero-plate';
const categories = ['全部', '公司新闻', '研发动态'];
const ITEMS_PER_PAGE = 9;
@@ -147,13 +147,9 @@ export default function NewsContentV3({ news, pageCopy }: { news?: NewsItem[]; p
</ScrollReveal>
</div>
{/* B 类原语,第五组参数:八层、线疏 —— 与其余五页错开,避免六页同一个图章。 */}
<SpanField
className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]"
layers={8}
density="sparse"
align="right"
/>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="truss" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
@@ -10,6 +10,7 @@ import { SectionLabel, EASE_OUT } from '@/components/ui/page-decoration';
import { motion } from 'framer-motion';
import { NEWS_RELATED_LINKS, type NewsItem } from '@/lib/constants/news';
import { parseArticleBlocks, readingMinutes } from '@/lib/news-article';
import { HeroPlate } from '@/components/ui/hero-plate';
function RelatedNewsCard({ news, index }: { news: NewsItem; index: number }) {
return (
@@ -67,6 +68,8 @@ export default function NewsDetailContentV3({ news, relatedNews = [] }: NewsDeta
{/* Hero Section */}
<section className="relative pt-28 sm:pt-32 md:pt-40 pb-16 sm:pb-20 md:pb-24 overflow-hidden">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10">
<div className="grid grid-cols-1 lg:grid-cols-12 lg:items-start gap-10 lg:gap-12">
<div className="lg:col-span-8">
<ScrollReveal>
<nav aria-label="breadcrumb" className="flex items-center gap-2 text-sm text-text-muted mb-8 sm:mb-10">
<StaticLink href="/news" className="hover:text-brand-ink transition-colors duration-normal">
@@ -99,6 +102,12 @@ export default function NewsDetailContentV3({ news, relatedNews = [] }: NewsDeta
<div className="mt-10 h-px bg-gradient-to-r from-brand/50 via-border-primary to-transparent" />
</ScrollReveal>
</div>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="truss" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</div>
</section>
@@ -17,6 +17,7 @@ import {
} from 'lucide-react';
import { cn } from '@/lib/utils';
import type { ContentItem } from '@/lib/cms/types';
import { HeroPlate } from '@/components/ui/hero-plate';
interface ErpUpgradeContentV2Props {
item: ContentItem;
@@ -128,7 +129,8 @@ export default function ErpUpgradeContentV2({ item }: ErpUpgradeContentV2Props)
<div className="min-h-screen bg-bg-primary text-ink overflow-x-hidden">
{/* Hero Section */}
<section className="relative pt-32 pb-32 lg:pt-40 lg:pb-40 overflow-hidden">
<div className="max-w-container mx-auto px-6 lg:px-10 relative z-10">
<div className="max-w-container mx-auto px-6 lg:px-10 relative z-10 grid grid-cols-1 lg:grid-cols-12 lg:items-center gap-12 lg:gap-10">
<div className="lg:col-span-7">
<ScrollReveal>
<Badge variant="outline" className="mb-8 border-brand/30 text-brand-ink text-sm px-4 py-2">
企业数字化升级专题
@@ -160,6 +162,11 @@ export default function ErpUpgradeContentV2({ item }: ErpUpgradeContentV2Props)
</Button>
</div>
</ScrollReveal>
</div>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="facade" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
@@ -10,6 +10,7 @@ import { SectionLabel, EASE_OUT } from '@/components/ui/page-decoration';
import type { Product } from '@/lib/constants/products';
import { MethodologyFramework, TechStackShowcase, FAQSection, DataProofSection } from '@/components/content/sections';
import { L3EmptyFallback, CaseStudiesSection, CertificationsSection } from '@/components/detail';
import { HeroPlate } from '@/components/ui/hero-plate';
const PRODUCT_ICONS: Record<string, React.ReactNode> = {
'睿新ERP管理系统': <Package className="w-8 h-8" />,
@@ -29,7 +30,8 @@ function DetailHero({ product }: DetailHeroProps) {
return (
<section className="relative min-h-[80vh] flex items-center overflow-hidden bg-bg-primary pt-24">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10 w-full py-20 sm:py-24 md:py-28 lg:py-32">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10 w-full py-20 sm:py-24 md:py-28 lg:py-32 grid grid-cols-1 lg:grid-cols-12 lg:items-center gap-12 lg:gap-10">
<div className="lg:col-span-7">
<motion.div
initial={{ opacity: 0, y: 30 }}
animate={{ opacity: 1, y: 0 }}
@@ -98,6 +100,11 @@ function DetailHero({ product }: DetailHeroProps) {
查看更多产品
</CTAButton>
</motion.div>
</div>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="facade" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
);
@@ -6,7 +6,7 @@ import { EASE_OUT } from '@/components/ui/page-decoration';
import { StaticLink } from '@/components/ui/static-link';
import { CTAButton } from '@/components/ui/cta-button';
import { MetricsBasisNote } from '@/components/ui/metrics-basis-note';
import { SpanField } from '@/components/ui/span-field';
import { HeroPlate } from '@/components/ui/hero-plate';
import { BentoGrid, BentoItem } from '@/components/sections/bento-grid';
import { ArrowRight, ArrowUpRight, Package, Cpu, TrendingUp, Users, Settings, FileText } from 'lucide-react';
import type { Product } from '@/lib/constants/products';
@@ -92,14 +92,9 @@ function HeroSection({ pageCopy }: { pageCopy?: PageCopy | null }) {
</motion.div>
</div>
{/* B 类原语:承担首屏构图支点(ADR-0011 §4.2)。移动端是文字下方的一条带,
桌面占据右 5 列;任何断点都不隐藏 —— 判据要求它「不能被 CSS 隐藏」。 */}
<SpanField
className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]"
layers={5}
density="regular"
align="right"
/>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="facade" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
);
@@ -15,6 +15,7 @@ import {
import type { LucideIcon } from "lucide-react";
import type { Service } from "@/lib/constants/services";
import { L3EmptyFallback, CaseStudiesSection } from "@/components/detail";
import { HeroPlate } from "@/components/ui/hero-plate";
const EASE_OUT = [0.22, 1, 0.36, 1] as const;
@@ -34,8 +35,8 @@ function DetailHero({ service }: { service: Service }) {
return (
<section className="relative overflow-hidden bg-bg-primary">
<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 lg:py-28">
<div className="max-w-4xl">
<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 lg:py-28 grid grid-cols-1 lg:grid-cols-12 lg:items-center gap-12 lg:gap-10">
<div className="max-w-4xl lg:col-span-7">
<motion.h1
initial={{ opacity: 0, y: 40 }}
animate={{ opacity: 1, y: 0 }}
@@ -90,6 +91,10 @@ function DetailHero({ service }: { service: Service }) {
</CTAButton>
</motion.div>
</div>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="hall" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
);
@@ -8,7 +8,7 @@ import { MetricsBasisNote } from '@/components/ui/metrics-basis-note';
import { CTA_LABELS, canonicalCtaLabel } from '@/lib/constants/cta-labels';
import type { Service, ServiceMetric } from '@/lib/constants/services';
import { weakestBasis } from '@/lib/constants/metrics-basis';
import { SpanField } from '@/components/ui/span-field';
import { HeroPlate } from '@/components/ui/hero-plate';
const EASE_OUT = [0.22, 1, 0.36, 1] as const;
@@ -140,13 +140,9 @@ function HeroSection({ pageCopy }: { pageCopy?: PageCopy | null }) {
</motion.div>
</div>
{/* B 类原语,第三组参数:层数最少、线最疏、贴左 —— 与产品/方案两页拉开差异。 */}
<SpanField
className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]"
layers={4}
density="sparse"
align="left"
/>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="hall" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
);
@@ -10,6 +10,7 @@ import type { Product } from '@/lib/constants/products';
import { L3EmptyFallback, CaseStudiesSection, CertificationsSection } from '@/components/detail';
import { ResultsSlot } from '@/components/sections/results-slot';
import type { CaseStudy } from '@/lib/constants/cases';
import { HeroPlate } from '@/components/ui/hero-plate';
/** 共创阶段的可验证事实 —— 与首页同一份语义,不冒充案例 */
const CO_CREATION_STEPS = [
@@ -57,7 +58,8 @@ function DetailHero({ solution }: DetailHeroProps) {
顺带收成单一容器 primitive:max-w-container + mx-auto + 三档 px 与 .container-x
本身重复(它已含 width/max-width/margin/padding),两套 gutter 同时在线是
计划 §6.5 点名的病。 */}
<div className="container-x relative z-10 w-full py-14 md:py-20">
<div className="container-x relative z-10 w-full py-14 md:py-20 grid grid-cols-1 lg:grid-cols-12 lg:items-center gap-12 lg:gap-10">
<div className="lg:col-span-7">
<motion.div
initial={{ opacity: 0, y: 30 }}
animate={{ opacity: 1, y: 0 }}
@@ -106,6 +108,11 @@ function DetailHero({ solution }: DetailHeroProps) {
查看产品
</CTAButton>
</motion.div>
</div>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="glass" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
);
@@ -7,7 +7,7 @@ import { CTAButton } from '@/components/ui/cta-button';
import { MetricsBasisNote } from '@/components/ui/metrics-basis-note';
import { CTA_LABELS, canonicalCtaLabel } from '@/lib/constants/cta-labels';
import { weakestBasis } from '@/lib/constants/metrics-basis';
import { SpanField } from '@/components/ui/span-field';
import { HeroPlate } from '@/components/ui/hero-plate';
import { type Solution } from '@/lib/constants/solutions';
import type { Product } from '@/lib/constants/products';
@@ -88,13 +88,9 @@ function HeroSection({ pageCopy }: { pageCopy?: PageCopy | null }) {
</motion.div>
</div>
{/* B 类原语,第二组参数(ADR-0011 §4.2):层数更多、水平线更密。 */}
<SpanField
className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]"
layers={7}
density="dense"
align="right"
/>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="glass" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
);
+7 -2
View File
@@ -6,6 +6,7 @@ import { CTAButton } from '@/components/ui/cta-button';
import { ContentUnavailableState } from '@/components/ui/content-unavailable';
import { Shield, Building2, Users, Code, Target, Layers, BookOpen, Sparkles, type LucideIcon } from 'lucide-react';
import { EASE_OUT } from '@/components/ui/page-decoration';
import { HeroPlate } from '@/components/ui/hero-plate';
import { useReducedMotion } from '@/hooks/use-reduced-motion';
/** Icon name-to-component mapping for CMS string-based icons */
@@ -142,8 +143,8 @@ export default function TeamContentV3({ data }: { data: Record<string, unknown>
<div className="min-h-screen bg-bg-primary text-ink overflow-x-hidden">
{/* ============ L1: Hero 团队情感入口 ============ */}
<section className="relative min-h-[60vh] flex items-center overflow-hidden bg-bg-primary">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10 w-full py-24 sm:py-32 lg:py-40">
<div className="max-w-4xl">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10 w-full py-24 sm:py-32 lg:py-40 grid grid-cols-1 lg:grid-cols-12 lg:items-center gap-12 lg:gap-10">
<div className="max-w-4xl lg:col-span-7">
{/* 眉标 Badge */}
<motion.div
initial={{ opacity: 0, y: 20 }}
@@ -226,6 +227,10 @@ export default function TeamContentV3({ data }: { data: Record<string, unknown>
)}
</motion.div>
</div>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="hall" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
+8 -1
View File
@@ -1,4 +1,5 @@
import { CTAButton } from '@/components/ui/cta-button';
import { HeroPlate } from '@/components/ui/hero-plate';
import type { HeroTheme } from '@/lib/constants/hero-themes';
/**
@@ -52,7 +53,8 @@ export function DetailPageHero({
return (
<section className="bg-bg-primary" data-testid={`${testIdPrefix}-section`}>
<div className="container-x py-16 sm:py-20 lg:py-28">
<div className="container-x py-16 sm:py-20 lg:py-28 grid grid-cols-1 lg:grid-cols-12 lg:items-center gap-12 lg:gap-10">
<div className="lg:col-span-7">
<div className="flex items-center gap-3">
{/* 产品线视觉身份的唯一落点:3px × 24px 短线。
色值来自真源(hero-themes.ts),此处只做透传 —— check:accents 判据 B 登记在此。 */}
@@ -94,6 +96,11 @@ export function DetailPageHero({
)}
</div>
)}
</div>
{/* 首屏影像片(A 类,ADR-0011 §4.1):本页的构图支点。
移动端是文字下方的一条带,桌面占右 5 列;任何断点都不隐藏。 */}
<HeroPlate variant="facade" className="h-40 w-full sm:h-56 lg:col-span-5 lg:h-[30rem]" />
</div>
</section>
);
+43
View File
@@ -0,0 +1,43 @@
import { render } from '@testing-library/react';
import '@testing-library/jest-dom';
import { HeroPlate } from './hero-plate';
/**
* 判据只锁三件事:
* ① 装饰位语义:aria-hidden + `alt=""`(不承载信息,读屏不该读它);
* ② 题材受控:只接受四张登记在案的片子,防止有人临时塞一张任意图;
* ③ 不接交互、不加品牌红面积。
*/
describe('HeroPlate', () => {
it('一律 aria-hidden,且不接任何交互', () => {
const { container } = render(<HeroPlate />);
const el = container.firstElementChild as HTMLElement;
expect(el).toHaveAttribute('aria-hidden', 'true');
expect(el.className).toContain('pointer-events-none');
});
it('图片是空的 alt(装饰位),并且指向登记过的本地资产', () => {
const { container } = render(<HeroPlate variant="glass" />);
const img = container.querySelector('img');
expect(img).not.toBeNull();
expect(img).toHaveAttribute('alt', '');
// next/image 会把 src 改写成 /_next/image?url=…,断言前需要解码
const src = decodeURIComponent(img?.getAttribute('src') ?? '');
expect(src).toContain('/images/hub/glass.webp');
});
it('四个 variant 各自落到不同的文件(不是同一个图章)', () => {
const srcOf = (variant: 'facade' | 'glass' | 'hall' | 'truss') => {
const img = render(<HeroPlate variant={variant} />).container.querySelector('img');
return decodeURIComponent(img?.getAttribute('src') ?? '');
};
const all = [srcOf('facade'), srcOf('glass'), srcOf('hall'), srcOf('truss')];
expect(new Set(all).size).toBe(4);
all.forEach((src) => expect(src).toContain('/images/hub/'));
});
it('外部 className 原样并入(控制占位尺寸)', () => {
const { container } = render(<HeroPlate className="h-40 w-full" />);
expect((container.firstElementChild as HTMLElement).className).toContain('h-40 w-full');
});
});
+62
View File
@@ -0,0 +1,62 @@
import Image from 'next/image';
import { cn } from '@/lib/utils';
/**
* HeroPlate —— 首屏影像片(A 类,ADR-0011 §4.1):本地生成的建筑静帧。
*
* 为什么从矢量原语换成影像(2026-12-01 用户裁定):
* 第一版按 ADR 的「层叠体块 + 水平线」做了一件抽象原语(`span-field.tsx`),
* 上线前被判「不好看」——诊断是**语义错位**:浅底上的灰阶堆叠读起来是骨架屏/条形图,
* 而不是建筑。对标的建筑感来自透视与材质,矢量剪影给不了这两个东西。
* 于是回到 ADR 允许的另一条路:A 类本地生成影像(首页 `hero-architecture.webp` 已是先例)。
*
* 准入四条(A 类):无人物 / 无可读文字 / 无客户或第三方标识 / 不暗示真实客户现场。
* 四张图的题材都是抽象结构(混凝土肋、玻璃幕墙、工业厂房、钢桁架),
* 不含任何可辨识地标——ADR-0011 §3 禁的那一类(九天楼及其变体)一条都不沾。
*
* 边界:
* - 一律 `aria-hidden` + `alt=""`:装饰位,不进证据位。
* - `object-cover` + 4:5 竖构图:桌面吃右列,移动端裁成横幅带,同一个文件两用。
* - 不做 hover / 不做视差 / 不加品牌红:面积纪律与动效约束都按既有门禁走。
*/
const PLATES = {
/** 混凝土竖肋立面:最接近「结构感」,用于产品族。 */
facade: '/images/hub/facade.webp',
/** 玻璃幕墙:冷静、反射、无地标,用于方案族与联系页。 */
glass: '/images/hub/glass.webp',
/** 工业厂房内景:纵深与柱列,用于服务族与团队页。 */
hall: '/images/hub/hall.webp',
/** 钢桁架细部:高对比几何,用于案例/新闻/方法论。 */
truss: '/images/hub/truss.webp',
} as const;
export type HeroPlateVariant = keyof typeof PLATES;
export function HeroPlate({
variant = 'facade',
className,
priority = false,
}: {
variant?: HeroPlateVariant;
/** 只控制占位尺寸(高度/列宽);比例由图片自身 4:5 决定。 */
className?: string;
/** 首屏以上的图片可置 true,其余交给默认懒加载。 */
priority?: boolean;
}) {
return (
<div
aria-hidden="true"
className={cn('pointer-events-none relative overflow-hidden bg-bg-secondary', className)}
>
<Image
src={PLATES[variant]}
alt=""
fill
sizes="(min-width: 1024px) 40vw, 100vw"
className="object-cover"
priority={priority}
/>
</div>
);
}
-75
View File
@@ -1,75 +0,0 @@
import { render } from '@testing-library/react';
import '@testing-library/jest-dom';
import { SpanField } from './span-field';
/**
* 原语的判据只锁 ADR-0011 允许它存在的理由,不锁实现细节:
* ① 一律 aria-hidden 且不接交互(它是装饰位,不是证据位);
* ② 不含品牌红(B 类原语只走 currentColor,否则 R16 的面积纪律会被绕过);
* ③ 层数受控(2–9),参数不同必须真的画得不一样 —— 六页复用一件原语的前提是
* 「参数能拉开差异」,否则就是六个一样的图章;
* ④ align 两档镜像(体块贴边与脊线同时翻转)。
*/
describe('SpanField', () => {
it('一律 aria-hidden,且不接任何交互', () => {
const { container } = render(<SpanField />);
const el = container.firstElementChild as HTMLElement;
expect(el).toHaveAttribute('aria-hidden', 'true');
expect(el.className).toContain('pointer-events-none');
});
it('不含品牌红:颜色只走 currentColor,不出现品牌色变量', () => {
const { container } = render(<SpanField />);
const html = container.innerHTML;
expect(html).not.toMatch(/--color-brand/);
expect(html).not.toMatch(/#C41E3A/i);
expect(container.querySelectorAll('rect').length).toBeGreaterThan(0);
Array.from(container.querySelectorAll('rect')).forEach((rect) => {
expect(rect.getAttribute('fill')).toBe('currentColor');
});
});
it('层数受控:默认 5 层 + 1 条脊线,参数不同则几何不同', () => {
const five = render(<SpanField layers={5} />).container;
const eight = render(<SpanField layers={8} />).container;
const countSlabs = (root: HTMLElement) =>
root.querySelectorAll('rect').length - 1; // 减掉脊线
expect(countSlabs(five)).toBe(5);
expect(countSlabs(eight)).toBe(8);
expect(five.querySelector('svg')?.getAttribute('viewBox')).not.toBe(
eight.querySelector('svg')?.getAttribute('viewBox'),
);
});
it('层数越界时收进 2–9,不产生空图', () => {
const low = render(<SpanField layers={0} />).container;
const high = render(<SpanField layers={99} />).container;
expect(low.querySelectorAll('rect').length - 1).toBe(2);
expect(high.querySelectorAll('rect').length - 1).toBe(9);
});
it('align 两档镜像:首块 x 与脊线位置同时翻转', () => {
const left = render(<SpanField align="left" />).container;
const right = render(<SpanField align="right" />).container;
const firstSlabX = (root: HTMLElement) =>
Number(root.querySelectorAll('rect')[1]?.getAttribute('x') ?? NaN);
const spineX = (root: HTMLElement) =>
Number(root.querySelector('rect')?.getAttribute('x'));
expect(firstSlabX(left)).toBeLessThan(firstSlabX(right));
expect(spineX(left)).toBe(0);
expect(spineX(right)).toBeGreaterThan(0);
});
it('密度档位控制水平线条数(不多画、不少画)', () => {
const countLines = (density: 'sparse' | 'regular' | 'dense') =>
render(<SpanField density={density} />).container.querySelectorAll('line').length;
expect(countLines('sparse')).toBe(2);
expect(countLines('regular')).toBe(4);
expect(countLines('dense')).toBe(6);
});
it('外部 className 原样并入(用于控制占位尺寸)', () => {
const { container } = render(<SpanField className="h-40 w-full" />);
expect((container.firstElementChild as HTMLElement).className).toContain('h-40 w-full');
});
});
-120
View File
@@ -1,120 +0,0 @@
import { cn } from '@/lib/utils';
/**
* SpanField —— B 类自有矢量原语(ADR-0011 §4.1/§4.2):层叠体块 + 水平线的建筑抽象。
*
* 它要解决的问题不是「缺张好看的图」,而是一个结构缺口:hub 六页的引言区此前
* 只有白底文字块,没有任何承担构图的元素(`public/images/hub/` 自 2026-11-02 建目录起
* 始终 `total 0`)。ADR-0011 把 `OPEN-01` 的资产路线从「生成 ~10 张氛围照片」改判为
* 「1 件原语 + 6 组参数」,理由是纯装饰的抽象几何在本仓被弃用过一次
* (`ui/brand-visuals.tsx` 的 GeometricDecoration 零非测试消费者),
* ⇒ **原语必须承担构图功能,而不是当背景花纹**。
*
* 边界(B 类准入四条的第三条):
* - **不含任何可辨识建筑的造型**:只有矩形体块与直线,没有坡顶、没有飞檐、没有塔身、
* 没有可读文字;体块宽度/错位取自固定序列,不做随机(随机会让视觉基线逐次抖动)。
* - 一律 `aria-hidden`:它不承载信息,读屏不该知道它存在。
* - 不碰品牌红:颜色只走 `currentColor`(`text-ink`),面积纪律因此天然满足(R16 零命中)。
* - 零圆角/零投影/零 hover(R13–R15):rect 不带 rx,SVG 不挂 shadow。
*
* 为什么用 SVG 而不是渐变:渐变画不出「体块之间的缝」,而缝才是这套语法的骨。
*/
export type SpanFieldDensity = 'sparse' | 'regular' | 'dense';
export type SpanFieldAlign = 'left' | 'right';
/** 体块高度与行距(viewBox 单位,非像素;实际尺寸由外层高度决定)。 */
const SLAB_H = 46;
const SLAB_GAP = 28;
const VB_W = 320;
/** 宽度占比序列:够长,六页各取不同 `layers` 就不会撞成同一张图。 */
const WIDTH_SEQ = [0.62, 0.9, 0.48, 0.76, 0.56, 0.84, 0.7, 0.44, 0.66];
/** 错位占比序列:0 = 贴齐对齐边,越大越往内缩。 */
const OFFSET_SEQ = [0, 0.14, 0.04, 0.22, 0.08, 0.3, 0.02, 0.18, 0.1];
/** 水平线条数:密度档位。 */
const HAIRLINE_COUNT: Record<SpanFieldDensity, number> = { sparse: 2, regular: 4, dense: 6 };
export function SpanField({
layers = 5,
density = 'regular',
align = 'right',
className,
}: {
/** 体块层数(2–9)。承载页面「密度」,六页各取不同值。 */
layers?: number;
/** 背景水平线的疏密。 */
density?: SpanFieldDensity;
/** 对齐边:决定体块贴哪一侧,以及竖向脊线的位置。 */
align?: SpanFieldAlign;
/** 只用于控制占位尺寸(高度/列宽),不参与几何定义。 */
className?: string;
}) {
const n = Math.min(9, Math.max(2, Math.round(layers)));
const rowH = SLAB_H + SLAB_GAP;
const vbH = n * rowH - SLAB_GAP;
const slabs = Array.from({ length: n }, (_, i) => {
// 序列长度固定且非空,`?? ` 分支只是给 noUncheckedIndexedAccess 一个出口。
const w = (WIDTH_SEQ[i % WIDTH_SEQ.length] ?? 0.6) * VB_W;
const offset = (OFFSET_SEQ[i % OFFSET_SEQ.length] ?? 0) * (VB_W - w);
return {
x: align === 'right' ? VB_W - w - offset : offset,
y: i * rowH,
w,
// 越往下越淡:视线从顶部体块开始读,底部退成底纹。
opacity: Number((0.82 - (i / Math.max(1, n - 1)) * 0.6).toFixed(2)),
};
});
const hairlineCount = HAIRLINE_COUNT[density];
const hairlines = Array.from(
{ length: hairlineCount },
(_, i) => ((i + 0.5) * vbH) / hairlineCount,
);
return (
<div aria-hidden="true" className={cn('pointer-events-none relative text-ink', className)}>
<svg
viewBox={`0 0 ${VB_W} ${vbH}`}
preserveAspectRatio="none"
className="h-full w-full"
focusable="false"
role="presentation"
>
{hairlines.map((y, i) => (
<line
key={`hairline-${i}`}
x1={0}
x2={VB_W}
y1={y}
y2={y}
stroke="currentColor"
strokeWidth={1}
opacity={0.18}
/>
))}
{slabs.map((s, i) => (
<rect
key={`slab-${i}`}
x={s.x}
y={s.y}
width={s.w}
height={SLAB_H}
fill="currentColor"
opacity={s.opacity}
/>
))}
{/* 竖向脊线:给这摞体块一条「落地」的边,避免读成一堆悬空色块。 */}
<rect
x={align === 'right' ? VB_W - 3 : 0}
y={0}
width={3}
height={vbH}
fill="currentColor"
opacity={0.9}
/>
</svg>
</div>
);
}