feat: 移植首页 passcode 彩蛋(■■■■■■ → /unlock/2026 解锁 TikTok 品牌名与隐藏作品卡)

- lib/passcode.ts:module 58156/28116 移植——primaryPasscodePath("/2026")、buildPasscodeUnlockHref("/unlock/2026?return=%2F")、slotCount:4、品牌名按原站 charCode-1 混淆解码(TikTok)、锁定占位符与字符/散段样式类
- PasscodeAccess.tsx:module 4278 移植——access store(useSyncExternalStore + passcode-access-changed 事件驱动刷新)、usePasscodeAllowed/usePasscodeAccessLookup、submit/logout(POST /api/passcode)
- PasscodeUnlockScreen:4 格圆环输入(inset ring label-1/label-3 + caret-blink 光标)、满 4 位自动提交、错误 shake(WAAPI 等价原 framer x 关键帧抖动)、成功 'Access granted' 600ms 后 replace 回来源、已解锁进入立即跳回
- layout 挂 PasscodeAccessProvider(服务端 cookies 读初始 access);新增 /api/passcode GET/POST(httpOnly cookie 持久化,解锁码经 PASSCODE_CODE 配置,默认 2026)与 /unlock/[scope] 页
- ScrambleReveal 支持 slot part({length,scramble,className,settled}):打散期显示占位字符、收尾替换为交互节点,1:1 原版语义
- 首页 about 段换 c9/c2 移植:锁定点击跳解锁页、解锁显示 TikTok、长按 500ms/右键 confirm 重锁;WorkSection 按 access 过滤,解锁后 TikTok 卡(tt01/tt02 素材)出现在首位
- CDP 全流程验证:锁定→解锁→持久化→重锁 循环 + 错码抖动清空 + 卡片数 10↔11
This commit is contained in:
2026-09-01 19:21:52 +08:00
parent 71825606a4
commit 8ce5471c25
13 changed files with 864 additions and 72 deletions
+16 -3
View File
@@ -1,13 +1,15 @@
/**
* WORK_ITEMS — 1:1 from the original d59f7a97fb1c563f.js (module 28116),
* minus the passcode-protected entry (the original grid also omits it until
* the passcode is unlocked: `WORK_ITEMS.filter(t => !t.passcodeProtected ||
* lookup(t.href))` — the locked one reveals the brand label "TikTok").
* including the passcode-protected first entry (the original grid filters it
* via `WORK_ITEMS.filter(t => !t.passcodeProtected || lookup(t.href))` — the
* locked one reveals the brand label "TikTok"; see WorkSection).
*
* Internal hrefs (/reunimos, /inspire_mono, …) are detail-page routes that
* do not exist in this clone yet; WorkSection renders them as inert links
* until the route system is ported.
*/
import { revealBrandLabel } from "@/lib/passcode";
export type WorkItem = {
name: string;
imageUrl: string;
@@ -17,11 +19,22 @@ export type WorkItem = {
type: "post" | "tools" | "event";
gridClass: string;
codingProject?: boolean;
passcodeProtected?: boolean;
};
export const SELECTED_WORK_SECTION_ID = "selected-work";
export const WORK_ITEMS: WorkItem[] = [
{
name: revealBrandLabel(), // "TikTok" — obfuscated in the original bundle
imageUrl: "/work/tt01.png",
hoverImageUrl: "/work/tt02.png",
href: "/2026",
year: "2022-2026",
type: "post",
gridClass: "col-span-12 lg:col-span-8 lg:col-start-3",
passcodeProtected: true,
},
{
name: "Reunimos™",
imageUrl: "/work/reunimos01.png",