From 70485187cb50a12e3962bad83c88e10ec361b080 Mon Sep 17 00:00:00 2001 From: zhangxiang Date: Thu, 3 Sep 2026 18:54:16 +0800 Subject: [PATCH] =?UTF-8?q?perf(motion):=20=E7=AC=AC=E4=BA=8C=E6=89=B9?= =?UTF-8?q?=E5=85=A5=E5=9C=BA=E5=8A=A8=E6=95=88=E6=97=B6=E9=95=BF=E6=94=B6?= =?UTF-8?q?=E6=95=9B=E8=87=B3=20300ms=EF=BC=884=20=E6=96=87=E4=BB=B6=2021?= =?UTF-8?q?=20=E5=A4=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 承接 8fb5aae,继续清理 Task #16 的 P0 硬违规(>700ms 明确禁止): - contact-content-v3 (7) / case-detail-page (6) / product-detail-content-v3 (5) / detail-hero (3 处入场) - 审计:P0 54 → 33,P1 163 持平,P2 28 持平 - 只改 duration,保留原 delay(与首批先例一致);改动行已逐行核验为纯动效行 验证: - tsc --noEmit 0 error;eslint 4 个改动文件 0 error - 单测 131 套件 / 1662 通过 / 2 跳过 / EXIT=0(与基线一致) - 视觉基线零变动:reducedMotion+animations disabled 下终态一致, 时长改动不改变最终像素;不带 -u 复跑 92 用例 EXIT=0 --- src/app/(marketing)/contact/contact-content-v3.tsx | 14 +++++++------- .../products/product-detail-content-v3.tsx | 10 +++++----- src/components/detail/detail-hero.tsx | 6 +++--- src/components/sections/case-detail-page.tsx | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/app/(marketing)/contact/contact-content-v3.tsx b/src/app/(marketing)/contact/contact-content-v3.tsx index 8b2eb49..e5e890e 100644 --- a/src/app/(marketing)/contact/contact-content-v3.tsx +++ b/src/app/(marketing)/contact/contact-content-v3.tsx @@ -223,7 +223,7 @@ function ContactFormContent({ data }: { data: ContactData }) { {data.heroSubtitle || ''} @@ -232,7 +232,7 @@ function ContactFormContent({ data }: { data: ContactData }) { {heroTitleLines.map((line, i) => ( @@ -246,7 +246,7 @@ function ContactFormContent({ data }: { data: ContactData }) { style={{ transformOrigin: 'left' }} initial={{ scaleX: 0 }} animate={{ scaleX: 1 }} - transition={{ duration: 0.8, delay: 1.2, ease: EASE_OUT }} + transition={{ duration: 0.3, delay: 1.2, ease: EASE_OUT }} /> @@ -260,7 +260,7 @@ function ContactFormContent({ data }: { data: ContactData }) { {data.heroDescription || ''} @@ -278,7 +278,7 @@ function ContactFormContent({ data }: { data: ContactData }) { initial={{ opacity: 0, y: 30 }} whileInView={{ opacity: 1, y: 0 }} viewport={{ once: true, margin: '-60px' }} - transition={{ duration: 0.8, ease: EASE_OUT }} + transition={{ duration: 0.3, ease: EASE_OUT }} className="lg:col-span-2 space-y-8" >
@@ -348,7 +348,7 @@ function ContactFormContent({ data }: { data: ContactData }) { initial={{ opacity: 0, y: 30 }} whileInView={{ opacity: 1, y: 0 }} viewport={{ once: true, margin: '-60px' }} - transition={{ duration: 0.8, delay: 0.1, ease: EASE_OUT }} + transition={{ duration: 0.3, delay: 0.1, ease: EASE_OUT }} className="lg:col-span-3" >
@@ -513,7 +513,7 @@ function ContactFormContent({ data }: { data: ContactData }) { initial={{ opacity: 0, y: 30 }} whileInView={{ opacity: 1, y: 0 }} viewport={{ once: true, margin: '-60px' }} - transition={{ duration: 0.8, ease: EASE_OUT }} + transition={{ duration: 0.3, ease: EASE_OUT }} className="max-w-3xl mx-auto text-center" >
diff --git a/src/app/(marketing)/products/product-detail-content-v3.tsx b/src/app/(marketing)/products/product-detail-content-v3.tsx index 52372bf..f25a4b6 100644 --- a/src/app/(marketing)/products/product-detail-content-v3.tsx +++ b/src/app/(marketing)/products/product-detail-content-v3.tsx @@ -32,7 +32,7 @@ function DetailHero({ product }: DetailHeroProps) {
@@ -60,7 +60,7 @@ function DetailHero({ product }: DetailHeroProps) { {product.title} @@ -69,7 +69,7 @@ function DetailHero({ product }: DetailHeroProps) { {product.description} @@ -78,7 +78,7 @@ function DetailHero({ product }: DetailHeroProps) { {product.overview} @@ -87,7 +87,7 @@ function DetailHero({ product }: DetailHeroProps) { diff --git a/src/components/detail/detail-hero.tsx b/src/components/detail/detail-hero.tsx index 7491276..7b755da 100644 --- a/src/components/detail/detail-hero.tsx +++ b/src/components/detail/detail-hero.tsx @@ -101,7 +101,7 @@ export function DetailHero({ y: 0, filter: 'blur(0px)', transition: { - duration: 0.9, + duration: 0.3, ease: [0.22, 1, 0.36, 1] as const, }, }, @@ -120,7 +120,7 @@ export function DetailHero({ opacity: 1, y: 0, transition: { - duration: 0.75, + duration: 0.3, delay: 0.25, ease: [0.22, 1, 0.36, 1] as const, }, @@ -189,7 +189,7 @@ export function DetailHero({
{data.title} @@ -115,7 +115,7 @@ function CaseDetailHero({ data }: CaseDetailHeroProps) { style={{ color: 'var(--color-text-secondary)' }} initial={shouldReduceMotion ? {} : { opacity: 0, y: 24 }} animate={{ opacity: 1, y: 0 }} - transition={{ duration: 0.8, delay: 0.4, ease: EASE }} + transition={{ duration: 0.3, delay: 0.4, ease: EASE }} > {data.subtitle} @@ -125,7 +125,7 @@ function CaseDetailHero({ data }: CaseDetailHeroProps) { className="grid grid-cols-3 gap-6 sm:gap-10 max-w-lg mb-10" initial={shouldReduceMotion ? {} : { opacity: 0, y: 24 }} animate={{ opacity: 1, y: 0 }} - transition={{ duration: 0.8, delay: 0.55, ease: EASE }} + transition={{ duration: 0.3, delay: 0.55, ease: EASE }} > {data.metrics.slice(1, 4).map((m, i) => (
@@ -147,7 +147,7 @@ function CaseDetailHero({ data }: CaseDetailHeroProps) { className="flex flex-wrap gap-x-6 gap-y-3 text-sm mb-10 border-y border-border-primary py-4" initial={shouldReduceMotion ? {} : { opacity: 0, y: 24 }} animate={{ opacity: 1, y: 0 }} - transition={{ duration: 0.8, delay: 0.65, ease: EASE }} + transition={{ duration: 0.3, delay: 0.65, ease: EASE }} > {data.projectDuration && (
@@ -173,7 +173,7 @@ function CaseDetailHero({ data }: CaseDetailHeroProps) { className="flex flex-wrap gap-4" initial={shouldReduceMotion ? {} : { opacity: 0, y: 24 }} animate={{ opacity: 1, y: 0 }} - transition={{ duration: 0.8, delay: 0.8, ease: EASE }} + transition={{ duration: 0.3, delay: 0.8, ease: EASE }} >