Feature/docs improvement (#254)

* refactor: 编辑器/运行时架构拆分与构建系统升级

* feat(core): 层级系统重构与UI变换矩阵修复

* refactor: 移除 ecs-components 聚合包并修复跨包组件查找问题

* fix(physics): 修复跨包组件类引用问题

* feat: 统一运行时架构与浏览器运行支持

* feat(asset): 实现浏览器运行时资产加载系统

* fix: 修复文档、CodeQL安全问题和CI类型检查错误

* fix: 修复文档、CodeQL安全问题和CI类型检查错误

* fix: 修复文档、CodeQL安全问题、CI类型检查和测试错误

* test: 补齐核心模块测试用例,修复CI构建配置

* fix: 修复测试用例中的类型错误和断言问题

* fix: 修复 turbo build:npm 任务的依赖顺序问题

* fix: 修复 CI 构建错误并优化构建性能

* feat(docs): 重构文档站主题样式

* chore(ci): 升级所有 workflow 的 pnpm 版本从 v8 到 v10
This commit is contained in:
YHH
2025-12-01 23:33:04 +08:00
committed by GitHub
parent 290bd9858e
commit 460cdb5af4
16 changed files with 11255 additions and 8094 deletions

View File

@@ -0,0 +1,93 @@
<script setup>
defineProps({
title: String,
description: String,
icon: String,
link: String,
image: String
})
</script>
<template>
<a :href="link" class="feature-card">
<div class="card-image" v-if="image">
<img :src="image" :alt="title" />
</div>
<div class="card-body">
<div class="card-icon" v-if="icon && !image">{{ icon }}</div>
<h3 class="card-title">{{ title }}</h3>
<p class="card-description">{{ description }}</p>
</div>
</a>
</template>
<style scoped>
.feature-card {
display: flex;
flex-direction: column;
background: var(--es-bg-elevated, #252526);
border: 1px solid var(--es-border-default, #3e3e42);
border-radius: 4px;
overflow: hidden;
text-decoration: none;
transition: all 0.15s ease;
}
.feature-card:hover {
border-color: var(--es-primary, #007acc);
background: var(--es-bg-overlay, #2d2d2d);
}
.card-image {
width: 100%;
height: 160px;
overflow: hidden;
background: linear-gradient(135deg, #1e3a5f 0%, #1e1e1e 100%);
}
.card-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
}
.feature-card:hover .card-image img {
transform: scale(1.05);
}
.card-body {
padding: 16px;
flex: 1;
display: flex;
flex-direction: column;
}
.card-icon {
font-size: 1.5rem;
margin-bottom: 12px;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
background: var(--es-bg-input, #3c3c3c);
border-radius: 4px;
}
.card-title {
font-size: 14px;
font-weight: 600;
color: var(--es-text-inverse, #ffffff);
margin: 0 0 8px 0;
line-height: 1.3;
}
.card-description {
font-size: 12px;
color: var(--es-text-secondary, #9d9d9d);
margin: 0;
line-height: 1.6;
flex: 1;
}
</style>

View File

@@ -0,0 +1,422 @@
<script setup>
import { onMounted, onUnmounted, ref } from 'vue'
const canvasRef = ref(null)
let animationId = null
let particles = []
let animationStartTime = null
let glowStartTime = null
// ESEngine 粒子颜色 - VS Code 风格配色(与编辑器统一)
const colors = ['#569CD6', '#4EC9B0', '#9CDCFE', '#C586C0', '#DCDCAA']
class Particle {
constructor(x, y, targetX, targetY) {
this.x = x
this.y = y
this.targetX = targetX
this.targetY = targetY
this.size = Math.random() * 2 + 1.5
this.alpha = Math.random() * 0.5 + 0.5
this.color = colors[Math.floor(Math.random() * colors.length)]
}
}
function createParticles(canvas, text, fontSize) {
const tempCanvas = document.createElement('canvas')
const tempCtx = tempCanvas.getContext('2d')
if (!tempCtx) return []
tempCtx.font = `bold ${fontSize}px "Segoe UI", Arial, sans-serif`
const textMetrics = tempCtx.measureText(text)
const textWidth = textMetrics.width
const textHeight = fontSize
tempCanvas.width = textWidth + 40
tempCanvas.height = textHeight + 40
tempCtx.font = `bold ${fontSize}px "Segoe UI", Arial, sans-serif`
tempCtx.textAlign = 'center'
tempCtx.textBaseline = 'middle'
tempCtx.fillStyle = '#ffffff'
tempCtx.fillText(text, tempCanvas.width / 2, tempCanvas.height / 2)
const imageData = tempCtx.getImageData(0, 0, tempCanvas.width, tempCanvas.height)
const pixels = imageData.data
const newParticles = []
const gap = 3
const width = canvas.width / (window.devicePixelRatio || 1)
const height = canvas.height / (window.devicePixelRatio || 1)
const offsetX = (width - tempCanvas.width) / 2
const offsetY = (height - tempCanvas.height) / 2
for (let y = 0; y < tempCanvas.height; y += gap) {
for (let x = 0; x < tempCanvas.width; x += gap) {
const index = (y * tempCanvas.width + x) * 4
const alpha = pixels[index + 3] || 0
if (alpha > 128) {
const angle = Math.random() * Math.PI * 2
const distance = Math.random() * Math.max(width, height)
newParticles.push(new Particle(
width / 2 + Math.cos(angle) * distance,
height / 2 + Math.sin(angle) * distance,
offsetX + x,
offsetY + y
))
}
}
}
return newParticles
}
function easeOutQuart(t) {
return 1 - Math.pow(1 - t, 4)
}
function easeOutCubic(t) {
return 1 - Math.pow(1 - t, 3)
}
function animate(canvas, ctx) {
const dpr = window.devicePixelRatio || 1
const width = canvas.width / dpr
const height = canvas.height / dpr
const currentTime = performance.now()
const duration = 2500
const glowDuration = 600
const elapsed = currentTime - animationStartTime
const progress = Math.min(elapsed / duration, 1)
const easedProgress = easeOutQuart(progress)
// 透明背景
ctx.clearRect(0, 0, width, height)
// 计算发光进度
let glowProgress = 0
if (progress >= 1) {
if (glowStartTime === null) {
glowStartTime = currentTime
}
glowProgress = Math.min((currentTime - glowStartTime) / glowDuration, 1)
glowProgress = easeOutCubic(glowProgress)
}
const text = 'ESEngine'
const fontSize = Math.min(width / 4, height / 3, 80)
const textY = height / 2
for (const particle of particles) {
const moveProgress = Math.min(easedProgress * 1.2, 1)
const currentX = particle.x + (particle.targetX - particle.x) * moveProgress
const currentY = particle.y + (particle.targetY - particle.y) * moveProgress
ctx.beginPath()
ctx.arc(currentX, currentY, particle.size, 0, Math.PI * 2)
ctx.fillStyle = particle.color
ctx.globalAlpha = particle.alpha * (1 - glowProgress * 0.3)
ctx.fill()
}
ctx.globalAlpha = 1
if (glowProgress > 0) {
ctx.save()
ctx.shadowColor = '#3b9eff'
ctx.shadowBlur = 30 * glowProgress
ctx.fillStyle = `rgba(255, 255, 255, ${glowProgress})`
ctx.font = `bold ${fontSize}px "Segoe UI", Arial, sans-serif`
ctx.textAlign = 'center'
ctx.textBaseline = 'middle'
ctx.fillText(text, width / 2, textY)
ctx.restore()
}
if (glowProgress >= 1) {
const breathe = 0.8 + Math.sin(currentTime / 1000) * 0.2
ctx.save()
ctx.shadowColor = '#3b9eff'
ctx.shadowBlur = 20 * breathe
ctx.fillStyle = '#ffffff'
ctx.font = `bold ${fontSize}px "Segoe UI", Arial, sans-serif`
ctx.textAlign = 'center'
ctx.textBaseline = 'middle'
ctx.fillText(text, width / 2, textY)
ctx.restore()
}
animationId = requestAnimationFrame(() => animate(canvas, ctx))
}
function initCanvas() {
const canvas = canvasRef.value
if (!canvas) return
const ctx = canvas.getContext('2d')
if (!ctx) return
const dpr = window.devicePixelRatio || 1
const container = canvas.parentElement
const width = container.offsetWidth
const height = container.offsetHeight
canvas.width = width * dpr
canvas.height = height * dpr
canvas.style.width = `${width}px`
canvas.style.height = `${height}px`
ctx.scale(dpr, dpr)
const text = 'ESEngine'
const fontSize = Math.min(width / 4, height / 3, 80)
particles = createParticles(canvas, text, fontSize)
animationStartTime = performance.now()
glowStartTime = null
if (animationId) {
cancelAnimationFrame(animationId)
}
animate(canvas, ctx)
}
onMounted(() => {
initCanvas()
window.addEventListener('resize', initCanvas)
})
onUnmounted(() => {
if (animationId) {
cancelAnimationFrame(animationId)
}
window.removeEventListener('resize', initCanvas)
})
</script>
<template>
<section class="hero-section">
<div class="hero-container">
<!-- 左侧文字区域 -->
<div class="hero-text">
<div class="hero-logo">
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="16" cy="16" r="14" stroke="#9147ff" stroke-width="2"/>
<path d="M10 10h8v2h-6v3h5v2h-5v3h6v2h-8v-12z" fill="#9147ff"/>
</svg>
<span>ESENGINE</span>
</div>
<h1 class="hero-title">
我们构建框架<br/>
而你将创造游戏
</h1>
<p class="hero-description">
ESEngine 是一个高性能的 TypeScript ECS 框架为游戏开发者提供现代化的实体组件系统
无论是 2D 还是 3D 游戏都能帮助你快速构建可扩展的游戏架构
</p>
<div class="hero-actions">
<a href="/guide/getting-started" class="btn-primary">开始使用</a>
<a href="https://github.com/esengine/ecs-framework" class="btn-secondary" target="_blank">了解更多</a>
</div>
</div>
<!-- 右侧粒子动画区域 -->
<div class="hero-visual">
<div class="visual-container">
<canvas ref="canvasRef" class="particle-canvas"></canvas>
<div class="visual-label">
<span class="label-title">Entity Component System</span>
<span class="label-subtitle">High Performance Framework</span>
</div>
</div>
</div>
</div>
</section>
</template>
<style scoped>
.hero-section {
background: #0d0d0d;
padding: 80px 0;
min-height: calc(100vh - 64px);
display: flex;
align-items: center;
}
.hero-container {
max-width: 1400px;
margin: 0 auto;
padding: 0 48px;
display: grid;
grid-template-columns: 1fr 1.2fr;
gap: 64px;
align-items: center;
}
/* 左侧文字 */
.hero-text {
display: flex;
flex-direction: column;
gap: 24px;
}
.hero-logo {
display: flex;
align-items: center;
gap: 12px;
color: #ffffff;
font-size: 1rem;
font-weight: 700;
letter-spacing: 0.1em;
}
.hero-title {
font-size: 3rem;
font-weight: 700;
color: #ffffff;
line-height: 1.2;
margin: 0;
}
.hero-description {
font-size: 1.125rem;
color: #707070;
line-height: 1.7;
margin: 0;
max-width: 480px;
}
.hero-actions {
display: flex;
gap: 16px;
margin-top: 8px;
}
.btn-primary,
.btn-secondary {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 14px 28px;
border-radius: 4px;
font-weight: 600;
font-size: 0.9375rem;
text-decoration: none;
transition: all 0.2s ease;
}
.btn-primary {
background: #3b9eff;
color: #ffffff;
border: 1px solid #3b9eff;
border-radius: 6px;
}
.btn-primary:hover {
background: #5aadff;
border-color: #5aadff;
}
.btn-secondary {
background: #1a1a1a;
color: #a0a0a0;
border: 1px solid #2a2a2a;
border-radius: 6px;
}
.btn-secondary:hover {
background: #252525;
color: #ffffff;
}
.hero-visual {
display: flex;
justify-content: center;
}
.visual-container {
position: relative;
width: 100%;
max-width: 600px;
aspect-ratio: 4 / 3;
background: linear-gradient(135deg, #1a2a3a 0%, #1a1a1a 50%, #0d0d0d 100%);
border-radius: 12px;
border: 1px solid #2a2a2a;
overflow: hidden;
box-shadow: 0 20px 60px rgba(59, 158, 255, 0.1);
}
.particle-canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.visual-label {
position: absolute;
bottom: 24px;
left: 24px;
display: flex;
flex-direction: column;
gap: 4px;
}
.label-title {
font-size: 1.125rem;
font-weight: 600;
color: #ffffff;
}
.label-subtitle {
font-size: 0.875rem;
color: #737373;
}
/* 响应式 */
@media (max-width: 1024px) {
.hero-container {
grid-template-columns: 1fr;
gap: 48px;
padding: 0 24px;
}
.hero-section {
padding: 48px 0;
min-height: auto;
}
.hero-title {
font-size: 2.25rem;
}
.hero-description {
font-size: 1rem;
}
.visual-container {
max-width: 100%;
aspect-ratio: 16 / 9;
}
}
@media (max-width: 640px) {
.hero-title {
font-size: 1.75rem;
}
.hero-actions {
flex-direction: column;
}
.btn-primary,
.btn-secondary {
width: 100%;
justify-content: center;
}
}
</style>

View File

@@ -0,0 +1,631 @@
/* ============================================
ESEngine 文档站主题样式
============================================ */
:root {
color-scheme: dark;
--vp-nav-height: 64px;
}
body {
background: #0d0d0d !important;
}
.VPContent.has-sidebar {
background: linear-gradient(180deg, #1e3a5f 0%, #152540 30vh, #0d1a2a 50vh, #0d0d0d 70vh) !important;
background-repeat: no-repeat !important;
}
html,
html.dark {
--vp-c-bg: #0d0d0d;
--vp-c-bg-soft: #1a1a1a;
--vp-c-bg-mute: #1f1f1f;
--vp-c-bg-alt: #1a1a1a;
--vp-c-text-1: #e0e0e0;
--vp-c-text-2: #a0a0a0;
--vp-c-text-3: #707070;
--vp-c-divider: #2a2a2a;
--vp-c-divider-light: #222222;
}
html:not(.dark) {
--vp-c-bg: #0d0d0d !important;
--vp-c-bg-soft: #1a1a1a !important;
--vp-c-bg-mute: #1f1f1f !important;
--vp-c-bg-alt: #1a1a1a !important;
--vp-c-text-1: #e0e0e0 !important;
--vp-c-text-2: #a0a0a0 !important;
--vp-c-text-3: #707070 !important;
}
:root {
--es-bg-base: #0d0d0d;
--es-bg-sidebar: #1a1a1a;
--es-bg-card: #1f1f1f;
--es-bg-hover: #252525;
--es-bg-selected: #0e4a7c;
--es-text-primary: #e0e0e0;
--es-text-secondary: #a0a0a0;
--es-text-tertiary: #707070;
--es-text-inverse: #ffffff;
--es-border-default: #2a2a2a;
--es-border-subtle: #222222;
--es-primary: #3b9eff;
--es-warning: #c9a227;
--es-info: #3b9eff;
}
/* ============================================
导航栏
============================================ */
.VPNav {
background: #0d0d0d !important;
border-bottom: 1px solid #2a2a2a !important;
}
.VPNav .VPNavBar {
background: #0d0d0d !important;
}
.VPNav .VPNavBar .wrapper {
background: #0d0d0d !important;
}
.VPNav .VPNavBar::before,
.VPNav .VPNavBar::after {
display: none !important;
}
.VPNavBar {
background: #0d0d0d !important;
}
.VPNavBar::before {
display: none !important;
}
.VPNavBarTitle .title {
color: #ffffff;
font-weight: 600;
font-size: 15px;
}
.VPNavBarMenuLink {
color: #a0a0a0 !important;
font-size: 14px !important;
font-weight: 400 !important;
}
.VPNavBarMenuLink:hover {
color: #ffffff !important;
}
.VPNavBarMenuLink.active {
color: #ffffff !important;
}
.VPNavBarSearch .DocSearch-Button {
background: #1a1a1a !important;
border: 1px solid #2a2a2a !important;
border-radius: 6px;
}
/* ============================================
侧边栏
============================================ */
.VPSidebar {
background: transparent !important;
border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
padding: 16px 0 !important;
width: 280px !important;
}
.VPSidebar .nav {
padding: 0 16px;
}
.VPSidebarItem.level-0 > .item {
padding: 12px 0 6px 0;
}
.VPSidebarItem.level-0 > .item > .text {
font-weight: 400;
font-size: 13px;
color: #808080;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.VPSidebarItem .link {
padding: 6px 12px;
margin: 1px 0;
border-radius: 4px;
color: #9d9d9d;
font-size: 14px;
transition: all 0.15s;
position: relative;
border-left: 2px solid transparent;
}
.VPSidebarItem .link:hover {
background: rgba(255, 255, 255, 0.05);
color: #ffffff;
}
.VPSidebarItem.is-active > .item > .link {
background: transparent;
color: #ffffff;
border-left: 2px solid #3b9eff;
}
.VPSidebarItem.level-1 .link {
padding-left: 24px;
font-size: 13px;
}
.VPSidebarItem.level-2 .link {
padding-left: 36px;
font-size: 13px;
}
.VPSidebarItem .caret {
color: #606060;
}
.VPSidebarItem .caret:hover {
color: #9d9d9d;
}
/* ============================================
内容区域
============================================ */
.VPContent {
background: transparent !important;
}
.VPDoc {
background: transparent !important;
}
.VPDoc .container {
max-width: 100% !important;
}
.VPDoc .content {
max-width: 860px !important;
padding: 80px 60px 48px !important;
}
.VPNavBar {
background: #0d0d0d !important;
}
.VPNavBar .content {
background: #0d0d0d !important;
}
.VPNavBar .content-body {
background: #0d0d0d !important;
}
.VPNavBar .divider {
display: none;
}
.VPLocalNav {
background: #0d0d0d !important;
border-bottom: 1px solid #2a2a2a !important;
}
.VPNavScreenMenu {
background: #0d0d0d !important;
}
.VPNavScreen {
background: #0d0d0d !important;
}
.curtain {
display: none !important;
}
.VPNav .curtain,
.VPNavBar .curtain {
display: none !important;
}
[class*="curtain"] {
display: none !important;
}
.VPNav > div::before,
.VPNav > div::after {
display: none !important;
}
.vp-doc {
color: #e0e0e0;
}
.vp-doc h1 {
font-size: 32px;
font-weight: 700;
color: #ffffff;
border-bottom: none;
padding-bottom: 0;
margin-bottom: 32px;
line-height: 1.2;
}
.vp-doc h2 {
font-size: 24px;
font-weight: 600;
color: #ffffff;
border-bottom: none;
padding-bottom: 0;
margin-top: 48px;
margin-bottom: 20px;
}
.vp-doc h3 {
font-size: 18px;
font-weight: 600;
color: #ffffff;
margin-top: 32px;
margin-bottom: 16px;
}
.vp-doc p {
color: #a0a0a0;
line-height: 1.8;
font-size: 15px;
margin: 20px 0;
}
.vp-doc ul,
.vp-doc ol {
padding-left: 24px;
margin: 20px 0;
}
.vp-doc li {
line-height: 1.8;
margin: 8px 0;
color: #a0a0a0;
font-size: 15px;
}
.vp-doc li::marker {
color: #707070;
}
.vp-doc strong {
color: #ffffff;
font-weight: 600;
}
.vp-doc a {
color: #3b9eff;
text-decoration: none;
}
.vp-doc a:hover {
text-decoration: underline;
}
/* ============================================
右侧大纲
============================================ */
.VPDocAside {
padding-left: 32px;
border-left: 1px solid #2a2a2a;
}
.VPDocAsideOutline {
padding: 0;
border: none !important;
}
.VPDocAsideOutline .content {
border: none !important;
padding-left: 0 !important;
}
.VPDocAsideOutline .outline-title {
font-size: 14px;
font-weight: 600;
text-transform: none;
letter-spacing: 0;
color: #ffffff;
padding-bottom: 16px;
}
.VPDocAsideOutline .outline-link {
color: #707070;
font-size: 13px;
padding: 6px 0;
line-height: 1.5;
display: block;
}
.VPDocAsideOutline .outline-link:hover {
color: #a0a0a0;
}
.VPDocAsideOutline .outline-link.active {
color: #3b9eff;
}
.VPDocAsideOutline .outline-marker {
display: none;
}
/* ============================================
代码块
============================================ */
div[class*='language-'] {
background: #1a1a1a !important;
border: 1px solid #2a2a2a;
border-radius: 8px;
margin: 20px 0;
}
.vp-code-group .tabs {
background: #1f1f1f;
border-bottom: 1px solid #2a2a2a;
}
.vp-doc :not(pre) > code {
background: #1f1f1f;
color: #3b9eff;
padding: 3px 8px;
border-radius: 4px;
font-size: 0.9em;
}
/* ============================================
表格
============================================ */
.vp-doc table {
display: table;
width: 100%;
background: transparent;
border: none;
border-collapse: collapse;
margin: 24px 0;
}
.vp-doc tr {
border-bottom: 1px solid #2a2a2a;
background: transparent;
}
.vp-doc tr:last-child {
border-bottom: none;
}
.vp-doc th {
background: #1f1f1f;
font-weight: 600;
font-size: 14px;
color: #a0a0a0;
text-align: left;
padding: 14px 20px;
border-bottom: 1px solid #2a2a2a;
}
.vp-doc td {
font-size: 15px;
color: #e0e0e0;
padding: 14px 20px;
vertical-align: top;
line-height: 1.6;
}
.vp-doc td:first-child {
font-weight: 500;
color: #a0a0a0;
min-width: 120px;
}
/* ============================================
提示框
============================================ */
.vp-doc .warning,
.vp-doc .custom-block.warning {
background: rgba(201, 162, 39, 0.08);
border: none;
border-left: 4px solid #c9a227;
border-radius: 0 8px 8px 0;
padding: 16px 24px;
margin: 24px 0;
}
.vp-doc .warning .custom-block-title,
.vp-doc .custom-block.warning .custom-block-title {
color: #c9a227;
font-weight: 600;
font-size: 15px;
margin-bottom: 8px;
}
.vp-doc .warning p {
color: #a0a0a0;
margin: 0;
}
.vp-doc .tip,
.vp-doc .custom-block.tip {
background: rgba(59, 158, 255, 0.08);
border: none;
border-left: 4px solid #3b9eff;
border-radius: 0 8px 8px 0;
padding: 16px 24px;
margin: 24px 0;
}
.vp-doc .tip .custom-block-title,
.vp-doc .custom-block.tip .custom-block-title {
color: #3b9eff;
font-weight: 600;
font-size: 15px;
margin-bottom: 8px;
}
.vp-doc .tip p {
color: #a0a0a0;
margin: 0;
}
.vp-doc .info,
.vp-doc .custom-block.info {
background: rgba(78, 201, 176, 0.08);
border: none;
border-left: 4px solid #4ec9b0;
border-radius: 0 8px 8px 0;
padding: 16px 24px;
margin: 24px 0;
}
.vp-doc .info .custom-block-title,
.vp-doc .custom-block.info .custom-block-title {
color: #4ec9b0;
font-weight: 600;
font-size: 15px;
margin-bottom: 8px;
}
.vp-doc .danger,
.vp-doc .custom-block.danger {
background: rgba(244, 135, 113, 0.08);
border: none;
border-left: 4px solid #f48771;
border-radius: 0 8px 8px 0;
padding: 16px 24px;
margin: 24px 0;
}
.vp-doc .danger .custom-block-title,
.vp-doc .custom-block.danger .custom-block-title {
color: #f48771;
font-weight: 600;
font-size: 15px;
margin-bottom: 8px;
}
/* ============================================
卡片样式
============================================ */
.vp-doc .card {
background: #1f1f1f;
border-radius: 12px;
padding: 24px;
margin: 24px 0;
}
.vp-doc .card-title {
font-size: 18px;
font-weight: 600;
color: #ffffff;
margin-bottom: 8px;
}
.vp-doc .card-description {
font-size: 14px;
color: #707070;
line-height: 1.6;
}
/* ============================================
标签样式
============================================ */
.vp-doc .tag {
display: inline-block;
padding: 4px 12px;
background: transparent;
border: 1px solid #3a3a3a;
border-radius: 16px;
color: #a0a0a0;
font-size: 13px;
margin-right: 8px;
margin-bottom: 8px;
}
/* ============================================
链接行样式
============================================ */
.vp-doc .link-row {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 0;
color: #a0a0a0;
font-size: 15px;
}
.vp-doc .link-row a {
color: #3b9eff;
}
/* ============================================
页脚
============================================ */
.VPFooter {
background: #1a1a1a !important;
border-top: 1px solid #2a2a2a !important;
}
/* ============================================
滚动条
============================================ */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: #3a3a3a;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #4a4a4a;
}
::-webkit-scrollbar-corner {
background: transparent;
}
/* ============================================
首页专用样式
============================================ */
.home-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 24px;
}
.home-section {
padding: 48px 0;
}
/* ============================================
响应式
============================================ */
@media (max-width: 960px) {
.VPDoc .content {
padding: 24px !important;
}
.VPSidebar {
width: 100% !important;
}
}

View File

@@ -0,0 +1,12 @@
import DefaultTheme from 'vitepress/theme'
import ParticleHero from './components/ParticleHero.vue'
import FeatureCard from './components/FeatureCard.vue'
import './custom.css'
export default {
extends: DefaultTheme,
enhanceApp({ app }) {
app.component('ParticleHero', ParticleHero)
app.component('FeatureCard', FeatureCard)
}
}