285028c61d
- 字体: 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 允许列表
109 lines
3.9 KiB
TypeScript
109 lines
3.9 KiB
TypeScript
import type { Metadata } from "next";
|
||
import localFont from "next/font/local";
|
||
import "./globals.css";
|
||
import SmoothScroller from "@/components/dom/SmoothScroller";
|
||
import Header from "@/components/dom/Header";
|
||
import BackgroundGrid from "@/components/dom/BackgroundGrid";
|
||
import CustomScrollbar from "@/components/dom/CustomScrollbar";
|
||
import LoadingOverlay from "@/components/dom/LoadingOverlay";
|
||
import { HeroScene } from "@/components/canvas/HeroScene";
|
||
import { PasscodeAccessProvider } from "@/components/dom/PasscodeAccess";
|
||
import { FullscreenTransitionProvider } from "@/lib/routeTransition";
|
||
import RouteTransitionOverlay from "@/components/dom/RouteTransitionOverlay";
|
||
import { getPasscodeAccessServer } from "@/lib/passcodeServer";
|
||
|
||
const tiktokSans = localFont({
|
||
src: "./fonts/TikTokSans.ttf",
|
||
variable: "--font-tiktok",
|
||
display: "swap",
|
||
});
|
||
|
||
const geistMono = localFont({
|
||
src: "./fonts/GeistMono[wght].ttf",
|
||
variable: "--font-geist-mono",
|
||
display: "swap",
|
||
});
|
||
|
||
const departureMono = localFont({
|
||
src: "./fonts/DepartureMono-Regular.otf",
|
||
variable: "--font-departure-mono",
|
||
display: "swap",
|
||
});
|
||
|
||
// MiSans 中文走 cn-font-split 的 unicode-range 分片(public/fonts/misans/),
|
||
// 以 <link> 引入 —— 见下方 <head>;不进 next/font 管线(整包 5MB/字重)。
|
||
|
||
export const metadata: Metadata = {
|
||
// Detail pages override the title via generateMetadata in
|
||
// app/work/[slug]/layout.tsx (original: per-page title).
|
||
title: "北极新一©2026",
|
||
description: "设计与工程 / 数字产品与 AI 应用 © 2026",
|
||
};
|
||
|
||
export default async function RootLayout({
|
||
children,
|
||
}: Readonly<{
|
||
children: React.ReactNode;
|
||
}>) {
|
||
const initialAccess = await getPasscodeAccessServer();
|
||
return (
|
||
<html
|
||
lang="zh-CN"
|
||
className={`${tiktokSans.variable} ${geistMono.variable} ${departureMono.variable}`}
|
||
>
|
||
<head>
|
||
{/* MiSans 分片 CSS:~88 片/字重 × 4 字重,浏览器只下载
|
||
页面实际命中的 unicode-range 分片(首屏通常 <100KB)。
|
||
有意走 public 静态资源 + <link>:350+ 分片若交给打包器
|
||
处理会让构建显著变重(no-css-tags 警告在此预期内)。 */}
|
||
{/* eslint-disable-next-line @next/next/no-css-tags */}
|
||
<link
|
||
rel="stylesheet"
|
||
href="/fonts/misans/regular/result.css"
|
||
precedence="default"
|
||
suppressHydrationWarning
|
||
/>
|
||
{/* eslint-disable-next-line @next/next/no-css-tags */}
|
||
<link
|
||
rel="stylesheet"
|
||
href="/fonts/misans/medium/result.css"
|
||
precedence="default"
|
||
suppressHydrationWarning
|
||
/>
|
||
{/* eslint-disable-next-line @next/next/no-css-tags */}
|
||
<link
|
||
rel="stylesheet"
|
||
href="/fonts/misans/semibold/result.css"
|
||
precedence="default"
|
||
suppressHydrationWarning
|
||
/>
|
||
{/* eslint-disable-next-line @next/next/no-css-tags */}
|
||
<link
|
||
rel="stylesheet"
|
||
href="/fonts/misans/bold/result.css"
|
||
precedence="default"
|
||
suppressHydrationWarning
|
||
/>
|
||
</head>
|
||
<body className="min-h-screen relative">
|
||
<PasscodeAccessProvider initialAccess={initialAccess}>
|
||
<FullscreenTransitionProvider>
|
||
{/* Original stacking (1:1): the WebGL canvas host is a plain `fixed`
|
||
z-auto element first in the body; the grid overlay (z-20) comes
|
||
AFTER it in DOM order so it paints above the canvas, exactly like
|
||
the original's main > canvas + z-20 grid sibling. */}
|
||
<HeroScene />
|
||
<BackgroundGrid />
|
||
<SmoothScroller />
|
||
<Header />
|
||
{children}
|
||
<CustomScrollbar />
|
||
<RouteTransitionOverlay />
|
||
<LoadingOverlay />
|
||
</FullscreenTransitionProvider>
|
||
</PasscodeAccessProvider>
|
||
</body>
|
||
</html>
|
||
);
|
||
}
|