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:
@@ -19,6 +19,7 @@ import {
|
||||
} from "three";
|
||||
import { usePointer } from "@/lib/pointer";
|
||||
import { scrollBus } from "@/lib/scrollBus";
|
||||
import { useResolvedTheme } from "@/lib/shellMedia";
|
||||
|
||||
/**
|
||||
* Animated background — 1:1 port of the original `sz` + `sV` + `s$`
|
||||
@@ -39,6 +40,11 @@ import { scrollBus } from "@/lib/scrollBus";
|
||||
const BG_COLOR = "#ffead6";
|
||||
const VIGNETTE_COLOR = "#6196ff";
|
||||
const OUTPUT_COLOR = "#acffb9";
|
||||
// Dark branch (original sL/sH/s_ + sj.dark): deep blue bg, near-black
|
||||
// vignette, teal output; stronger output mix, much stronger edge falloff.
|
||||
const DARK_BG_COLOR = "#2c4bd5";
|
||||
const DARK_VIGNETTE_COLOR = "#00000d";
|
||||
const DARK_OUTPUT_COLOR = "#00344C";
|
||||
const OUTPUT_MIX = 0.65;
|
||||
const MOUSE_POS = new Vector2(0.5, -0.1);
|
||||
const CENTER = new Vector2(0.5, 0.5);
|
||||
@@ -548,9 +554,32 @@ export function BackgroundFX() {
|
||||
[]
|
||||
);
|
||||
|
||||
const bgColor = useMemo(() => toVec3(BG_COLOR), []);
|
||||
const vignetteColor = useMemo(() => toVec3(VIGNETTE_COLOR), []);
|
||||
const outputColor = useMemo(() => toVec3(OUTPUT_COLOR), []);
|
||||
const isDark = useResolvedTheme() === "dark";
|
||||
// sj: light {outputMix:.65, edgeIntensity:-.16} / dark {outputMix:.95,
|
||||
// edgeIntensity:-.82} — swapped on theme flip (original sz reads
|
||||
// resolvedTheme and re-seeds the uniforms per branch).
|
||||
const bgColor = useMemo(() => toVec3(isDark ? DARK_BG_COLOR : BG_COLOR), [isDark]);
|
||||
const vignetteColor = useMemo(
|
||||
() => toVec3(isDark ? DARK_VIGNETTE_COLOR : VIGNETTE_COLOR),
|
||||
[isDark]
|
||||
);
|
||||
const outputColor = useMemo(
|
||||
() => toVec3(isDark ? DARK_OUTPUT_COLOR : OUTPUT_COLOR),
|
||||
[isDark]
|
||||
);
|
||||
|
||||
// sj dark branch values + clear color: keep the RT clear in sync so the
|
||||
// first pre-pass composites over the right base after a theme flip.
|
||||
useEffect(() => {
|
||||
materials.outputMaterial.uniforms.uOutputMix.value = isDark ? 0.95 : 0.65;
|
||||
materials.vignetteMaterial.uniforms.uEdgeIntensity.value = isDark
|
||||
? -0.82
|
||||
: -0.16;
|
||||
gl.setClearColor(new Color(isDark ? DARK_BG_COLOR : BG_COLOR), 1);
|
||||
gl.setRenderTarget(rtsRef.current.read);
|
||||
gl.clear();
|
||||
gl.setRenderTarget(null);
|
||||
}, [isDark, materials, gl]);
|
||||
|
||||
// Internal ortho scene for pre-passes (original v/A + first-pass mesh).
|
||||
const preScene = useMemo(() => new Scene(), []);
|
||||
|
||||
Reference in New Issue
Block a user