Build technical notes archive

This commit is contained in:
wxf
2026-06-09 09:30:28 +08:00
parent 0a1c46e037
commit 5eaa3cac79
115 changed files with 14916 additions and 184 deletions
+264 -10
View File
@@ -1,8 +1,8 @@
@import "tailwindcss";
:root {
--background: #101411;
--foreground: #f4efe4;
--background: #05050b;
--foreground: #ffffff;
}
@theme inline {
@@ -18,38 +18,292 @@
}
html {
background: var(--background);
overflow-x: clip;
overscroll-behavior-y: none;
scroll-behavior: smooth;
}
body {
margin: 0;
min-height: 100dvh;
overflow-x: clip;
background: var(--background);
color: var(--foreground);
font-family: var(--font-body), sans-serif;
}
::selection {
background: #d3ff30;
color: #101411;
background: #22d3ee;
color: #05050b;
}
a {
text-decoration: none;
}
.noise-layer {
.tech-doc-content {
animation: doc-rise 720ms ease both;
contain: paint;
max-width: 100%;
color: rgba(255, 255, 255, 0.74);
font-size: 16px;
line-height: 2;
overflow-wrap: anywhere;
}
.tech-doc-toc a {
text-decoration: none;
}
.tech-doc-toc div::-webkit-scrollbar,
.tech-doc-content pre::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.tech-doc-toc div::-webkit-scrollbar-thumb,
.tech-doc-content pre::-webkit-scrollbar-thumb {
border-radius: 999px;
background: rgba(103, 232, 249, 0.38);
}
.tech-doc-content::before {
content: "";
display: block;
height: 3px;
margin-bottom: 28px;
border-radius: 999px;
background: linear-gradient(90deg, #22d3ee, #a855f7, #f0abfc, #84cc16);
box-shadow: 0 0 26px rgba(34, 211, 238, 0.42);
}
.tech-doc-content :where(h3, h4) {
margin: 42px 0 16px;
scroll-margin-top: 32px;
color: #ffffff;
font-weight: 900;
line-height: 1.35;
}
.tech-doc-content h3 {
font-size: clamp(1.45rem, 2vw, 2rem);
background: linear-gradient(90deg, #67e8f9, #f0abfc 58%, #bef264);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
text-shadow: 0 0 30px rgba(34, 211, 238, 0.2);
}
.tech-doc-content h4 {
font-size: 1.05rem;
color: #a5f3fc;
}
.tech-doc-content :where(p, ul, ol, blockquote, pre) {
margin: 16px 0;
}
.tech-doc-content :where(ul, ol) {
padding-left: 1.35rem;
}
.tech-doc-content li {
margin: 8px 0;
padding-left: 0.2rem;
}
.tech-doc-content li::marker {
color: #67e8f9;
font-weight: 800;
}
.tech-doc-content a {
color: #67e8f9;
border-bottom: 1px solid rgba(103, 232, 249, 0.35);
transition:
color 160ms ease,
border-color 160ms ease,
text-shadow 160ms ease;
}
.tech-doc-content a:hover {
color: #f0abfc;
border-color: rgba(240, 171, 252, 0.75);
text-shadow: 0 0 18px rgba(240, 171, 252, 0.35);
}
.tech-doc-content strong {
color: #ffffff;
font-weight: 900;
}
.tech-doc-content code {
border: 1px solid rgba(103, 232, 249, 0.18);
border-radius: 8px;
background: rgba(34, 211, 238, 0.1);
color: #a5f3fc;
font-family: var(--font-code), monospace;
font-size: 0.9em;
padding: 0.1rem 0.38rem;
}
.tech-doc-content pre {
position: relative;
max-width: 100%;
min-width: 0;
width: 100%;
overflow-x: auto;
border: 1px solid rgba(45, 212, 191, 0.28);
border-radius: 20px;
padding-top: 2.75rem;
background:
linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0 2.75rem, transparent 2.75rem),
radial-gradient(circle at 16% 0%, rgba(45, 212, 191, 0.2), transparent 28%),
radial-gradient(circle at 88% 8%, rgba(14, 165, 233, 0.22), transparent 26%),
#020617;
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.08),
inset 0 0 0 1px rgba(255, 255, 255, 0.03),
0 16px 46px rgba(2, 6, 23, 0.42),
0 0 24px rgba(45, 212, 191, 0.08);
}
.tech-doc-content pre::before {
content: attr(data-language);
position: absolute;
left: 1.1rem;
top: 0.9rem;
color: #5eead4;
font-family: var(--font-code), monospace;
font-size: 0.72rem;
font-weight: 800;
letter-spacing: 0.16em;
}
.tech-doc-code-copy {
position: absolute;
right: 0.85rem;
top: 0.56rem;
z-index: 1;
width: 4.1rem;
border: 1px solid rgba(103, 232, 249, 0.38);
border-radius: 999px;
background: rgba(8, 47, 73, 0.72);
color: #cffafe;
cursor: pointer;
font-family: var(--font-body), sans-serif;
font-size: 0.78rem;
font-weight: 800;
line-height: 1;
padding: 0.52rem 0.72rem;
transition:
background 160ms ease,
border-color 160ms ease,
box-shadow 160ms ease,
color 160ms ease;
}
.tech-doc-code-copy:hover,
.tech-doc-code-copy[data-copied="true"] {
border-color: rgba(94, 234, 212, 0.9);
background: rgba(20, 184, 166, 0.22);
color: #ffffff;
box-shadow: 0 0 24px rgba(45, 212, 191, 0.26);
}
.tech-doc-content pre code {
display: block;
width: max-content;
min-width: max-content;
max-width: none;
border: 0;
border-radius: 0;
background: transparent;
color: rgba(255, 255, 255, 0.82);
font-size: 0.88rem;
line-height: 1.8;
padding: 0 1.25rem 1.25rem;
white-space: pre;
}
.tech-doc-content img {
width: 100%;
max-width: 100%;
height: auto;
object-fit: contain;
margin: 24px 0;
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 18px;
background: rgba(255, 255, 255, 0.04);
box-shadow: 0 18px 52px rgba(34, 211, 238, 0.12);
}
.tech-doc-content blockquote {
border-left: 3px solid #22d3ee;
border-radius: 14px;
background: rgba(34, 211, 238, 0.08);
color: rgba(255, 255, 255, 0.78);
padding: 0.8rem 1rem;
}
.tech-doc-content hr {
height: 1px;
margin: 32px 0;
border: 0;
background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.45), transparent);
}
.neon-aurora {
position: absolute;
inset: -18% -10% auto -10%;
z-index: -3;
height: 72%;
pointer-events: none;
background:
radial-gradient(circle at 12% 24%, rgba(34, 211, 238, 0.44), transparent 28%),
radial-gradient(circle at 48% 8%, rgba(99, 102, 241, 0.36), transparent 30%),
radial-gradient(circle at 86% 32%, rgba(217, 70, 239, 0.42), transparent 28%),
radial-gradient(circle at 74% 72%, rgba(132, 204, 22, 0.18), transparent 24%);
filter: blur(12px) saturate(1.18);
transform: translateZ(0);
}
.cyber-grid {
position: absolute;
inset: 0;
z-index: -2;
pointer-events: none;
background-image:
linear-gradient(rgba(34, 211, 238, 0.08) 1px, transparent 1px),
linear-gradient(90deg, rgba(217, 70, 239, 0.08) 1px, transparent 1px);
background-size: 64px 64px;
mask-image: linear-gradient(to bottom, black 0%, black 56%, transparent 100%);
}
.scanline {
position: absolute;
inset: 0;
z-index: -1;
pointer-events: none;
opacity: 0.2;
background-image:
radial-gradient(circle at 18% 30%, rgba(244, 239, 228, 0.18) 0 1px, transparent 1px),
radial-gradient(circle at 72% 64%, rgba(211, 255, 48, 0.14) 0 1px, transparent 1px);
background-size: 34px 34px, 46px 46px;
opacity: 0.18;
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
background-size: 100% 7px;
mix-blend-mode: screen;
}
@keyframes doc-rise {
from {
opacity: 0;
transform: translateY(18px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
+12
View File
@@ -0,0 +1,12 @@
import { PlaceholderPage } from "@/components/placeholder-page";
export default function LifePage() {
return (
<PlaceholderPage
eyebrow="Life journal"
title="生活分享"
description="技术之外的个人切面:日常、阅读、音乐、照片、旅行,以及阶段性的想法。"
items={["日常记录", "阅读和音乐", "照片和旅行", "一些想法"]}
/>
);
}
+110
View File
@@ -0,0 +1,110 @@
import { notFound } from "next/navigation";
import { FrontendNotesPage } from "@/components/frontend-notes-page";
import { frontendArticles } from "@/content/notes/frontend/articles";
const modules = ["frontend", "backend", "ai-agent"] as const;
type PageProps = {
params: Promise<{
module: string;
}>;
};
export function generateStaticParams() {
return modules.map((module) => ({ module }));
}
export default async function NotesModulePage({ params }: PageProps) {
const { module } = await params;
if (!modules.includes(module as (typeof modules)[number])) {
notFound();
}
if (module === "frontend") {
const articles = frontendArticles.map((article) => ({
slug: article.slug,
title: article.title,
description: article.description,
href: `/notes/frontend/${article.slug}`,
}));
return (
<FrontendNotesPage
eyebrow="Frontend knowledge base"
title="前端笔记"
description="fly 的前端知识索引,覆盖基础语言、框架机制、浏览器、网络、性能与代码执行题。"
listDescription="每个入口都是一组可独立阅读的知识点,适合快速定位概念、机制与常见问题。"
articles={articles}
/>
);
}
if (module === "backend") {
return (
<FrontendNotesPage
eyebrow="Backend knowledge base"
title="后端笔记"
description="后端方向会整理服务端基础、接口设计、数据库、部署、鉴权、缓存和稳定性相关内容。"
featuredTitle="敬请期待"
listTitle="规划内容"
listDescription="这些模块会在后续逐步补齐,先保留入口和内容结构。"
articles={[
{
slug: "backend-api",
title: "API 设计",
description: "接口规范、请求响应结构、错误码、鉴权边界和版本管理等内容整理。",
status: "soon",
},
{
slug: "backend-database",
title: "数据库",
description: "数据建模、索引、事务、查询优化和常见业务存储方案。",
status: "soon",
},
{
slug: "backend-deployment",
title: "部署与服务稳定性",
description: "服务部署、日志、监控、缓存、限流和故障排查相关实践。",
status: "soon",
},
]}
/>
);
}
if (module === "ai-agent") {
return (
<FrontendNotesPage
eyebrow="AI Agent knowledge base"
title="AI Agent 笔记"
description="AI Agent 方向会记录工作流、工具调用、上下文工程、提示词和自动化场景实践。"
featuredTitle="敬请期待"
listTitle="规划内容"
listDescription="这些方向会随着实践逐步沉淀成可回看的技术文章。"
articles={[
{
slug: "agent-workflow",
title: "Agent 工作流",
description: "任务拆解、执行循环、状态管理和人机协作流程。",
status: "soon",
},
{
slug: "agent-tools",
title: "工具调用",
description: "函数调用、MCP、浏览器自动化、文件操作和外部系统集成。",
status: "soon",
},
{
slug: "agent-prompting",
title: "提示词与上下文工程",
description: "角色约束、上下文压缩、记忆策略和输出质量控制。",
status: "soon",
},
]}
/>
);
}
notFound();
}
+35
View File
@@ -0,0 +1,35 @@
import { notFound } from "next/navigation";
import { TechDocPage } from "@/components/tech-doc-page";
import { frontendArticles, getFrontendArticle } from "@/content/notes/frontend/articles";
import { getTechArticle } from "@/lib/tech-article";
type PageProps = {
params: Promise<{
slug: string;
}>;
};
export function generateStaticParams() {
return frontendArticles.map((article) => ({ slug: article.slug }));
}
export default async function FrontendArticlePage({ params }: PageProps) {
const { slug } = await params;
const articleMeta = getFrontendArticle(slug);
if (!articleMeta) {
notFound();
}
const article = getTechArticle(`frontend/${articleMeta.file}`);
return (
<TechDocPage
eyebrow="Frontend notes"
title={articleMeta.title}
description={articleMeta.description}
contentHtml={article.contentHtml}
toc={articleMeta.slug === "code-output" ? [] : article.toc}
/>
);
}