重构文档中心与视差效果
- 删除旧版 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:
288
website/css/docs.css
Normal file
288
website/css/docs.css
Normal 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; }
|
||||
}
|
||||
@@ -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); }
|
||||
}
|
||||
|
||||
105
website/docs/architecture.html
Normal file
105
website/docs/architecture.html
Normal file
@@ -0,0 +1,105 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>架构设计 - Future OSS 文档</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="../css/main.css" />
|
||||
<link rel="stylesheet" href="../css/dock.css" />
|
||||
<link rel="stylesheet" href="../css/docs.css" />
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="particles"></canvas>
|
||||
<div id="dock-container"></div>
|
||||
|
||||
<main class="page-docs">
|
||||
<header class="docs-header">
|
||||
<div class="docs-header-title">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" width="22" height="22">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>文档中心</span>
|
||||
</div>
|
||||
<div class="docs-header-breadcrumb">入门 · 架构设计</div>
|
||||
<div class="docs-header-actions">
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-link">完整 Wiki</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="docs-layout">
|
||||
<aside class="docs-sidebar">
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">入门</div>
|
||||
<a href="index.html" class="docs-nav-item">什么是 FutureOSS<span class="nav-path">/ 项目介绍</span></a>
|
||||
<a href="why-python.html" class="docs-nav-item">为什么选择 Python<span class="nav-path">/ 技术选型</span></a>
|
||||
<a href="architecture.html" class="docs-nav-item active">架构设计<span class="nav-path">/ 三层架构</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">快速开始</div>
|
||||
<a href="quickstart.html" class="docs-nav-item">三步运行<span class="nav-path">/ 安装部署</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">插件</div>
|
||||
<a href="plugins.html" class="docs-nav-item">官方插件列表<span class="nav-path">/ 12+ 插件</span></a>
|
||||
<a href="development.html" class="docs-nav-item">插件开发指南<span class="nav-path">/ 开发基础</span></a>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="docs-content-wrapper">
|
||||
<article class="docs-content">
|
||||
<h1>🏗️ 架构设计</h1>
|
||||
|
||||
<h2>三层架构</h2>
|
||||
<p><strong>核心层 (oss/)</strong> — 插件管理、事件总线、消息总线、配置系统、日志系统。框架的核心基础设施。</p>
|
||||
<p><strong>插件层 (store/)</strong> — 协议插件(HTTP/WS/TCP)、工具插件(依赖解析、存储、桥接)、中间件插件(熔断、热重载、生命周期)。</p>
|
||||
<p><strong>应用层 (data/)</strong> — 第三方插件(HTML 渲染、Web 工具包)+ 运行时数据(配置文件、共享存储)。</p>
|
||||
|
||||
<h2>启动流程</h2>
|
||||
<ol>
|
||||
<li>加载 <code>config.yaml</code> → Config 对象</li>
|
||||
<li>初始化 Logger</li>
|
||||
<li>创建 PluginManager,只加载 <code>plugin-loader</code></li>
|
||||
<li><code>plugin-loader</code> 扫描 <code>store/</code> 目录,加载所有插件</li>
|
||||
<li>使用 <code>dependency</code> 插件进行拓扑排序</li>
|
||||
<li>按拓扑顺序 init() → start() 所有插件</li>
|
||||
<li>HTTP 服务器启动,注册路由</li>
|
||||
<li>信号监听 → Ctrl+C 时优雅关闭(逆序 stop)</li>
|
||||
</ol>
|
||||
|
||||
<h2>目录结构</h2>
|
||||
<pre><code>FutureOSS/
|
||||
├── oss/ # 核心框架
|
||||
│ ├── cli.py # CLI 入口
|
||||
│ ├── config/ # 配置加载
|
||||
│ ├── logger/ # 日志系统
|
||||
│ ├── plugin/ # 插件核心
|
||||
│ │ ├── types.py # 类型定义
|
||||
│ │ ├── loader.py # 动态加载器
|
||||
│ │ ├── manager.py # 插件管理器
|
||||
│ │ └── event_bus.py # 事件总线
|
||||
│ └── server/ # HTTP 服务器
|
||||
├── store/ # 本地插件仓库
|
||||
│ └── @{FutureOSS}/ # 官方插件
|
||||
└── data/ # 运行时数据</code></pre>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-btn">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>获取更多信息</span>
|
||||
</a>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>
|
||||
<script src="../js/dock.js"></script>
|
||||
<script src="../js/particles.js"></script>
|
||||
<script src="../js/parallax.js"></script>
|
||||
<script src="../js/animations.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
124
website/docs/development.html
Normal file
124
website/docs/development.html
Normal file
@@ -0,0 +1,124 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>插件开发指南 - Future OSS 文档</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="../css/main.css" />
|
||||
<link rel="stylesheet" href="../css/dock.css" />
|
||||
<link rel="stylesheet" href="../css/docs.css" />
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="particles"></canvas>
|
||||
<div id="dock-container"></div>
|
||||
|
||||
<main class="page-docs">
|
||||
<header class="docs-header">
|
||||
<div class="docs-header-title">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" width="22" height="22">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>文档中心</span>
|
||||
</div>
|
||||
<div class="docs-header-breadcrumb">插件 · 开发指南</div>
|
||||
<div class="docs-header-actions">
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-link">完整 Wiki</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="docs-layout">
|
||||
<aside class="docs-sidebar">
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">入门</div>
|
||||
<a href="index.html" class="docs-nav-item">什么是 FutureOSS<span class="nav-path">/ 项目介绍</span></a>
|
||||
<a href="why-python.html" class="docs-nav-item">为什么选择 Python<span class="nav-path">/ 技术选型</span></a>
|
||||
<a href="architecture.html" class="docs-nav-item">架构设计<span class="nav-path">/ 三层架构</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">快速开始</div>
|
||||
<a href="quickstart.html" class="docs-nav-item">三步运行<span class="nav-path">/ 安装部署</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">插件</div>
|
||||
<a href="plugins.html" class="docs-nav-item">官方插件列表<span class="nav-path">/ 12+ 插件</span></a>
|
||||
<a href="development.html" class="docs-nav-item active">插件开发指南<span class="nav-path">/ 开发基础</span></a>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="docs-content-wrapper">
|
||||
<article class="docs-content">
|
||||
<h1>🛠️ 插件开发指南</h1>
|
||||
|
||||
<h2>插件结构</h2>
|
||||
<pre><code>store/@{作者}/插件名/
|
||||
├── main.py # 插件入口(必须实现 Plugin 接口)
|
||||
└── manifest.json # 插件元数据(名称、版本、依赖)</code></pre>
|
||||
|
||||
<h2>插件接口</h2>
|
||||
<pre><code>from oss.plugin.types import Plugin
|
||||
|
||||
class MyPlugin(Plugin):
|
||||
def init(self, deps: dict = None):
|
||||
# 初始化逻辑
|
||||
pass
|
||||
|
||||
def start(self):
|
||||
# 启动逻辑
|
||||
pass
|
||||
|
||||
def stop(self):
|
||||
# 停止逻辑
|
||||
pass
|
||||
|
||||
@property
|
||||
def manifest(self):
|
||||
return {
|
||||
"name": "my-plugin",
|
||||
"version": "1.0.0",
|
||||
"dependencies": [],
|
||||
"description": "我的插件"
|
||||
}</code></pre>
|
||||
|
||||
<h2>关键原则</h2>
|
||||
<ul>
|
||||
<li>插件通过 <code>from oss.plugin.types import Plugin</code> 使用框架定义的接口</li>
|
||||
<li>插件的 <code>main.py</code> 被 <code>importlib</code> 加载到框架的 Python 进程中</li>
|
||||
<li>插件可以直接 <code>from oss.xxx import xxx</code> 引用框架模块</li>
|
||||
<li>所有插件通过 <code>config.json</code> 配置,不修改源码</li>
|
||||
</ul>
|
||||
|
||||
<h2>依赖声明</h2>
|
||||
<pre><code>// manifest.json
|
||||
{
|
||||
"name": "html-render",
|
||||
"version": "1.0.0",
|
||||
"dependencies": ["http-api", "plugin-storage"],
|
||||
"description": "HTML 渲染插件"
|
||||
}</code></pre>
|
||||
|
||||
<p>框架会自动调用 <code>set_http_api()</code> 和 <code>set_plugin_storage()</code> 注入依赖实例。</p>
|
||||
|
||||
<h2>安装格式</h2>
|
||||
<p>格式为 <code>@{作者名称}/插件名称</code>,例如 <code>@{Falck}/html-render</code>。</p>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-btn">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>获取更多信息</span>
|
||||
</a>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>
|
||||
<script src="../js/dock.js"></script>
|
||||
<script src="../js/particles.js"></script>
|
||||
<script src="../js/parallax.js"></script>
|
||||
<script src="../js/animations.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
108
website/docs/index.html
Normal file
108
website/docs/index.html
Normal file
@@ -0,0 +1,108 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>什么是 FutureOSS - Future OSS 文档</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="../css/main.css" />
|
||||
<link rel="stylesheet" href="../css/dock.css" />
|
||||
<link rel="stylesheet" href="../css/docs.css" />
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="particles"></canvas>
|
||||
<div id="dock-container"></div>
|
||||
|
||||
<main class="page-docs">
|
||||
<header class="docs-header">
|
||||
<div class="docs-header-title">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" width="22" height="22">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>文档中心</span>
|
||||
</div>
|
||||
<div class="docs-header-breadcrumb">入门 · 项目介绍</div>
|
||||
<div class="docs-header-actions">
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-link">完整 Wiki</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="docs-layout">
|
||||
<aside class="docs-sidebar">
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">入门</div>
|
||||
<a href="index.html" class="docs-nav-item active">什么是 FutureOSS<span class="nav-path">/ 项目介绍</span></a>
|
||||
<a href="why-python.html" class="docs-nav-item">为什么选择 Python<span class="nav-path">/ 技术选型</span></a>
|
||||
<a href="architecture.html" class="docs-nav-item">架构设计<span class="nav-path">/ 三层架构</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">快速开始</div>
|
||||
<a href="quickstart.html" class="docs-nav-item">三步运行<span class="nav-path">/ 安装部署</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">插件</div>
|
||||
<a href="plugins.html" class="docs-nav-item">官方插件列表<span class="nav-path">/ 12+ 插件</span></a>
|
||||
<a href="development.html" class="docs-nav-item">插件开发指南<span class="nav-path">/ 开发基础</span></a>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="docs-content-wrapper">
|
||||
<article class="docs-content">
|
||||
<h1>🧩 什么是 FutureOSS?</h1>
|
||||
|
||||
<blockquote><p>FutureOSS 是一个一切皆为插件的开发者工具运行时框架。框架本身是空壳,所有功能均以插件形式加载。</p></blockquote>
|
||||
|
||||
<h2>项目定位</h2>
|
||||
<p>协议、中间件、通知渠道……所有功能均以插件形式加载。内置熔断降级、依赖自动解析、事件驱动等企业级稳定性机制。</p>
|
||||
|
||||
<h2>核心特性</h2>
|
||||
<ul>
|
||||
<li><strong>一切皆插件</strong> — 框架本身不提供任何业务功能,所有能力通过插件扩展</li>
|
||||
<li><strong>热插拔</strong> — 插件运行时加载与卸载,改完即生效,零编译</li>
|
||||
<li><strong>依赖自动解析</strong> — 拓扑排序 (Kahn 算法) + 循环依赖检测</li>
|
||||
<li><strong>熔断与降级</strong> — 自动熔断,支持 closed/open/half-open 状态切换</li>
|
||||
<li><strong>包管理系统</strong> — 一键安装/卸载/更新插件,支持 <code>@{作者}/插件名</code> 格式</li>
|
||||
<li><strong>事件驱动</strong> — 发布/订阅 + 通配符匹配 + RPC 桥接</li>
|
||||
<li><strong>统一存储</strong> — plugin-storage 为每个插件提供隔离的文件读写入口</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2>关键原则</h2>
|
||||
|
||||
<h3>类型共享</h3>
|
||||
<p>框架在 <code>oss/plugin/types.py</code> 中定义所有数据类型和接口,插件通过 <code>from oss.plugin.types import Plugin</code> 直接使用。插件不应重复定义 Logger、EventBus 等类型。</p>
|
||||
|
||||
<h3>配置驱动</h3>
|
||||
<p>所有插件通过 <code>config.json</code> 配置,不修改源码。配置文件使用相对路径,相对于 config.json 所在目录。</p>
|
||||
|
||||
<h3>插件安装格式</h3>
|
||||
<p>格式为 <code>@{作者名称}/插件名称</code>,命令:<code>oss pkg install @{Falck}/http-server</code></p>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-btn">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>获取更多信息</span>
|
||||
</a>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@11.9.0/styles/github-dark.min.css" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/highlight.js@11.9.0/highlight.min.js"></script>
|
||||
<script src="../js/dock.js"></script>
|
||||
<script src="../js/particles.js"></script>
|
||||
<script src="../js/parallax.js"></script>
|
||||
<script src="../js/animations.js"></script>
|
||||
<script>
|
||||
document.querySelectorAll('pre code').forEach(function(block) {
|
||||
if (typeof hljs !== 'undefined') hljs.highlightElement(block);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
90
website/docs/plugins.html
Normal file
90
website/docs/plugins.html
Normal file
@@ -0,0 +1,90 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>官方插件列表 - Future OSS 文档</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="../css/main.css" />
|
||||
<link rel="stylesheet" href="../css/dock.css" />
|
||||
<link rel="stylesheet" href="../css/docs.css" />
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="particles"></canvas>
|
||||
<div id="dock-container"></div>
|
||||
|
||||
<main class="page-docs">
|
||||
<header class="docs-header">
|
||||
<div class="docs-header-title">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" width="22" height="22">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>文档中心</span>
|
||||
</div>
|
||||
<div class="docs-header-breadcrumb">插件 · 官方插件列表</div>
|
||||
<div class="docs-header-actions">
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-link">完整 Wiki</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="docs-layout">
|
||||
<aside class="docs-sidebar">
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">入门</div>
|
||||
<a href="index.html" class="docs-nav-item">什么是 FutureOSS<span class="nav-path">/ 项目介绍</span></a>
|
||||
<a href="why-python.html" class="docs-nav-item">为什么选择 Python<span class="nav-path">/ 技术选型</span></a>
|
||||
<a href="architecture.html" class="docs-nav-item">架构设计<span class="nav-path">/ 三层架构</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">快速开始</div>
|
||||
<a href="quickstart.html" class="docs-nav-item">三步运行<span class="nav-path">/ 安装部署</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">插件</div>
|
||||
<a href="plugins.html" class="docs-nav-item active">官方插件列表<span class="nav-path">/ 12+ 插件</span></a>
|
||||
<a href="development.html" class="docs-nav-item">插件开发指南<span class="nav-path">/ 开发基础</span></a>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="docs-content-wrapper">
|
||||
<article class="docs-content">
|
||||
<h1>📦 官方插件列表</h1>
|
||||
|
||||
<table>
|
||||
<thead><tr><th>插件名</th><th>说明</th><th>依赖</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>plugin-loader</code></td><td>核心插件,扫描/加载/管理所有插件</td><td>无</td></tr>
|
||||
<tr><td><code>dependency</code></td><td>拓扑排序 (Kahn 算法) + 循环依赖检测</td><td>无</td></tr>
|
||||
<tr><td><code>http-api</code></td><td>HTTP 服务器 (8080) + 路由 + 中间件 + CORS</td><td>无</td></tr>
|
||||
<tr><td><code>http-tcp</code></td><td>HTTP TCP 服务器 (8082)</td><td>无</td></tr>
|
||||
<tr><td><code>ws-api</code></td><td>WebSocket 服务器 (8081) + 事件总线</td><td>无</td></tr>
|
||||
<tr><td><code>plugin-storage</code></td><td>统一文件读写 + JSON 键值存储 + 目录隔离</td><td>无</td></tr>
|
||||
<tr><td><code>plugin-bridge</code></td><td>事件总线 + 广播 + RPC + 桥接</td><td>plugin-storage</td></tr>
|
||||
<tr><td><code>circuit-breaker</code></td><td>熔断器 (closed/open/half-open)</td><td>无</td></tr>
|
||||
<tr><td><code>hot-reload</code></td><td>文件监听 + 热加载/卸载/更新插件</td><td>无</td></tr>
|
||||
<tr><td><code>lifecycle</code></td><td>生命周期状态机 (pending/running/stopped)</td><td>无</td></tr>
|
||||
<tr><td><code>json-codec</code></td><td>JSON 序列化/反序列化 + Schema 验证</td><td>无</td></tr>
|
||||
<tr><td><code>pkg</code></td><td>包管理 (搜索/安装/卸载/更新)</td><td>无</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-btn">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>获取更多信息</span>
|
||||
</a>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>
|
||||
<script src="../js/dock.js"></script>
|
||||
<script src="../js/particles.js"></script>
|
||||
<script src="../js/parallax.js"></script>
|
||||
<script src="../js/animations.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
106
website/docs/quickstart.html
Normal file
106
website/docs/quickstart.html
Normal file
@@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>快速开始 - Future OSS 文档</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="../css/main.css" />
|
||||
<link rel="stylesheet" href="../css/dock.css" />
|
||||
<link rel="stylesheet" href="../css/docs.css" />
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="particles"></canvas>
|
||||
<div id="dock-container"></div>
|
||||
|
||||
<main class="page-docs">
|
||||
<header class="docs-header">
|
||||
<div class="docs-header-title">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" width="22" height="22">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>文档中心</span>
|
||||
</div>
|
||||
<div class="docs-header-breadcrumb">快速开始 · 三步运行</div>
|
||||
<div class="docs-header-actions">
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-link">完整 Wiki</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="docs-layout">
|
||||
<aside class="docs-sidebar">
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">入门</div>
|
||||
<a href="index.html" class="docs-nav-item">什么是 FutureOSS<span class="nav-path">/ 项目介绍</span></a>
|
||||
<a href="why-python.html" class="docs-nav-item">为什么选择 Python<span class="nav-path">/ 技术选型</span></a>
|
||||
<a href="architecture.html" class="docs-nav-item">架构设计<span class="nav-path">/ 三层架构</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">快速开始</div>
|
||||
<a href="quickstart.html" class="docs-nav-item active">三步运行<span class="nav-path">/ 安装部署</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">插件</div>
|
||||
<a href="plugins.html" class="docs-nav-item">官方插件列表<span class="nav-path">/ 12+ 插件</span></a>
|
||||
<a href="development.html" class="docs-nav-item">插件开发指南<span class="nav-path">/ 开发基础</span></a>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="docs-content-wrapper">
|
||||
<article class="docs-content">
|
||||
<h1>🚀 三步运行</h1>
|
||||
|
||||
<h2>步骤 1:克隆代码</h2>
|
||||
<pre><code>git clone https://gitee.com/starlight-apk/feature-oss.git
|
||||
cd feature-oss</code></pre>
|
||||
|
||||
<h2>步骤 2:安装依赖</h2>
|
||||
<pre><code>pip install -r requirements.txt
|
||||
pip install -e .</code></pre>
|
||||
|
||||
<h2>步骤 3:启动服务</h2>
|
||||
<pre><code>bash start.sh
|
||||
# 或 Windows: start.bat</code></pre>
|
||||
|
||||
<p>启动后访问 <code>http://localhost:8080/</code> 即可看到网站。</p>
|
||||
|
||||
<h2>系统要求</h2>
|
||||
<ul>
|
||||
<li>Python 3.8+</li>
|
||||
<li>Linux / macOS / Windows</li>
|
||||
<li>核心依赖:click、pyyaml、websockets</li>
|
||||
</ul>
|
||||
|
||||
<h2>常用命令</h2>
|
||||
<table>
|
||||
<thead><tr><th>命令</th><th>说明</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><code>oss serve</code></td><td>启动框架服务</td></tr>
|
||||
<tr><td><code>oss init</code></td><td>初始化项目配置</td></tr>
|
||||
<tr><td><code>oss version</code></td><td>查看版本号</td></tr>
|
||||
<tr><td><code>oss status</code></td><td>查看插件运行状态</td></tr>
|
||||
<tr><td><code>oss pkg install @{作者}/插件名</code></td><td>安装远程插件</td></tr>
|
||||
<tr><td><code>oss pkg list</code></td><td>列出已安装插件</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-btn">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>获取更多信息</span>
|
||||
</a>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>
|
||||
<script src="../js/dock.js"></script>
|
||||
<script src="../js/particles.js"></script>
|
||||
<script src="../js/parallax.js"></script>
|
||||
<script src="../js/animations.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
98
website/docs/why-python.html
Normal file
98
website/docs/why-python.html
Normal file
@@ -0,0 +1,98 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>为什么选择 Python - Future OSS 文档</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="../css/main.css" />
|
||||
<link rel="stylesheet" href="../css/dock.css" />
|
||||
<link rel="stylesheet" href="../css/docs.css" />
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="particles"></canvas>
|
||||
<div id="dock-container"></div>
|
||||
|
||||
<main class="page-docs">
|
||||
<header class="docs-header">
|
||||
<div class="docs-header-title">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" width="22" height="22">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>文档中心</span>
|
||||
</div>
|
||||
<div class="docs-header-breadcrumb">入门 · 为什么用Python</div>
|
||||
<div class="docs-header-actions">
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-link">完整 Wiki</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="docs-layout">
|
||||
<aside class="docs-sidebar">
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">入门</div>
|
||||
<a href="index.html" class="docs-nav-item">什么是 FutureOSS<span class="nav-path">/ 项目介绍</span></a>
|
||||
<a href="why-python.html" class="docs-nav-item active">为什么选择 Python<span class="nav-path">/ 技术选型</span></a>
|
||||
<a href="architecture.html" class="docs-nav-item">架构设计<span class="nav-path">/ 三层架构</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">快速开始</div>
|
||||
<a href="quickstart.html" class="docs-nav-item">三步运行<span class="nav-path">/ 安装部署</span></a>
|
||||
</div>
|
||||
<div class="docs-nav-section">
|
||||
<div class="docs-nav-section-title">插件</div>
|
||||
<a href="plugins.html" class="docs-nav-item">官方插件列表<span class="nav-path">/ 12+ 插件</span></a>
|
||||
<a href="development.html" class="docs-nav-item">插件开发指南<span class="nav-path">/ 开发基础</span></a>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="docs-content-wrapper">
|
||||
<article class="docs-content">
|
||||
<h1>🐍 为什么从 Go 重构为 Python?</h1>
|
||||
|
||||
<p>Go 的 <code>plugin</code> 包不适合热插拔场景。<code>.so</code> 文件与主程序是独立编译单元,类型不共享,依赖注入后接口不匹配会导致 <code>panic</code>。Python 的动态特性天然适合插件化架构。</p>
|
||||
|
||||
<h2>技术对比</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>问题</th><th>Go 方案</th><th>Python 方案</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>插件热插拔</td><td><code>plugin.Open(".so")</code></td><td><code>importlib</code> 动态加载 <code>.py</code></td></tr>
|
||||
<tr><td>依赖注入</td><td>反射注入,类型不匹配 → panic</td><td>直接传 dict/对象,无编译隔离</td></tr>
|
||||
<tr><td>开发效率</td><td>每次改插件需重新编译</td><td>改完即生效,零编译</td></tr>
|
||||
<tr><td>配置类型</td><td><code>map[string]string</code> 限制</td><td><code>dict[str, Any]</code> 原生支持任意类型</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2>Go 插件系统的致命问题</h2>
|
||||
<p>Go 的插件机制依赖 <code>plugin.Open()</code> 加载编译好的 <code>.so</code> 文件。每个 <code>.so</code> 是独立的编译单元,无法共享类型定义。这意味着插件中定义的接口与框架中的接口即使签名相同,也被视为不同类型,导致依赖注入后接口为 <code>nil</code>,运行时直接 <code>panic</code>。</p>
|
||||
|
||||
<h2>Python 的优势</h2>
|
||||
<ul>
|
||||
<li><strong>动态类型</strong> — 没有编译时类型检查,插件直接使用框架定义的类型</li>
|
||||
<li><strong>importlib</strong> — 运行时动态加载 <code>.py</code> 文件,零编译开销</li>
|
||||
<li><strong>类型共享</strong> — 插件通过 <code>from oss.plugin.types import Plugin</code> 直接引用框架类型</li>
|
||||
<li><strong>开发迭代快</strong> — 改完代码即生效,无需重新编译</li>
|
||||
</ul>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-btn">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
||||
</svg>
|
||||
<span>获取更多信息</span>
|
||||
</a>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>
|
||||
<script src="../js/dock.js"></script>
|
||||
<script src="../js/particles.js"></script>
|
||||
<script src="../js/parallax.js"></script>
|
||||
<script src="../js/animations.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -24,9 +24,9 @@
|
||||
<div id="dock-container"></div>
|
||||
|
||||
<!-- 首页 Hero -->
|
||||
<main class="page-hero" data-parallax-speed="0.3">
|
||||
<main class="page-hero" data-parallax-speed="0.05">
|
||||
<div class="hero-container">
|
||||
<div class="hero-content" data-parallax-speed="0.8">
|
||||
<div class="hero-content" data-parallax-speed="0.12">
|
||||
<div class="badge">
|
||||
<span class="badge-dot"></span>
|
||||
<span>2026 · 插件驱动 · 一切皆可扩展</span>
|
||||
@@ -59,7 +59,21 @@
|
||||
<div class="ripple ripple-3"></div>
|
||||
<div class="ripple ripple-4"></div>
|
||||
<div class="ripple ripple-5"></div>
|
||||
<img src="logo.svg" alt="Future OSS Logo" class="hero-logo" />
|
||||
<div class="cube-scene">
|
||||
<div class="cube is-spinning" id="feature-cube">
|
||||
<div class="cube-face cube-face-front" data-face="front"></div>
|
||||
<div class="cube-face cube-face-back" data-face="back"></div>
|
||||
<div class="cube-face cube-face-right" data-face="right"></div>
|
||||
<div class="cube-face cube-face-left" data-face="left"></div>
|
||||
<div class="cube-face cube-face-top" data-face="top"></div>
|
||||
<div class="cube-face cube-face-bottom" data-face="bottom"></div>
|
||||
</div>
|
||||
<div class="cube-tooltip" id="cube-tooltip">
|
||||
<div class="cube-tooltip-icon"></div>
|
||||
<div class="cube-tooltip-title"></div>
|
||||
<div class="cube-tooltip-desc"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -71,5 +85,6 @@
|
||||
<script src="js/particles.js"></script>
|
||||
<script src="js/parallax.js"></script>
|
||||
<script src="js/animations.js"></script>
|
||||
<script src="js/cube.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
180
website/js/cube.js
Normal file
180
website/js/cube.js
Normal file
@@ -0,0 +1,180 @@
|
||||
/**
|
||||
* 3D 交互立方体(requestAnimationFrame 驱动)
|
||||
* - 纯白正方体 + 青绿色发光边框,自动旋转
|
||||
* - 鼠标悬停某面时平滑过渡到该面正对用户,弹出对话框
|
||||
* - 鼠标离开 2 秒后平滑恢复旋转
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
const cube = document.getElementById('feature-cube');
|
||||
const tooltip = document.getElementById('cube-tooltip');
|
||||
if (!cube || !tooltip) return;
|
||||
|
||||
const tooltipIcon = tooltip.querySelector('.cube-tooltip-icon');
|
||||
const tooltipTitle = tooltip.querySelector('.cube-tooltip-title');
|
||||
const tooltipDesc = tooltip.querySelector('.cube-tooltip-desc');
|
||||
const faces = cube.querySelectorAll('.cube-face');
|
||||
|
||||
// 旋转状态
|
||||
let angleX = -20;
|
||||
let angleY = 0;
|
||||
let isSpinning = true;
|
||||
let resumeTimer = null;
|
||||
let currentFace = null;
|
||||
|
||||
// 目标角度(悬停时设置)
|
||||
let targetX = null;
|
||||
let targetY = null;
|
||||
|
||||
const SPEED_Y = 0.5; // Y 轴每帧旋转速度
|
||||
const SPEED_X = 0.15; // X 轴微动速度
|
||||
const LERP = 0.05; // 平滑插值系数
|
||||
|
||||
// 六个面的特性数据
|
||||
const faceData = {
|
||||
front: { icon: '🧩', title: '一切皆为插件', desc: '协议、中间件、通知渠道,所有功能均以插件形式加载' },
|
||||
back: { icon: '🔄', title: '热插拔', desc: '插件运行时加载与卸载,改完即生效,零编译' },
|
||||
right: { icon: '🔗', title: '依赖自动解析', desc: '拓扑排序 + 循环依赖检测,自动处理加载顺序' },
|
||||
left: { icon: '🛡️', title: '熔断降级', desc: '内置熔断器,支持 closed/open/half-open 状态切换' },
|
||||
top: { icon: '📡', title: '事件驱动', desc: '发布/订阅 + 通配符匹配 + RPC 桥接' },
|
||||
bottom: { icon: '📦', title: '统一存储', desc: 'plugin-storage 提供隔离的文件读写入口' }
|
||||
};
|
||||
|
||||
/**
|
||||
* 角度差(处理 360° 环绕,返回最短方向)
|
||||
*/
|
||||
function angleDiff(from, to) {
|
||||
let diff = ((to - from) % 360 + 540) % 360 - 180;
|
||||
return diff;
|
||||
}
|
||||
|
||||
/**
|
||||
* 动画循环
|
||||
*/
|
||||
function animate() {
|
||||
if (targetX !== null && targetY !== null) {
|
||||
// 平滑过渡到目标角度
|
||||
const diffX = angleDiff(angleX, targetX);
|
||||
const diffY = angleDiff(angleY, targetY);
|
||||
|
||||
if (Math.abs(diffX) < 0.2 && Math.abs(diffY) < 0.2) {
|
||||
angleX = targetX;
|
||||
angleY = targetY;
|
||||
// 到达目标后停止插值,保持静止
|
||||
targetX = null;
|
||||
targetY = null;
|
||||
} else {
|
||||
angleX += diffX * LERP;
|
||||
angleY += diffY * LERP;
|
||||
}
|
||||
} else if (isSpinning) {
|
||||
// 自动旋转:Y 轴匀速 + X 轴微动
|
||||
angleY += SPEED_Y;
|
||||
angleX = -20 + Math.sin(Date.now() * 0.001) * 8;
|
||||
}
|
||||
|
||||
cube.style.transform = `rotateX(${angleX}deg) rotateY(${angleY}deg)`;
|
||||
requestAnimationFrame(animate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算某个面的目标角度(Y 轴自动选最近的对齐角度,避免跳帧)
|
||||
*/
|
||||
function calcFaceTarget(baseX, baseY) {
|
||||
// Y 轴:找到距离当前 angleY 最近的对齐角度(baseY + n*360)
|
||||
const n = Math.round((angleY - baseY) / 360);
|
||||
const snappedY = baseY + n * 360;
|
||||
return { x: baseX, y: snappedY };
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停旋转,显示对话框
|
||||
*/
|
||||
function pauseAndShow(faceName) {
|
||||
if (currentFace === faceName) return;
|
||||
currentFace = faceName;
|
||||
|
||||
// 清除恢复定时器
|
||||
if (resumeTimer) {
|
||||
clearTimeout(resumeTimer);
|
||||
resumeTimer = null;
|
||||
}
|
||||
|
||||
// 计算目标角度(Y 轴自动对齐最近角度,避免跳帧)
|
||||
const faceBaseTargets = {
|
||||
front: { x: -20, y: 0 },
|
||||
back: { x: -20, y: 180 },
|
||||
right: { x: -20, y: -90 },
|
||||
left: { x: -20, y: 90 },
|
||||
top: { x: -90, y: 0 },
|
||||
bottom: { x: 90, y: 0 }
|
||||
};
|
||||
|
||||
const base = faceBaseTargets[faceName];
|
||||
if (base) {
|
||||
const snapped = calcFaceTarget(base.x, base.y);
|
||||
targetX = snapped.x;
|
||||
targetY = snapped.y;
|
||||
}
|
||||
|
||||
isSpinning = false;
|
||||
|
||||
// 填充并显示对话框
|
||||
const data = faceData[faceName];
|
||||
if (!data) return;
|
||||
|
||||
tooltipIcon.textContent = data.icon;
|
||||
tooltipTitle.textContent = data.title;
|
||||
tooltipDesc.textContent = data.desc;
|
||||
void tooltip.offsetWidth;
|
||||
tooltip.classList.add('is-visible');
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏对话框
|
||||
*/
|
||||
function hideTooltip() {
|
||||
currentFace = null;
|
||||
tooltip.classList.remove('is-visible');
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复旋转
|
||||
*/
|
||||
function resumeSpin() {
|
||||
hideTooltip();
|
||||
targetX = null;
|
||||
targetY = null;
|
||||
isSpinning = true;
|
||||
}
|
||||
|
||||
// 为每个面绑定 mouseenter
|
||||
faces.forEach(function (face) {
|
||||
face.addEventListener('mouseenter', function () {
|
||||
const faceName = face.getAttribute('data-face');
|
||||
pauseAndShow(faceName);
|
||||
});
|
||||
|
||||
face.addEventListener('touchstart', function () {
|
||||
const faceName = face.getAttribute('data-face');
|
||||
pauseAndShow(faceName);
|
||||
}, { passive: true });
|
||||
});
|
||||
|
||||
// 整个场景 mouseleave → 2 秒后恢复(用 scene 而非 cube,避免子元素事件干扰)
|
||||
const scene = cube.parentElement;
|
||||
if (scene) {
|
||||
scene.addEventListener('mouseleave', function () {
|
||||
hideTooltip();
|
||||
if (resumeTimer) clearTimeout(resumeTimer);
|
||||
resumeTimer = setTimeout(function () {
|
||||
resumeSpin();
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
// 启动动画
|
||||
animate();
|
||||
|
||||
})();
|
||||
@@ -6,16 +6,30 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
// 获取当前页面相对于网站根目录的深度
|
||||
// 返回 '../' 或 '../../' 等,根目录页面返回 ''
|
||||
function getPathPrefix() {
|
||||
const path = window.location.pathname;
|
||||
// 去掉文件名,得到目录部分
|
||||
const dir = path.substring(0, path.lastIndexOf('/') + 1);
|
||||
// 计算目录层级数(排除开头的 /)
|
||||
const segments = dir.split('/').filter(s => s.length > 0);
|
||||
// 每个层级需要一个 '../'
|
||||
return segments.map(() => '../').join('');
|
||||
}
|
||||
|
||||
// Dock HTML 模板
|
||||
// current: 当前页面文件名,用于设置 active 状态
|
||||
function renderDock(current) {
|
||||
const prefix = getPathPrefix();
|
||||
const items = [
|
||||
{ href: 'index.html', tooltip: '首页', svg: 'M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6' },
|
||||
{ href: 'features.html', tooltip: '特性', svg: 'M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z' },
|
||||
{ href: 'plugins.html', tooltip: '插件', svg: 'M11 4a2 2 0 114 0v1a1 1 0 001 1h3a1 1 0 011 1v3a1 1 0 01-1 1h-1a2 2 0 100 4h1a1 1 0 011 1v3a1 1 0 01-1 1h-3a1 1 0 01-1-1v-1a2 2 0 10-4 0v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-3a1 1 0 00-1-1H4a2 2 0 110-4h1a1 1 0 001-1V7a1 1 0 011-1h3a1 1 0 001-1V4z' },
|
||||
{ href: 'architecture.html', tooltip: '架构', svg: 'M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z' },
|
||||
{ href: prefix + 'index.html', tooltip: '首页', svg: 'M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6' },
|
||||
{ href: prefix + 'features.html', tooltip: '特性', svg: 'M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z' },
|
||||
{ href: prefix + 'docs/index.html', tooltip: '文档', svg: 'M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253' },
|
||||
{ href: prefix + 'plugins.html', tooltip: '插件', svg: 'M11 4a2 2 0 114 0v1a1 1 0 001 1h3a1 1 0 011 1v3a1 1 0 01-1 1h-1a2 2 0 100 4h1a1 1 0 011 1v3a1 1 0 01-1 1h-3a1 1 0 01-1-1v-1a2 2 0 10-4 0v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-3a1 1 0 00-1-1H4a2 2 0 110-4h1a1 1 0 001-1V7a1 1 0 011-1h3a1 1 0 001-1V4z' },
|
||||
{ href: prefix + 'architecture.html', tooltip: '架构', svg: 'M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z' },
|
||||
{ separator: true },
|
||||
{ href: 'quickstart.html', tooltip: '快速开始', svg: 'M13 10V3L4 14h7v7l9-11h-7z' },
|
||||
{ href: prefix + 'quickstart.html', tooltip: '快速开始', svg: 'M13 10V3L4 14h7v7l9-11h-7z' },
|
||||
{ separator: true },
|
||||
{ href: 'https://gitee.com/starlight-apk/feature-oss', tooltip: '源码', svg: 'M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4', target: '_blank' }
|
||||
];
|
||||
|
||||
@@ -24,6 +24,23 @@ class ParallaxTracker {
|
||||
}
|
||||
|
||||
_init() {
|
||||
// 自动检测文档页面
|
||||
const docsContent = document.querySelector('.docs-content');
|
||||
if (docsContent && !docsContent.hasAttribute('data-parallax-speed')) {
|
||||
docsContent.setAttribute('data-parallax-speed', '1.0');
|
||||
}
|
||||
|
||||
// 自动检测首页
|
||||
const heroContent = document.querySelector('.hero-content');
|
||||
if (heroContent && !heroContent.hasAttribute('data-parallax-speed')) {
|
||||
heroContent.setAttribute('data-parallax-speed', '1.0');
|
||||
}
|
||||
|
||||
const heroSection = document.querySelector('.page-hero');
|
||||
if (heroSection && !heroSection.hasAttribute('data-parallax-speed')) {
|
||||
heroSection.setAttribute('data-parallax-speed', '1.0');
|
||||
}
|
||||
|
||||
// 查找视差元素
|
||||
document.querySelectorAll('[data-parallax-speed]').forEach(el => {
|
||||
const speed = parseFloat(el.dataset.parallaxSpeed) || 0.1;
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<defs>
|
||||
<linearGradient id="borderGrad" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="#6366f1"/>
|
||||
<stop offset="100%" stop-color="#06b6d4"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<!-- 圆角正方形背景 -->
|
||||
<rect x="32" y="32" width="448" height="448" rx="96" fill="#ffffff" stroke="url(#borderGrad)" stroke-width="5"/>
|
||||
|
||||
<!-- 抽象曲线 Logo:卐字旋转对称 + 层次叠加 -->
|
||||
<g transform="translate(256, 256)">
|
||||
|
||||
<!-- 装饰环:三层同心圆 -->
|
||||
<circle cx="0" cy="0" r="140" fill="none" stroke="#000000" stroke-width="1" opacity="0.06"/>
|
||||
<circle cx="0" cy="0" r="115" fill="none" stroke="#000000" stroke-width="1.5" opacity="0.1" stroke-dasharray="6,8"/>
|
||||
<circle cx="0" cy="0" r="90" fill="none" stroke="#000000" stroke-width="1" opacity="0.08"/>
|
||||
|
||||
<!-- 底层:内层旋转臂(短、粗) -->
|
||||
<g fill="none" stroke="#000000" stroke-width="6" stroke-linecap="round" opacity="0.3">
|
||||
<path d="M 0 -15 L 0 -45 C 0 -55, -12 -55, -22 -55" />
|
||||
<path d="M 15 0 L 45 0 C 55 0, 55 -12, 55 -22" />
|
||||
<path d="M 0 15 L 0 45 C 0 55, 12 55, 22 55" />
|
||||
<path d="M -15 0 L -45 0 C -55 0, -55 12, -55 22" />
|
||||
</g>
|
||||
|
||||
<!-- 核心方块 -->
|
||||
<rect x="-18" y="-18" width="36" height="36" rx="8" fill="#000000" opacity="0.9"/>
|
||||
|
||||
<!-- 中层:主旋转臂 -->
|
||||
<g fill="none" stroke="#000000" stroke-width="10" stroke-linecap="round" opacity="0.6">
|
||||
<path d="M 0 -18 L 0 -65 C 0 -85, -20 -85, -38 -85" />
|
||||
<path d="M 18 0 L 65 0 C 85 0, 85 -20, 85 -38" />
|
||||
<path d="M 0 18 L 0 65 C 0 85, 20 85, 38 85" />
|
||||
<path d="M -18 0 L -65 0 C -85 0, -85 20, -85 38" />
|
||||
</g>
|
||||
|
||||
<!-- 节点点(曲线转折处) -->
|
||||
<circle cx="-22" cy="-55" r="4" fill="#000000" opacity="0.4"/>
|
||||
<circle cx="55" cy="-22" r="4" fill="#000000" opacity="0.4"/>
|
||||
<circle cx="22" cy="55" r="4" fill="#000000" opacity="0.4"/>
|
||||
<circle cx="-55" cy="22" r="4" fill="#000000" opacity="0.4"/>
|
||||
|
||||
<!-- 顶层:主插件方块 -->
|
||||
<rect x="-58" y="-103" width="36" height="36" rx="10" fill="#000000" opacity="0.8"/>
|
||||
<rect x="67" y="-58" width="36" height="36" rx="10" fill="#000000" opacity="0.8"/>
|
||||
<rect x="22" y="67" width="36" height="36" rx="10" fill="#000000" opacity="0.8"/>
|
||||
<rect x="-103" y="22" width="36" height="36" rx="10" fill="#000000" opacity="0.8"/>
|
||||
|
||||
<!-- 对角小装饰点 -->
|
||||
<circle cx="55" cy="-55" r="3" fill="#000000" opacity="0.15"/>
|
||||
<circle cx="55" cy="55" r="3" fill="#000000" opacity="0.15"/>
|
||||
<circle cx="-55" cy="55" r="3" fill="#000000" opacity="0.15"/>
|
||||
<circle cx="-55" cy="-55" r="3" fill="#000000" opacity="0.15"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.7 KiB |
Reference in New Issue
Block a user