From 2cd0e007e4a4cc0d9c49892c4a7a6baedfbe2811 Mon Sep 17 00:00:00 2001 From: chenchun Date: Fri, 4 Sep 2026 13:33:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E6=96=87=E6=A1=88?= =?UTF-8?q?=E5=BE=AE=E8=B0=83=20=E2=80=94=20Flutter=20=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E6=94=B9=E7=A7=BB=E5=8A=A8=E7=AB=AF=E3=80=81hero=20?= =?UTF-8?q?=E5=A4=A7=E5=AD=97=E5=8E=BB=E3=80=8C=E6=88=91=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit postfx 尾迹色随主题(dark #1600ff,对齐原版 lensFlare 控制), 随本提交一并带入:GlassModels 的 Dark 修复已在上一条提交。 --- components/canvas/PostFX.tsx | 21 ++++++++++++++++----- lib/db.ts | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/components/canvas/PostFX.tsx b/components/canvas/PostFX.tsx index 46ff390..3f82221 100644 --- a/components/canvas/PostFX.tsx +++ b/components/canvas/PostFX.tsx @@ -5,6 +5,7 @@ import { useFrame, useThree } from "@react-three/fiber"; import { EffectComposer } from "@react-three/postprocessing"; import { UnsignedByteType, Vector2 } from "three"; import { usePointer } from "@/lib/pointer"; +import { useResolvedTheme } from "@/lib/shellMedia"; import { scrollBus } from "@/lib/scrollBus"; import { FluidPushPass, @@ -30,10 +31,15 @@ import { * lime trail acts as a pointer indicator over the dot curtain * - params: starRays 6, intensity .7, threshold .99, streakScale * 8·(w/1920)·(mobile?2:1), hotspotPower 32, gate .88, - * tailColorLight #ffa300 + * tailColor 随主题: light #ffa300 / dark #1600ff(原 lensFlare 控制 + * tailColorLight/tailColorDark,resolvedTheme 切换)。 + * ⚠ 尾迹色叠在玻璃高光热点上:Dark 下用橙色会把模型区域的 + * r/g 抬高、显得"发灰发透明"而非原版的饱和蓝。 */ const BRIGHT_SOURCE_SECTIONS = ["banner", "footer"]; +const TAIL_COLOR_LIGHT = "#ffa300"; +const TAIL_COLOR_DARK = "#1600ff"; const clamp01 = (v: number) => Math.min(1, Math.max(0, v)); const sT = (e?: number) => (e === undefined ? 0 : clamp01(e > 1 ? e / 100 : e)); @@ -81,6 +87,9 @@ export function PostFX() { const { uv: pointerUv, insideRef } = usePointer(); const isMobile = size.width < 1024; const reducedMotion = useReducedMotion(); + // 尾迹色随主题(原版: resolvedTheme → tailColorDark / tailColorLight) + const isDark = useResolvedTheme() === "dark"; + const tailColor = isDark ? TAIL_COLOR_DARK : TAIL_COLOR_LIGHT; const composerRef = useRef(null); @@ -95,9 +104,11 @@ export function PostFX() { streakScale: 8, hotspotPower: 32, gate: 0.88, - tailColor: "#ffa300", + tailColor, }), - [] + // 尾迹色随主题切换时需重建材质 uniform —— tailColor 进依赖 + // eslint-disable-next-line react-hooks/exhaustive-deps + [tailColor] ); const fluidPass = useMemo(() => new FluidPushPass(), []); @@ -124,9 +135,9 @@ export function PostFX() { streakScale, hotspotPower: 32, gate: 0.88, - tailColor: "#ffa300", + tailColor, }); - }, [flarePass, streakScale]); + }, [flarePass, streakScale, tailColor]); const dprRef = useRef(1); useEffect(() => { diff --git a/lib/db.ts b/lib/db.ts index c2d7862..0148721 100644 --- a/lib/db.ts +++ b/lib/db.ts @@ -188,7 +188,7 @@ function seed() { about_p2: "我相信工程塑造可靠的产品,设计赋予它们灵魂;", about_p2_link_label: "我的作品", intro_prefix: - "我是北极新一,一名横跨设计与工程的全栈开发者:Web 前端与后端、Flutter 客户端、AI 应用开发都有实践,也从产品设计一路做到工程落地。工作之外,我常在 ", + "我是北极新一,一名横跨设计与工程的全栈开发者:Web 前端与后端、移动端、AI 应用开发都有实践,也从产品设计一路做到工程落地。工作之外,我常在 ", intro_suffix: " 上记录与分享这些探索。", intro_brand: "小红书", footer_headline: "让我们|创造|一些不凡的|数字作品",