feat: 北极新一中文个人站 — MiSans 分片字体 + 全站内容国内化
- 字体: cn-font-split 分片 MiSans(4字重×~88片, unicode-range 按需加载) 接入 --font-sans/--font-mono/--font-mono-2 栈尾; 修复 next/font 与 Tailwind @theme 变量重名导致的死规则(--font-geist-mono/--font-departure-mono) - 内容: 品牌名/首屏/关于/导航/页脚/滚动段/文章页 UI/解锁屏全部中文化; 元数据 title 北极新一©2026, lang=zh-CN; 日期中文格式 - 彩蛋: 品牌标签 TikTok→小红书(保留 char-code 混淆与口令机制), /2026 文案改为个人创作手记语境 - 页脚: 邮箱 + 抖音/微信/小红书; 有链接项点击新开主页, 全部支持悬停 二维码卡片(正方形白衬+object-contain 防变形); 无链接项(微信)点击弹 二维码浮层 - 移除原作者手写签名动画(AboutMedia) - 构建: cn-font-split devDependency + onlyBuiltDependencies 允许列表
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import SvgSignature from "@/components/dom/SvgSignature";
|
||||
import { imageLayerTargets } from "@/lib/imageLayers";
|
||||
|
||||
/**
|
||||
* About-section left cell — exact original markup:
|
||||
* About-section left cell — markup follows the original layout minus the
|
||||
* original author's hand-drawn SVG signature (SvgSignature, haoqi 的手写
|
||||
* 签名动画,不属于北极新一,已移除;如需签名效果可换自己的 SVG 后再加回):
|
||||
* <div className="relative col-span-12 sm:col-span-4 lg:col-span-3 p-2">
|
||||
* <SvgSignature className="-top-1/32 -left-1/12 absolute w-3/4 pointer-events-none" />
|
||||
* <div ref={n} className="aspect-square" />
|
||||
* </div>
|
||||
* The aspect-square div is the tracked target ("about" layer) that the
|
||||
@@ -15,7 +15,6 @@ import { imageLayerTargets } from "@/lib/imageLayers";
|
||||
export default function AboutMedia() {
|
||||
return (
|
||||
<div className="relative col-span-12 sm:col-span-4 lg:col-span-3 p-2">
|
||||
<SvgSignature className="-top-1/32 -left-1/12 absolute w-3/4 pointer-events-none" />
|
||||
<div
|
||||
ref={(el) => {
|
||||
imageLayerTargets.about.current = el;
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
"use client";
|
||||
|
||||
import { useCallback, useState } from "react";
|
||||
import ScrambleReveal from "@/components/dom/ScrambleReveal";
|
||||
|
||||
/**
|
||||
* #contact footer — 1:1 port of the original footer (chunk 2689132c4e070b68.js
|
||||
* module 28192):
|
||||
* #contact footer — ported from the original footer (chunk
|
||||
* 2689132c4e070b68.js module 28192),内容已中文化并替换为北极新一的联系方式:
|
||||
*
|
||||
* - `<footer id="contact">` fills the last viewport (h-dvh / lg:h-screen)
|
||||
* and carries `data-section="footer"` — SmoothScroller's sP f2 factor and
|
||||
* PostFX's bright-source gating both read this attribute.
|
||||
* - Headline: three 12-col grid rows at 6svw, "Let's / Create / Something /
|
||||
* Extraordinary"; "Create" and "Extraordinary" use reverse reveal (chars
|
||||
* run last→first).
|
||||
* - Bottom bar: mailto + Twitter/X / Figma / GitHub links with the dotted
|
||||
* hover border.
|
||||
*
|
||||
* NOTE: contact email is chenchun@virtheart.com (user-provided); social
|
||||
* URLs are still placeholders.
|
||||
* - Headline: 「让我们 / 创造 / 一些不凡的 / 数字作品」,
|
||||
* "创造" 与 "数字作品" 行用 reverse reveal(字符从末位向前)。
|
||||
* - Bottom bar: mailto + 抖音 / 微信 / 小红书:
|
||||
* - 抖音、小红书:点击新窗口打开主页链接;悬停显示二维码卡片。
|
||||
* - 微信:无链接,点击弹出二维码浮层(移动端无 hover 也能查看)。
|
||||
*/
|
||||
|
||||
const CONTACT_EMAIL = "chenchun@virtheart.com";
|
||||
@@ -24,13 +22,72 @@ const CONTACT_EMAIL = "chenchun@virtheart.com";
|
||||
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";
|
||||
|
||||
const SOCIALS = [
|
||||
{ href: "#", label: "Twitter/X" },
|
||||
{ href: "#", label: "Figma" },
|
||||
{ href: "#", label: "GitHub" },
|
||||
type Social = {
|
||||
key: string;
|
||||
label: string;
|
||||
qr: string;
|
||||
href?: string;
|
||||
/** 无链接的条目(微信):点击弹出二维码浮层。 */
|
||||
qrOnly?: boolean;
|
||||
hint: string;
|
||||
};
|
||||
|
||||
const SOCIALS: Social[] = [
|
||||
{
|
||||
key: "douyin",
|
||||
label: "抖音",
|
||||
qr: "/img/douyin.png",
|
||||
href: "https://www.douyin.com/user/MS4wLjABAAAArYzCh3gIgSsDfQcN84MsMLoHFznc4wmNWJ5NsQR7T5naf21t-sCGc_tQdd4MV0zr",
|
||||
hint: "扫码或点击打开抖音主页",
|
||||
},
|
||||
{
|
||||
key: "wechat",
|
||||
label: "微信",
|
||||
qr: "/img/wechat.png",
|
||||
qrOnly: true,
|
||||
hint: "扫码添加微信",
|
||||
},
|
||||
{
|
||||
key: "xiaohongshu",
|
||||
label: "小红书",
|
||||
qr: "/img/xiaohongshu.jpg",
|
||||
href: "https://www.xiaohongshu.com/user/profile/6656326f0000000003033107",
|
||||
hint: "扫码或点击打开小红书主页",
|
||||
},
|
||||
];
|
||||
|
||||
function QrPreview({ social }: { social: Social }) {
|
||||
return (
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="bottom-full right-0 z-20 absolute mb-3 hidden flex-col items-center gap-2 lg:group-hover:flex"
|
||||
>
|
||||
<span className="flex w-44 flex-col items-center gap-2 bg-be p-3 shadow-[0_8px_32px_rgba(0,0,0,0.18)]">
|
||||
{/* 严格正方形的白色内衬 + object-contain:无论源图留白如何,
|
||||
二维码始终 1:1 完整显示,白底保证可扫。 */}
|
||||
<span className="block aspect-square w-full bg-white p-1.5">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element -- 静态二维码 */}
|
||||
<img
|
||||
src={social.qr}
|
||||
alt=""
|
||||
width={152}
|
||||
height={152}
|
||||
className="block h-full w-full object-contain select-none"
|
||||
draggable={false}
|
||||
/>
|
||||
</span>
|
||||
<span className="text-xs normal-case text-l2 whitespace-nowrap">
|
||||
{social.hint}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
export default function FooterSection() {
|
||||
const [activeQr, setActiveQr] = useState<Social | null>(null);
|
||||
const closeQr = useCallback(() => setActiveQr(null), []);
|
||||
|
||||
return (
|
||||
<footer
|
||||
id="contact"
|
||||
@@ -38,17 +95,17 @@ export default function FooterSection() {
|
||||
className="z-10 relative flex flex-col justify-center p-6 lg:p-16 w-full h-dvh lg:h-screen pointer-events-none"
|
||||
>
|
||||
<div
|
||||
className="gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] uppercase leading-none"
|
||||
className="gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] leading-none"
|
||||
style={{ fontVariationSettings: '"wdth" 120' }}
|
||||
>
|
||||
<ScrambleReveal
|
||||
text="Let's"
|
||||
text="让我们"
|
||||
className="col-span-6 md:col-span-5 xl:col-span-4 md:col-start-2 xl:col-start-3 text-left pointer-events-auto"
|
||||
startDelayMs={300}
|
||||
scrambleColors={false}
|
||||
/>
|
||||
<ScrambleReveal
|
||||
text="Create"
|
||||
text="创造"
|
||||
className="col-span-6 md:col-span-5 xl:col-span-4 text-right pointer-events-auto"
|
||||
startDelayMs={300}
|
||||
reverse
|
||||
@@ -56,22 +113,22 @@ export default function FooterSection() {
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] uppercase leading-none"
|
||||
className="gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] leading-none"
|
||||
style={{ fontVariationSettings: '"wdth" 120' }}
|
||||
>
|
||||
<ScrambleReveal
|
||||
text="Something"
|
||||
text="一些不凡的"
|
||||
className="col-span-12 md:col-start-2 xl:col-start-3 text-left pointer-events-auto"
|
||||
startDelayMs={300}
|
||||
scrambleColors={false}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] uppercase leading-none"
|
||||
className="gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] leading-none"
|
||||
style={{ fontVariationSettings: '"wdth" 120' }}
|
||||
>
|
||||
<ScrambleReveal
|
||||
text="Extraordinary"
|
||||
text="数字作品"
|
||||
className="col-span-12 md:col-end-12 xl:col-end-11 text-right pointer-events-auto"
|
||||
startDelayMs={300}
|
||||
reverse
|
||||
@@ -88,24 +145,74 @@ export default function FooterSection() {
|
||||
/>
|
||||
</a>
|
||||
<div className="flex flex-row items-center gap-2 lg:gap-4">
|
||||
{/* TODO: replace with the real VIRTHEART social URLs. */}{SOCIALS.map(({ href, label }) => (
|
||||
<a
|
||||
key={label}
|
||||
className={dottedLink}
|
||||
href={href}
|
||||
target={href.startsWith("http") ? "_blank" : undefined}
|
||||
rel={href.startsWith("http") ? "noopener noreferrer" : undefined}
|
||||
>
|
||||
<ScrambleReveal
|
||||
text={label}
|
||||
startDelayMs={300}
|
||||
scrambleColors={false}
|
||||
/>
|
||||
</a>
|
||||
))}
|
||||
{SOCIALS.map((social) => {
|
||||
const inner = (
|
||||
<>
|
||||
<ScrambleReveal
|
||||
text={social.label}
|
||||
startDelayMs={300}
|
||||
scrambleColors={false}
|
||||
/>
|
||||
<QrPreview social={social} />
|
||||
</>
|
||||
);
|
||||
const groupCls = `${dottedLink} group relative`;
|
||||
if (social.href) {
|
||||
return (
|
||||
<a
|
||||
key={social.key}
|
||||
className={groupCls}
|
||||
href={social.href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
aria-label={`${social.label}主页(新窗口打开)`}
|
||||
>
|
||||
{inner}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<button
|
||||
key={social.key}
|
||||
type="button"
|
||||
className={`${groupCls} text-left`}
|
||||
aria-label="微信 — 点击显示二维码"
|
||||
onClick={() => setActiveQr(social)}
|
||||
>
|
||||
{inner}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 二维码浮层(微信等无链接条目;移动端无 hover 的兜底) */}
|
||||
{activeQr && (
|
||||
<div
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label={`${activeQr.label}二维码`}
|
||||
className="inset-0 z-50 fixed flex justify-center items-center bg-b1/80 p-6 pointer-events-auto"
|
||||
onClick={closeQr}
|
||||
>
|
||||
<div className="flex flex-col items-center gap-4 bg-be p-8">
|
||||
<span className="block aspect-square w-64 bg-white p-2 sm:w-80">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element -- 静态二维码 */}
|
||||
<img
|
||||
src={activeQr.qr}
|
||||
alt={`${activeQr.label}二维码`}
|
||||
width={288}
|
||||
height={288}
|
||||
className="block h-full w-full object-contain select-none"
|
||||
draggable={false}
|
||||
/>
|
||||
</span>
|
||||
<span className="text-sm text-l2">{activeQr.hint}</span>
|
||||
<span className="font-mono-2 text-xs text-l3">点击任意处关闭</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
+14
-15
@@ -35,10 +35,10 @@ const dotted =
|
||||
"relative before:content-[''] before:absolute before:inset-0 before:border-2 before:border-dotted before:border-transparent before:pointer-events-none before:transition-colors before:duration-200 lg:hover:before:border-l1";
|
||||
|
||||
function useBrowserName(): string {
|
||||
const [name, setName] = useState("Unknown");
|
||||
const [name, setName] = useState("未知");
|
||||
useEffect(() => {
|
||||
const ua = navigator.userAgent;
|
||||
let result = "Unknown";
|
||||
let result = "未知";
|
||||
if (/Edg\//.test(ua)) result = "Edge";
|
||||
else if (/OPR\//.test(ua)) result = "Opera";
|
||||
else if (/Firefox\//.test(ua)) result = "Firefox";
|
||||
@@ -179,10 +179,10 @@ export default function Header() {
|
||||
}, [resetHint, setTheme, toggleSound]);
|
||||
|
||||
const themeLabel =
|
||||
theme === "light" ? "THEME[L]" : theme === "dark" ? "THEME[D]" : "THEME[A]";
|
||||
theme === "light" ? "主题[L]" : theme === "dark" ? "主题[D]" : "主题[A]";
|
||||
const soundLabel = soundEnabled
|
||||
? `SOUND[${SPINNER[spinnerIndex]}]`
|
||||
: "SOUND[\u00B7]";
|
||||
? `音效[${SPINNER[spinnerIndex]}]`
|
||||
: "音效[·]";
|
||||
|
||||
const toggleCommon =
|
||||
"inline-flex shrink-0 items-baseline gap-0 normal-case";
|
||||
@@ -199,8 +199,7 @@ export default function Header() {
|
||||
style={{ fontVariationSettings: '"wght" 700, "wdth" 120' }}
|
||||
href="/"
|
||||
>
|
||||
<ScrambleReveal text="haoqi" startDelayMs={300} scrambleColors={false} />
|
||||
<ScrambleReveal text=".design" startDelayMs={300} scrambleColors={false} />
|
||||
<ScrambleReveal text="北极新一" startDelayMs={300} scrambleColors={false} />
|
||||
</a>
|
||||
<div className="hidden lg:flex flex-wrap justify-between items-center gap-x-3 gap-y-2 pointer-events-auto basis-1/2 xl:basis-1/3">
|
||||
<button
|
||||
@@ -208,19 +207,19 @@ export default function Header() {
|
||||
className={`${dotted} p-2 uppercase cursor-pointer`}
|
||||
onClick={() => scrollEnv.scrollToSection("#selected-work")}
|
||||
>
|
||||
<ScrambleReveal text="Work" startDelayMs={300} scrambleColors={false} />
|
||||
<ScrambleReveal text="作品" startDelayMs={300} scrambleColors={false} />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`${dotted} p-2 uppercase cursor-pointer`}
|
||||
onClick={() => scrollEnv.scrollToSection("#contact")}
|
||||
>
|
||||
<ScrambleReveal text="Contact" startDelayMs={300} scrambleColors={false} />
|
||||
<ScrambleReveal text="联系" startDelayMs={300} scrambleColors={false} />
|
||||
</button>
|
||||
<span
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
aria-label={`Theme: ${theme}`}
|
||||
aria-label={`主题:${theme === "light" ? "浅色" : theme === "dark" ? "深色" : "跟随系统"}`}
|
||||
className={`${dotted} ${toggleCommon} p-2 uppercase cursor-pointer pointer-events-auto`}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
@@ -247,7 +246,7 @@ export default function Header() {
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
aria-label={
|
||||
soundEnabled ? "Sound playing, click to pause" : "Sound paused, click to play"
|
||||
soundEnabled ? "音效播放中,点击暂停" : "音效已暂停,点击播放"
|
||||
}
|
||||
aria-pressed={soundEnabled}
|
||||
className={`${dotted} ${toggleCommon} p-2 uppercase cursor-pointer pointer-events-auto`}
|
||||
@@ -296,7 +295,7 @@ export default function Header() {
|
||||
per-char 10ms stagger over the wrapped lines produces the
|
||||
top-to-bottom green sweep. */}
|
||||
<ScrambleReveal
|
||||
text="Press [L] for light mode, [D] for dark mode, [A] for auto mode, or click THEME. Press [S] to pause or resume background music, or click SOUND; your choice is saved in this browser. [T] scroll to top, [B] scroll to bottom."
|
||||
text="按 [L] 切换浅色模式,[D] 切换深色模式,[A] 跟随系统,也可以点击「主题」。按 [S] 暂停或恢复背景音乐,也可以点击「音效」,你的选择会保存在当前浏览器。[T] 回到顶部,[B] 滚动到底部。"
|
||||
startDelayMs={0}
|
||||
letterDelayMs={10}
|
||||
/>
|
||||
@@ -340,10 +339,10 @@ export default function Header() {
|
||||
scrambleColors={false}
|
||||
/>
|
||||
</span>
|
||||
{/* VIRTHEART copyright — replaces the original RotatingGlobe. */}
|
||||
<span className="hidden lg:inline p-2 uppercase">
|
||||
{/* 版权行 — 替代原站的 RotatingGlobe。 */}
|
||||
<span className="hidden lg:inline p-2">
|
||||
<ScrambleReveal
|
||||
text={`VIRTHEART (c) ${year}`}
|
||||
text={`北极新一 (c) ${year}`}
|
||||
startDelayMs={300}
|
||||
letterDelayMs={40}
|
||||
scrambleColors={false}
|
||||
|
||||
@@ -45,9 +45,9 @@ const STAGES = [
|
||||
|
||||
type Stage = (typeof STAGES)[number]["stage"];
|
||||
|
||||
const SEG0_PRIMARY = ["Innovate", "with", "purpose"];
|
||||
const SEG0_SECONDARY = ["Innovate", "with a", "human touch"];
|
||||
const END_LINES = ["FUTURE-FIRST", "ALWAYS"];
|
||||
const SEG0_PRIMARY = ["以创新", "拥抱", "目标"];
|
||||
const SEG0_SECONDARY = ["以创新", "怀抱一份", "人情的温度"];
|
||||
const END_LINES = ["面向未来", "始终如一"];
|
||||
|
||||
const clamp = (v: number, min: number, max: number) =>
|
||||
Math.min(max, Math.max(min, v));
|
||||
@@ -470,24 +470,24 @@ function Seg1({ ringProgress01 }: { ringProgress01: number }) {
|
||||
<>
|
||||
<Ring progress01={ringProgress01} />
|
||||
<div className="col-span-8 lg:col-span-4 col-start-1 lg:col-start-7 row-start-2 p-2 font-medium text-[5.6svw] lg:text-3xl leading-tight">
|
||||
<StaggerText text="Building tomorrow's" />
|
||||
<StaggerText text="构建明天的" />
|
||||
<br />
|
||||
<StaggerText text="digital products." />
|
||||
<StaggerText text="数字产品。" />
|
||||
</div>
|
||||
<div className="col-span-8 lg:col-span-4 col-start-5 lg:col-start-9 row-start-3 p-2 font-medium text-[5.6svw] lg:text-3xl leading-tight">
|
||||
<StaggerText text="Independent by" />
|
||||
<StaggerText text="设计与工程" />
|
||||
<br />
|
||||
<StaggerText text="design & engineering." />
|
||||
<StaggerText text="独立完成。" />
|
||||
</div>
|
||||
<div className="col-span-8 lg:col-span-4 col-start-1 lg:col-start-2 row-start-4 p-2 font-medium text-[5.6svw] lg:text-3xl leading-tight">
|
||||
<StaggerText text="Clarity first." />
|
||||
<StaggerText text="先讲清晰。" />
|
||||
<br />
|
||||
<StaggerText text="Delight second." />
|
||||
<StaggerText text="再谈愉悦。" />
|
||||
</div>
|
||||
<div className="col-span-8 lg:col-span-4 col-start-5 lg:col-start-4 row-start-5 p-2 font-medium text-[5.6svw] lg:text-3xl leading-tight">
|
||||
<StaggerText text="Ship in small loops." />
|
||||
<StaggerText text="小步快跑交付。" />
|
||||
<br />
|
||||
<StaggerText text="Aim for long arcs." />
|
||||
<StaggerText text="着眼长期主义。" />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* About-paragraph passcode easter egg — 1:1 port of the original components
|
||||
* `c9` + `c2` (chunk 4d3f3b68dbbde33a.js):
|
||||
* About-paragraph passcode easter egg — ported from the original components
|
||||
* `c9` + `c2` (chunk 4d3f3b68dbbde33a.js),品牌标签国内化为「小红书」:
|
||||
*
|
||||
* - Locked: the brand label slot scrambles as "■■■■■■" (each char wrapped,
|
||||
* - Locked: the brand label slot scrambles as "■■" (each char wrapped,
|
||||
* PASSCODE_LOCKED_CHAR_CLASS); clicking navigates through the route
|
||||
* transition to /unlock/2026?return=%2F.
|
||||
* - Unlocked: the slot settles to the "TikTok" button span — long-press
|
||||
* - Unlocked: the slot settles to the "小红书" button span — long-press
|
||||
* (500ms) or context-menu re-locks (confirm + reload).
|
||||
* - The reveal sequence (ScrambleReveal) treats the label as a slot part, so
|
||||
* its 6 characters participate in the per-char scramble timing.
|
||||
* its characters participate in the per-char scramble timing.
|
||||
*/
|
||||
import { useCallback, useRef } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -30,8 +30,8 @@ import {
|
||||
} from "@/lib/passcode";
|
||||
|
||||
const SCOPE = primaryPasscodePath(); // "/2026"
|
||||
const BRAND = revealBrandLabel(); // "TikTok"
|
||||
const BRAND_LEN = revealBrandLabelLength(); // 6
|
||||
const BRAND = revealBrandLabel(); // "小红书"
|
||||
const BRAND_LEN = revealBrandLabelLength(); // 2
|
||||
|
||||
function RevealLabelButton() {
|
||||
const allowed = usePasscodeAllowed(SCOPE);
|
||||
@@ -47,7 +47,7 @@ function RevealLabelButton() {
|
||||
|
||||
const relock = useCallback(async () => {
|
||||
if (
|
||||
window.confirm("Lock protected content again? You will need the passcode to view it.")
|
||||
window.confirm("要重新锁定受保护的内容吗?再次查看需要输入口令。")
|
||||
) {
|
||||
await logoutPasscodeAccess({ reload: true });
|
||||
}
|
||||
@@ -62,7 +62,7 @@ function RevealLabelButton() {
|
||||
<span
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
aria-label="Protected — enter passcode to reveal"
|
||||
aria-label="受保护内容 — 输入口令后显示"
|
||||
className="inline-flex items-baseline gap-[0.12em] mx-[0.06em] align-baseline cursor-pointer select-text"
|
||||
onClick={go}
|
||||
onKeyDown={(e) => {
|
||||
@@ -87,7 +87,7 @@ function RevealLabelButton() {
|
||||
<span
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
aria-label={`${BRAND} — long press to lock again`}
|
||||
aria-label={`${BRAND} — 长按可重新锁定`}
|
||||
className="inline mx-[0.06em] align-baseline cursor-default select-none"
|
||||
onPointerDown={() => {
|
||||
clearTimer();
|
||||
@@ -117,14 +117,14 @@ export default function PasscodeRevealText({
|
||||
}) {
|
||||
const allowed = usePasscodeAllowed(SCOPE);
|
||||
const parts = [
|
||||
"I'm Haoqi Wen, leading Design Engineering and AI exploration at ",
|
||||
"我是北极新一,一名横跨设计与工程的全栈开发者:Web 前端与后端、Flutter 客户端、AI 应用开发都有实践,也从产品设计一路做到工程落地。工作之外,我常在 ",
|
||||
{
|
||||
length: BRAND_LEN,
|
||||
scramble: allowed ? BRAND : passcodeLockedPlaceholderText(),
|
||||
className: allowed ? undefined : PASSCODE_LOCKED_SCRAMBLE_CLASS,
|
||||
settled: <RevealLabelButton />,
|
||||
},
|
||||
", engineering, and AI at scale. Outside work, I build design tools for team efficiency.",
|
||||
" 上记录与分享这些探索。",
|
||||
];
|
||||
return (
|
||||
<ScrambleReveal
|
||||
|
||||
@@ -103,7 +103,7 @@ export function PasscodeUnlockScreen({
|
||||
onClick={() => inputRef.current?.focus()}
|
||||
>
|
||||
<label className="sr-only" htmlFor={inputId}>
|
||||
Passcode for {path}
|
||||
{path} 的访问口令
|
||||
</label>
|
||||
<input
|
||||
ref={inputRef}
|
||||
@@ -121,7 +121,7 @@ export function PasscodeUnlockScreen({
|
||||
status === "success" ? "text-l1" : "text-l3"
|
||||
}`}
|
||||
>
|
||||
{status === "success" ? "Access granted" : "Please enter passcode"}
|
||||
{status === "success" ? "验证通过" : "请输入访问口令"}
|
||||
</span>
|
||||
<div ref={rowRef} className="flex gap-3">
|
||||
{Array.from({ length: slotCount }).map((_, i) => {
|
||||
|
||||
@@ -38,6 +38,13 @@ import { useRouteTransitionController } from "@/lib/routeTransition";
|
||||
// Module-level cache mirroring the original `o` (persists across remounts).
|
||||
const ratioCache: Record<string, string> = {};
|
||||
|
||||
/** 作品卡片右下角类型角标(post 不显示角标)。 */
|
||||
const TYPE_LABELS: Record<WorkItem["type"], string> = {
|
||||
post: "文章",
|
||||
tools: "工具",
|
||||
event: "活动",
|
||||
};
|
||||
|
||||
export default function WorkSection() {
|
||||
const [ratios, setRatios] = useState<Record<string, string>>({ ...ratioCache });
|
||||
const [colWidth, setColWidth] = useState(0);
|
||||
@@ -124,7 +131,7 @@ export default function WorkSection() {
|
||||
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";
|
||||
const label = `${item.name} - ${item.year}${external ? " (external)" : ""}`;
|
||||
const label = `${item.name} - ${item.year}${external ? "(外部链接)" : ""}`;
|
||||
const target = getLayerTarget(item.href);
|
||||
const { startNavigation } = useRouteTransitionController();
|
||||
const allowed = usePasscodeAllowed(item.href);
|
||||
@@ -143,7 +150,7 @@ function WorkCard({ item, ratio }: { item: WorkItem; ratio?: string }) {
|
||||
className="top-0 right-0 z-10 absolute bg-selection px-1 font-mono-2 text-black text-xs uppercase pointer-events-none select-none"
|
||||
aria-hidden="true"
|
||||
>
|
||||
Coding Project
|
||||
代码项目
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -153,7 +160,7 @@ function WorkCard({ item, ratio }: { item: WorkItem; ratio?: string }) {
|
||||
<span>{item.year}</span>
|
||||
{item.type !== "post" && (
|
||||
<span className="hidden lg:inline-flex items-center gap-1" aria-hidden="true">
|
||||
<span>{item.type}</span>
|
||||
<span>{TYPE_LABELS[item.type] ?? item.type}</span>
|
||||
<span>↗</span>
|
||||
</span>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user