重构文档中心与视差效果

- 删除旧版 docs.html API 文档,改为手写 6 个独立 HTML 页面
  (index/why-python/architecture/quickstart/plugins/development)
- 新增 css/docs.css 文档页样式(左侧导航树 + 右侧内容区)
- 添加左下角固定 "获取更多信息" 按钮跳转 Gitee Wiki
- dock.js 增加 getPathPrefix() 自动计算相对路径,修复子页面导航跳转
- 首页 3D 立方体:替换 logo 为纯白交互正方体,悬停弹出对话框展示项目特点
- parallax.js 自动检测文档页和首页,统一景深速度为 1.0 (100px 最大移动)
- 删除 logo.svg、旧版构建脚本及 API 版文档文件
This commit is contained in:
Falck
2026-04-06 16:09:00 +08:00
parent 0e5c28e0b3
commit a615b2af0f
13 changed files with 1271 additions and 85 deletions

288
website/css/docs.css Normal file
View File

@@ -0,0 +1,288 @@
/* ===== 文档页面 ===== */
.page-docs {
position: fixed;
inset: 0;
display: flex;
flex-direction: column;
background: var(--bg);
overflow: hidden;
}
/* 顶部栏 */
.docs-header {
height: 56px;
flex-shrink: 0;
display: flex;
align-items: center;
gap: 16px;
padding: 0 24px;
background: rgba(3, 7, 18, 0.95);
border-bottom: 1px solid var(--border);
backdrop-filter: blur(12px);
z-index: 100;
}
.docs-header-title {
display: flex;
align-items: center;
gap: 8px;
font-size: 16px;
font-weight: 700;
color: #fff;
}
.docs-header-title svg {
color: var(--cyan);
}
.docs-header-breadcrumb {
flex: 1;
font-size: 14px;
color: var(--text-muted);
}
.docs-header-actions {
display: flex;
align-items: center;
gap: 12px;
}
.docs-wiki-link {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 14px;
border: 1px solid var(--border);
border-radius: 8px;
background: transparent;
color: var(--text-secondary);
font-size: 13px;
text-decoration: none;
transition: all 0.2s;
}
.docs-wiki-link:hover {
border-color: var(--border-hover);
color: var(--cyan-light);
background: rgba(6, 182, 212, 0.05);
}
/* 布局 */
.docs-layout {
flex: 1;
display: flex;
overflow: hidden;
}
/* 左侧导航 */
.docs-sidebar {
width: 260px;
flex-shrink: 0;
background: rgba(2, 5, 16, 0.6);
border-right: 1px solid var(--border);
overflow-y: auto;
padding: 20px 0;
}
.docs-nav-section {
margin-bottom: 24px;
}
.docs-nav-section-title {
padding: 8px 24px;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
color: var(--text-muted);
letter-spacing: 1px;
}
.docs-nav-item {
display: block;
padding: 8px 24px 8px 32px;
color: var(--text-secondary);
text-decoration: none;
font-size: 14px;
border-left: 3px solid transparent;
transition: all 0.15s;
}
.docs-nav-item:hover {
background: rgba(255, 255, 255, 0.03);
color: #fff;
}
.docs-nav-item.active {
border-left-color: var(--cyan);
color: var(--cyan-light);
background: rgba(6, 182, 212, 0.05);
}
.docs-nav-item .nav-path {
display: block;
font-size: 11px;
color: var(--text-muted);
margin-top: 2px;
font-family: 'JetBrains Mono', monospace;
}
/* 左下角固定按钮 */
.docs-wiki-btn {
position: fixed;
bottom: 24px;
left: 24px;
display: flex;
align-items: center;
gap: 8px;
padding: 12px 20px;
background: linear-gradient(135deg, var(--cyan), var(--blue));
border: none;
border-radius: 12px;
color: #fff;
font-size: 14px;
font-weight: 600;
text-decoration: none;
z-index: 200;
box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
transition: all 0.2s;
}
.docs-wiki-btn:hover {
transform: translateY(-2px);
box-shadow: 0 8px 30px rgba(6, 182, 212, 0.4);
}
.docs-wiki-btn svg {
width: 16px;
height: 16px;
}
/* 右侧内容区 */
.docs-content-wrapper {
flex: 1;
overflow-y: auto;
}
.docs-content {
max-width: 860px;
margin: 0 auto;
padding: 40px 48px 100px;
}
.docs-content h1 {
font-size: 32px;
font-weight: 800;
color: #fff;
margin-bottom: 8px;
margin-top: 0;
}
.docs-content h2 {
font-size: 22px;
font-weight: 700;
color: #fff;
margin-top: 32px;
margin-bottom: 12px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border);
}
.docs-content h3 {
font-size: 18px;
font-weight: 600;
color: var(--cyan-light);
margin-top: 24px;
margin-bottom: 8px;
}
.docs-content p {
font-size: 15px;
color: var(--text-secondary);
line-height: 1.8;
margin-bottom: 12px;
}
.docs-content strong { color: #fff; }
.docs-content code {
font-family: 'JetBrains Mono', monospace;
font-size: 13px;
background: rgba(6, 182, 212, 0.1);
padding: 2px 8px;
border-radius: 4px;
color: var(--cyan-light);
}
.docs-content pre {
margin: 16px 0;
padding: 16px 20px;
background: rgba(10, 15, 30, 0.8);
border: 1px solid var(--border);
border-radius: 10px;
overflow-x: auto;
}
.docs-content pre code {
background: transparent;
padding: 0;
color: #e5e7eb;
font-size: 13px;
line-height: 1.7;
}
.docs-content blockquote {
margin: 16px 0;
padding: 12px 20px;
border-left: 4px solid var(--cyan);
background: rgba(6, 182, 212, 0.05);
border-radius: 0 8px 8px 0;
}
.docs-content blockquote p { margin-bottom: 0; }
.docs-content ul, .docs-content ol {
margin: 12px 0;
padding-left: 24px;
color: var(--text-secondary);
}
.docs-content li {
margin-bottom: 6px;
font-size: 15px;
line-height: 1.6;
}
.docs-content hr {
border: none;
height: 1px;
background: var(--border);
margin: 24px 0;
}
.docs-content table {
width: 100%;
border-collapse: collapse;
margin: 16px 0;
font-size: 14px;
}
.docs-content th {
padding: 10px 16px;
text-align: left;
background: rgba(6, 182, 212, 0.05);
border-bottom: 2px solid rgba(6, 182, 212, 0.2);
color: #fff;
font-weight: 600;
}
.docs-content td {
padding: 10px 16px;
border-bottom: 1px solid var(--border);
color: var(--text-secondary);
}
@media (max-width: 768px) {
.docs-sidebar { display: none; }
.docs-content { padding: 24px 20px 100px; }
.docs-wiki-btn span { display: none; }
}

View File

@@ -193,24 +193,100 @@
}
}
.hero-logo {
/* ===== 3D 交互立方体 ===== */
.cube-scene {
position: relative;
width: 200px;
height: 200px;
perspective: 800px;
z-index: 1;
width: 140px;
height: 140px;
filter: drop-shadow(0 0 30px rgba(6, 182, 212, 0.4));
animation: logo-breathe 4s ease-in-out infinite;
}
@keyframes logo-breathe {
0%, 100% {
transform: scale(1);
filter: drop-shadow(0 0 30px rgba(6, 182, 212, 0.4));
}
50% {
transform: scale(1.05);
filter: drop-shadow(0 0 50px rgba(6, 182, 212, 0.6));
}
.cube {
width: 100%;
height: 100%;
position: relative;
transform-style: preserve-3d;
cursor: pointer;
}
.cube-face {
position: absolute;
width: 200px;
height: 200px;
background: #ffffff;
border: 2px solid rgba(6, 182, 212, 0.6);
box-shadow:
inset 0 0 30px rgba(0, 0, 0, 0.03),
0 0 15px rgba(6, 182, 212, 0.3),
0 0 30px rgba(6, 182, 212, 0.15);
user-select: none;
}
/* 立方体六个面 */
.cube-face-front { transform: rotateY(0deg) translateZ(100px); }
.cube-face-back { transform: rotateY(180deg) translateZ(100px); }
.cube-face-right { transform: rotateY(90deg) translateZ(100px); }
.cube-face-left { transform: rotateY(-90deg) translateZ(100px); }
.cube-face-top { transform: rotateX(90deg) translateZ(100px); }
.cube-face-bottom { transform: rotateX(-90deg) translateZ(100px); }
/* 特性对话框 */
.cube-tooltip {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%) scale(0.8);
background: rgba(3, 7, 18, 0.95);
border: 1px solid rgba(6, 182, 212, 0.4);
border-radius: 12px;
padding: 16px 24px;
min-width: 220px;
max-width: 280px;
text-align: center;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease, transform 0.3s ease;
z-index: 10;
backdrop-filter: blur(10px);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(6, 182, 212, 0.15);
}
.cube-tooltip.is-visible {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
.cube-tooltip-icon {
font-size: 28px;
margin-bottom: 8px;
}
.cube-tooltip-title {
font-size: 15px;
font-weight: 700;
color: #fff;
margin-bottom: 4px;
}
.cube-tooltip-desc {
font-size: 12px;
color: var(--text-muted);
line-height: 1.5;
}
/* 小三角箭头 */
.cube-tooltip::after {
content: '';
position: absolute;
bottom: -8px;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-top: 8px solid rgba(6, 182, 212, 0.4);
}
/* 滚动指示器 */
@@ -277,10 +353,21 @@
width: 280px;
height: 280px;
}
.hero-logo {
width: 120px;
height: 120px;
.cube-scene {
width: 160px;
height: 160px;
margin: 0 auto;
}
.cube-face {
width: 160px;
height: 160px;
}
.cube-face-front { transform: rotateY(0deg) translateZ(80px); }
.cube-face-back { transform: rotateY(180deg) translateZ(80px); }
.cube-face-right { transform: rotateY(90deg) translateZ(80px); }
.cube-face-left { transform: rotateY(-90deg) translateZ(80px); }
.cube-face-top { transform: rotateX(90deg) translateZ(80px); }
.cube-face-bottom { transform: rotateX(-90deg) translateZ(80px); }
}
@media (max-width: 640px) {
@@ -289,8 +376,19 @@
width: 240px;
height: 240px;
}
.hero-logo {
width: 100px;
height: 100px;
.cube-scene {
width: 140px;
height: 140px;
margin: 0 auto;
}
.cube-face {
width: 140px;
height: 140px;
}
.cube-face-front { transform: rotateY(0deg) translateZ(70px); }
.cube-face-back { transform: rotateY(180deg) translateZ(70px); }
.cube-face-right { transform: rotateY(90deg) translateZ(70px); }
.cube-face-left { transform: rotateY(-90deg) translateZ(70px); }
.cube-face-top { transform: rotateX(90deg) translateZ(70px); }
.cube-face-bottom { transform: rotateX(-90deg) translateZ(70px); }
}