\
关于光湖
\
光湖是一个语言驱动的操作系统平台。
\
用户全程不需要点菜单,只需要跟人格体说话。
\
人格体理解你的意图 → 系统动态渲染对应模块 → 你感觉整个网站只有你一个人。
\
\
技术栈
\
\
- 前端:纯HTML + CSS + JavaScript(无框架)
\
- 路由:Hash-based SPA Router
\
- 模块:动态加载 + 懒加载
\
\
\
';
});
// ====== 启动 ======
ChannelRouter.start();
console.log('🌊 光湖频道引擎启动完成');
```
**Step 0-5 · 创建样式表(channel-style.css)**
```bash
nano channel-style.css
```
写入以下内容:
```css
/* ====== 光湖频道引擎样式 · M-CHANNEL v1.0 ====== */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--primary: #2563eb;
--primary-hover: #1d4ed8;
--bg: #0f172a;
--bg-card: #1e293b;
--bg-nav: #1e293b;
--text: #f1f5f9;
--text-muted: #94a3b8;
--border: #334155;
--accent: #38bdf8;
--radius: 12px;
--transition: 0.3s ease;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
}
#app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
/* ====== 导航栏 ====== */
#main-nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24px;
height: 60px;
background: var(--bg-nav);
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
z-index: 100;
}
.nav-brand {
font-size: 1.25rem;
font-weight: 700;
color: var(--accent);
}
.nav-links {
display: flex;
gap: 8px;
}
.nav-link {
color: var(--text-muted);
text-decoration: none;
padding: 8px 16px;
border-radius: 8px;
transition: var(--transition);
font-size: 0.9rem;
}
.nav-link:hover {
color: var(--text);
background: rgba(255,255,255,0.05);
}
.nav-link.active {
color: var(--accent);
background: rgba(56, 189, 248, 0.1);
}
/* ====== 内容区 ====== */
#route-view {
flex: 1;
padding: 32px 24px;
max-width: 1200px;
margin: 0 auto;
width: 100%;
}
.page-container {
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
/* ====== 首页 ====== */
.home-page {
text-align: center;
padding-top: 80px;
}
.home-page h1 {
font-size: 2.5rem;
margin-bottom: 12px;
}
.subtitle {
color: var(--text-muted);
font-size: 1.1rem;
margin-bottom: 32px;
}
.btn {
padding: 12px 32px;
border: none;
border-radius: var(--radius);
font-size: 1rem;
cursor: pointer;
transition: var(--transition);
}
.btn-primary {
background: var(--primary);
color: white;
}
.btn-primary:hover {
background: var(--primary-hover);
transform: translateY(-2px);
}
.home-stats {
display: flex;
justify-content: center;
gap: 24px;
margin-top: 48px;
}
.stat-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 24px 32px;
display: flex;
flex-direction: column;
gap: 4px;
}
.stat-number {
font-size: 1.5rem;
font-weight: 700;
color: var(--accent);
}
.stat-label {
font-size: 0.85rem;
color: var(--text-muted);
}
/* ====== 频道页 ====== */
.channel-header {
margin-bottom: 32px;
}
.channel-header h1 {
margin-bottom: 8px;
}
.channel-header p {
color: var(--text-muted);
}
.module-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 16px;
}
.module-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 24px;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
cursor: pointer;
transition: var(--transition);
}
.module-card:hover {
border-color: var(--accent);
transform: translateY(-4px);
box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.module-icon {
font-size: 2rem;
}
.module-name {
font-weight: 600;
font-size: 0.95rem;
}
.module-id {
font-size: 0.75rem;
color: var(--text-muted);
}
/* ====== 关于页 ====== */
.about-page h1 {
margin-bottom: 16px;
}
.about-page p {
margin-bottom: 12px;
color: var(--text-muted);
line-height: 1.6;
}
.about-tech {
margin-top: 32px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 24px;
}
.about-tech h3 {
margin-bottom: 12px;
}
.about-tech ul {
list-style: none;
padding: 0;
}
.about-tech li {
padding: 4px 0;
color: var(--text-muted);
}
.about-tech li::before {
content: '▸ ';
color: var(--accent);
}
/* ====== 底部状态栏 ====== */
#status-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 24px;
background: var(--bg-nav);
border-top: 1px solid var(--border);
font-size: 0.8rem;
color: var(--text-muted);
}
/* ====== 响应式 ====== */
@media (max-width: 768px) {
.home-page h1 { font-size: 1.8rem; }
.home-stats { flex-direction: column; align-items: center; }
.module-grid { grid-template-columns: repeat(2, 1fr); }
#main-nav { padding: 0 16px; }
#route-view { padding: 24px 16px; }
}
@media (max-width: 480px) {
.module-grid { grid-template-columns: 1fr; }
.nav-links { gap: 4px; }
.nav-link { padding: 6px 10px; font-size: 0.8rem; }
}
```
**Step 0-6 · 测试环节0**
```bash
open index.html
```
在浏览器中验证:
- [ ] 页面打开显示「欢迎来到光湖」首页
- [ ] 点击「我的频道」→ 内容切换到频道页(模块卡片网格)→ URL变成 `#/channel`
- [ ] 点击「关于」→ 内容切换到关于页 → URL变成 `#/about`
- [ ] 点击「首页」→ 回到首页 → URL变成 `#/home`
- [ ] **全程页面不刷新**,只有内容区在变
- [ ] 导航栏当前页面高亮
- [ ] 页面切换时有淡入动画
- [ ] 底部状态栏显示当前路由路径
---
### 环节1 · 模块动态加载