From 1a12c70462d4104235b3cccad6cac485574c3368 Mon Sep 17 00:00:00 2001 From: chenchun Date: Wed, 2 Sep 2026 17:33:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BD=9C=E5=93=81=E5=8C=BA=E7=A9=BA?= =?UTF-8?q?=E7=8A=B6=E6=80=81=20=E2=80=94=20=E7=BC=96=E5=8F=B7=E5=8F=99?= =?UTF-8?q?=E4=BA=8B=E5=8D=A0=E4=BD=8D=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WORK_ITEMS 过滤后为空(含只挂锁定条目)时渲染「第一批作品正在打磨」 空状态:大字 scramble 标题 + NO.001-003 骨架卡(点阵纹理 + 虚线框 + 制作中/20XX 标签,复用真实网格不对称节奏)+ 小红书/抖音/邮箱 CTA。 - 占位卡不注册 WebGL 图层,纯 DOM 渲染,加首个真实作品自动切回 - 联系方式抽到 lib/socials.ts 供页脚与空状态共用 - lint 与基线一致(119 errors 均为存量) --- components/dom/FooterSection.tsx | 3 +- components/dom/WorkSection.tsx | 151 ++++++++++++++++++++++++++++++- lib/socials.ts | 26 ++++++ 3 files changed, 174 insertions(+), 6 deletions(-) create mode 100644 lib/socials.ts diff --git a/components/dom/FooterSection.tsx b/components/dom/FooterSection.tsx index 454d8b7..6521ca6 100644 --- a/components/dom/FooterSection.tsx +++ b/components/dom/FooterSection.tsx @@ -2,6 +2,7 @@ import { useCallback, useState } from "react"; import ScrambleReveal from "@/components/dom/ScrambleReveal"; +import { CONTACT_EMAIL } from "@/lib/socials"; /** * #contact footer — ported from the original footer (chunk @@ -17,7 +18,7 @@ import ScrambleReveal from "@/components/dom/ScrambleReveal"; * - 微信:无链接,点击弹出二维码浮层(移动端无 hover 也能查看)。 */ -const CONTACT_EMAIL = "chenchun@virtheart.com"; +// CONTACT_EMAIL 来自 @/lib/socials(与空作品区 CTA 共享)。 const dottedLink = "block before:absolute relative before:inset-0 p-2 lg:hover:before:border-l1 before:border-2 before:border-transparent active:before:border-l1 before:border-dotted uppercase before:content-[''] before:transition-colors before:duration-200 cursor-pointer pointer-events-auto before:pointer-events-none"; diff --git a/components/dom/WorkSection.tsx b/components/dom/WorkSection.tsx index 1028036..ce0bf75 100644 --- a/components/dom/WorkSection.tsx +++ b/components/dom/WorkSection.tsx @@ -14,9 +14,11 @@ import { import { usePasscodeAllowed, usePasscodeAccessLookup } from "@/components/dom/PasscodeAccess"; import { buildPasscodeUnlockHref } from "@/lib/passcode"; import { useRouteTransitionController } from "@/lib/routeTransition"; +import ScrambleReveal from "@/components/dom/ScrambleReveal"; +import { CONTACT_EMAIL, SOCIAL_LINKS } from "@/lib/socials"; /** - * Selected Work grid — 1:1 port of the original section `h` (chunk + * Selected Work grid — ported from the original section `h` (chunk * 2689132c4e070b68.js, exports SELECTED_WORK_SECTION_ID / default): * * - `
` @@ -32,7 +34,12 @@ import { useRouteTransitionController } from "@/lib/routeTransition"; * naturalWidth/naturalHeight into a module-level cache (original `o`). * - Passcode-protected items are filtered exactly like the original * `WORK_ITEMS.filter(t => !t.passcodeProtected || lookup(t.href))`: the - * TikTok entry only appears once /2026 is unlocked. + * 小红书 entry only appears once /2026 is unlocked. + * + * 空状态(EmptyWorkState):WORK_ITEMS 过滤后为空(包括只挂锁定条目)时 + * 渲染「编号叙事」占位——大字「第一批作品正在打磨」+ NO.00x 骨架卡 + + * 社交/邮箱 CTA。占位卡不注册 WebGL 图层(纯 DOM 点阵纹理),加入第一个 + * 真实作品后自动切回正常网格,零迁移成本。 */ // Module-level cache mirroring the original `o` (persists across remounts). @@ -45,6 +52,21 @@ const TYPE_LABELS: Record = { event: "活动", }; +/** 空状态占位卡 — 复用真实网格的不对称节奏(大卡 + 两张小卡)。 */ +const EMPTY_PLACEHOLDERS = [ + { no: "NO.001", gridClass: "col-span-12 lg:col-span-8 lg:col-start-3" }, + { + no: "NO.002", + gridClass: + "col-span-6 lg:col-start-5 lg:col-span-4 xl:col-start-6 xl:col-span-3", + }, + { + no: "NO.003", + gridClass: + "col-span-6 lg:col-start-9 lg:col-span-4 xl:col-start-10 xl:col-span-3", + }, +] as const; + export default function WorkSection() { const [ratios, setRatios] = useState>({ ...ratioCache }); const [colWidth, setColWidth] = useState(0); @@ -110,6 +132,9 @@ export default function WorkSection() { // eslint-disable-next-line react-hooks/exhaustive-deps -- ratios-only effect; matches the original mount-time preload }, [visibleItems]); + // 空状态:过滤后没有任何可见作品(包括只挂锁定条目的情况)。 + const showEmpty = visibleItems.length === 0; + return (
- {visibleItems.map((item) => ( - - ))} + {showEmpty ? ( + + ) : ( + visibleItems.map((item) => ( + + )) + )}
); } +/** + * 空作品区 — 编号叙事占位: + * 「第一批作品 / 正在打磨」大字 + NO.00x 骨架卡 + 社交/邮箱 CTA。 + * 占位卡刻意保留真实卡片的网格位置与标签行结构,但视觉是纯 DOM 点阵 + + * 虚线框(不注册 WebGL 图层),hover 不会触发 canvas 投影。 + */ +function EmptyWorkState() { + return ( + <> +
+

+ +
+ +

+

+ +

+
+ {EMPTY_PLACEHOLDERS.map((p) => ( + + ))} +
+ + {SOCIAL_LINKS.map((s) => ( + + + + ))} + + + + +
+ + ); +} + +/** 占位骨架卡 — 点阵纹理 + 虚线框 + NO.00x 编号,纯展示不可点击。 */ +function PlaceholderCard({ no, gridClass }: { no: string; gridClass: string }) { + return ( +
+
+ +
+ + + +
+ 20XX +
+
+
+
+ ); +} + function WorkCard({ item, ratio }: { item: WorkItem; ratio?: string }) { const external = item.href.startsWith("http://") || item.href.startsWith("https://"); const cls = "group block space-y-3 p-2"; diff --git a/lib/socials.ts b/lib/socials.ts new file mode 100644 index 0000000..7ed25b9 --- /dev/null +++ b/lib/socials.ts @@ -0,0 +1,26 @@ +/** + * 站点联系方式与社交主页 — 唯一数据源。 + * FooterSection(页脚底栏)与 WorkSection(空作品区 CTA)共用, + * 新增/修改社交入口只改这里。 + */ + +export const CONTACT_EMAIL = "chenchun@virtheart.com"; + +export type SocialLink = { + key: string; + label: string; + href: string; +}; + +export const SOCIAL_LINKS: SocialLink[] = [ + { + key: "douyin", + label: "抖音", + href: "https://www.douyin.com/user/MS4wLjABAAAArYzCh3gIgSsDfQcN84MsMLoHFznc4wmNWJ5NsQR7T5naf21t-sCGc_tQdd4MV0zr", + }, + { + key: "xiaohongshu", + label: "小红书", + href: "https://www.xiaohongshu.com/user/profile/6656326f0000000003033107", + }, +];