feat: 暗色主题 + /2026 详情页 + 逐页标题 — 对齐原站剩余缺口

- 暗色主题 1:1:ThemeModeProvider 原逻辑(localStorage 'theme'
  light/dark/system、system 跟随 prefers-color-scheme、<html> class 切换),
  CSS tokens 按原站 .dark 块翻值(--label/--background-deep/--code-*);
  shellMedia 重构为 useSyncExternalStore 单例 store(Header 与 Canvas 共享)
- WebGL 主题分支:BackgroundFX 暗色渐变(#2c4bd5/#00000d/#00344C +
  outputMix .95/edgeIntensity -.82,原 sj 配置)、DotOverlay #0F1111、
  LoadingCurtain #191b1b、玻璃模型暗色参数组(shininess 100/fresnel .72/
  brightness .6/uDark=1 Hard-Light)与暗色 tint(hello #64c3ff、
  footer #8e9dc4/#64c3ff)
- /2026 路由:rewrite 补 2026(此前 404),workArticles 增加 /2026 占位文章
  (原站内容被服务端口令保密无法读取,已注释说明);解锁屏→刷新→服务端
  放行全链路 CDP 验证通过
- 逐页 <title>:app/work/[slug]/layout.tsx generateMetadata 映射作品名
  (reunimos→Reunimos™),受保护 /2026 未解锁时 SSR 'Protected'(原站行为),
  根标题改回原站 'HAOQI©2026'
This commit is contained in:
2026-09-02 14:31:28 +08:00
parent 696cfa8c2c
commit d5a1228aac
10 changed files with 337 additions and 68 deletions
+53 -4
View File
@@ -8,6 +8,7 @@ import { mergeGeometries } from "three/examples/jsm/utils/BufferGeometryUtils.js
import { scrollBus } from "@/lib/scrollBus";
import { usePointer } from "@/lib/pointer";
import { loadingBus } from "@/lib/loadingBus";
import { useResolvedTheme } from "@/lib/shellMedia";
/**
* Glass models for the hero section, reverse-engineered 1:1 from the
@@ -259,6 +260,25 @@ const LIGHT_PARAMS = {
lightZ: 0.5,
};
// Dark-theme branch of the same cloned controls (original dark* control
// values): the glass switches to Hard-Light duotone mixing (uDark 1) with a
// different highlight/fresnel response.
const DARK_PARAMS = {
shininess: 100,
diffuseness: 0.05,
fresnelPower: 3,
fresnelStrength: 0.72,
brightness: 0.6,
contrast: 0.98,
gamma: 1,
saturation: 1.2,
tintMix: 1,
tintThicknessMinAlpha: 1,
tintThicknessMaxAlpha: 0.4,
tintColorA: "#64c3ff",
tintColorB: "#8e9dc4",
};
// Default uniforms from the bundle's uniform factory
const IOR = { R: 1.15, Y: 1.16, G: 1.18, C: 1.22, B: 1.22, P: 1.22 };
@@ -495,6 +515,35 @@ function GlassModel({
uniforms.uTintLocalYRange.value.set(tintYRange[0], tintYRange[1]);
}, [tintYRange, uniforms]);
// Theme branch (original cf(controls, theme) + E useMemo): swap the
// highlight/fresnel response and tint colors when the resolved theme
// flips. Per-model tingColor overrides: m[0]/m[1] light A/B,
// m[2]/m[3] dark A/B, missing entries fall back to the theme defaults.
const isDark = useResolvedTheme() === "dark";
useEffect(() => {
const P = isDark ? DARK_PARAMS : LIGHT_PARAMS;
uniforms.uShininess.value = P.shininess;
uniforms.uDiffuseness.value = P.diffuseness;
uniforms.uFresnelPower.value = P.fresnelPower;
uniforms.uFresnelStrength.value = P.fresnelStrength;
uniforms.uBrightness.value = P.brightness;
uniforms.uContrast.value = P.contrast;
uniforms.uGamma.value = P.gamma;
uniforms.uSaturation.value = P.saturation;
uniforms.uTintMix.value = P.tintMix;
uniforms.uTintThicknessMinAlpha.value = P.tintThicknessMinAlpha;
uniforms.uTintThicknessMaxAlpha.value = P.tintThicknessMaxAlpha;
const tintA = isDark
? (tintColors?.[2] ?? DARK_PARAMS.tintColorA)
: (tintColors?.[0] ?? LIGHT_PARAMS.tintColorA);
const tintB = isDark
? (tintColors?.[3] ?? DARK_PARAMS.tintColorB)
: (tintColors?.[1] ?? LIGHT_PARAMS.tintColorB);
uniforms.uTintColorA.value.copy(hexToVec4(tintA));
uniforms.uTintColorB.value.copy(hexToVec4(tintB));
uniforms.uDark.value = isDark ? 1 : 0;
}, [isDark, tintColors, uniforms]);
useEffect(() => {
const drawingBufferSize = gl.getDrawingBufferSize(new THREE.Vector2());
uniforms.uScreenResolutionPx.value.set(
@@ -675,9 +724,9 @@ export function CursorStar({ isMobile = false }: { isMobile?: boolean }) {
afterRotation={[0, 720, 0]}
rotation={[0, 0, 0]}
scale={0.1}
// Original tingColor light theme: tint A and B are BOTH #009dff
// (m[0]/m[1]); #64c3ff (m[2]/m[3]) is the dark-theme value.
tintColors={["#009dff", "#009dff"]}
// Original tingColor: light m[0]/m[1] both #009dff, dark m[2]/m[3]
// both #64c3ff.
tintColors={["#009dff", "#009dff", "#64c3ff", "#64c3ff"]}
tintEnabled
isMobile={isMobile}
scrollSyncFactor={0.72}
@@ -714,7 +763,7 @@ export function FooterModel() {
beforeRotation={[-180, 0, 0]}
rotation={[0, 0, 0]}
scale={19}
tintColors={["#FFFFFF", "#009dff"]}
tintColors={["#FFFFFF", "#009dff", "#8e9dc4", "#64c3ff"]}
tintEnabled
sectionTopDocY={geom.top}
sectionHeightPx={geom.height}