mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-29 20:30:00 +08:00
替换原卡片网格为「左上 OpenClaw(石墨黑)vs 右下 Hermes(象牙白)」对角线全屏设计。
启动屏 / 引擎切换时给用户一个有冲击力的「选择时刻」。
## 核心设计
- position: fixed 跳出 #content 范围,覆盖整个 viewport(含 sidebar)
- 双三角形 clip-path: polygon (0 0, 0 100%, 100% 0) / (100% 0, 100% 100%, 0 100%)
- 内容用 absolute 定位到三角形质心(左上 11%/6.5% / 右下 11%/6.5%),永不重叠
- 微妙的 60px 网格纹 + 角落极光(紫蓝 / 橙金)+ 极细中线分割
- clamp(80px, 13vw, 200px) 巨字标题 + 序号 + Logo + tagline + 特性列表 + CTA
## 交互
- hover 联动:用 [data-hover] attribute 替代 :has(),兼容旧 WebKit
- 鼠标悬停一侧 → 该侧亮起 + 内容平移 + CTA 反白;另一侧变暗 + 内容模糊缩小
- 点击三角形 → 三角形 clip-path 扩满(0.8s)→ 中心圆扩散(0.9s)→ 进入主页
- reveal 节点 attach 到 body,跨路由切换存活,新页面渲染后再淡出
## Both / Later 处理
- 两个次级选项保留,做成底部居中的玻璃 pill 链接(不抢戏)
- 不走对角线扩散动画,点击后直接 applyEngineSelection + navigate
## 兼容性
- prefers-reduced-motion: reduce → 关闭所有动画
- 移动端响应式:< 760px 调整字号 / 边距 / 角标
- 用 Vite define 注入的 __APP_VERSION__ 显示版本号(与 main.js / sidebar.js 一致)
## i18n
- engine.choiceTopBanner / choiceCtaEnter
- choiceOpenclaw{Tagline,Feat1,Feat2,Feat3,Category}
- choiceHermes{Tagline,Feat1,Feat2,Feat3,Category}
- choiceSecondary{Both,Later}
- 三语完整(zh-CN / en / zh-TW)
## 抽卡 prototype
保留 docs/engine-select-mockups/ 下的 V2 4 张设计 + 索引页(v2-monolith.html
即本次接入的最终版本)。
230 lines
6.1 KiB
HTML
230 lines
6.1 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<title>Mockup A — 极简对角线(黑白对比)</title>
|
||
<style>
|
||
* { margin: 0; padding: 0; box-sizing: border-box }
|
||
html, body { height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif }
|
||
|
||
/* 整体容器 */
|
||
.stage {
|
||
position: fixed;
|
||
inset: 0;
|
||
background: #000;
|
||
}
|
||
|
||
/* 三角形:clip-path 切对角线(左下→右上)
|
||
左上半(OpenClaw):(0,0) (0,100%) (100%,0)
|
||
右下半(Hermes): (100%,100%) (0,100%) (100%,0) */
|
||
.panel {
|
||
position: absolute;
|
||
inset: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
cursor: pointer;
|
||
transition: filter 0.4s ease;
|
||
color: #fff;
|
||
}
|
||
.panel-openclaw {
|
||
clip-path: polygon(0 0, 0 100%, 100% 0);
|
||
background: #0a0a0a;
|
||
color: #f5f5f5;
|
||
}
|
||
.panel-hermes {
|
||
clip-path: polygon(100% 100%, 0 100%, 100% 0);
|
||
background: #f5f5f5;
|
||
color: #0a0a0a;
|
||
}
|
||
|
||
/* 内容定位:每边贴近自己的「角」 */
|
||
.panel-inner {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
gap: 24px;
|
||
text-align: center;
|
||
transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||
}
|
||
.panel-openclaw .panel-inner {
|
||
margin-top: -120px;
|
||
margin-left: -180px;
|
||
}
|
||
.panel-hermes .panel-inner {
|
||
margin-bottom: -120px;
|
||
margin-right: -180px;
|
||
}
|
||
|
||
/* hover 强化 */
|
||
.panel:hover { filter: brightness(1.08) }
|
||
.panel:hover .panel-inner { transform: scale(1.06) }
|
||
|
||
/* logo */
|
||
.logo {
|
||
width: 80px;
|
||
height: 80px;
|
||
display: grid;
|
||
place-items: center;
|
||
}
|
||
.logo svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.5 }
|
||
|
||
.title {
|
||
font-size: 56px;
|
||
font-weight: 200;
|
||
letter-spacing: -0.04em;
|
||
line-height: 1;
|
||
}
|
||
|
||
.subtitle {
|
||
font-size: 14px;
|
||
opacity: 0.6;
|
||
max-width: 240px;
|
||
line-height: 1.6;
|
||
}
|
||
|
||
/* 中央分割线(hover 时显示提示) */
|
||
.hint {
|
||
position: fixed;
|
||
top: 50%;
|
||
left: 50%;
|
||
transform: translate(-50%, -50%) rotate(-45deg);
|
||
color: rgba(128, 128, 128, 0.3);
|
||
font-size: 11px;
|
||
letter-spacing: 0.2em;
|
||
pointer-events: none;
|
||
text-transform: uppercase;
|
||
z-index: 10;
|
||
}
|
||
|
||
/* —— 选中态展开动画 —— */
|
||
/* 阶段 1: 该三角形扩大到全屏(clip-path 占整个矩形) */
|
||
.panel-openclaw.expanding { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); z-index: 5 }
|
||
.panel-hermes.expanding { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); z-index: 5 }
|
||
.panel.expanding { transition: clip-path 0.6s cubic-bezier(0.7, 0, 0.3, 1) }
|
||
|
||
/* 阶段 2: 中心圆扩散,模拟「展开进入主页」 */
|
||
.reveal {
|
||
position: fixed;
|
||
top: 50%;
|
||
left: 50%;
|
||
width: 0;
|
||
height: 0;
|
||
border-radius: 50%;
|
||
background: #1a1a1a;
|
||
transform: translate(-50%, -50%);
|
||
z-index: 20;
|
||
pointer-events: none;
|
||
transition: width 0.7s ease, height 0.7s ease;
|
||
}
|
||
.reveal.active {
|
||
width: 250vmax;
|
||
height: 250vmax;
|
||
}
|
||
|
||
/* 完成时显示「已进入主页」 */
|
||
.home-mock {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 30;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
color: #fff;
|
||
font-size: 24px;
|
||
font-weight: 200;
|
||
letter-spacing: 0.1em;
|
||
background: #1a1a1a;
|
||
opacity: 0;
|
||
pointer-events: none;
|
||
transition: opacity 0.4s ease;
|
||
}
|
||
.home-mock.show { opacity: 1; pointer-events: auto }
|
||
|
||
.reset-hint {
|
||
position: fixed;
|
||
bottom: 20px;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
color: rgba(255, 255, 255, 0.4);
|
||
font-size: 12px;
|
||
z-index: 40;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
|
||
<div class="stage" id="stage">
|
||
<!-- OpenClaw 左上三角 -->
|
||
<div class="panel panel-openclaw" data-engine="openclaw">
|
||
<div class="panel-inner">
|
||
<div class="logo">
|
||
<svg viewBox="0 0 24 24">
|
||
<path d="M12 2L2 7l10 5 10-5-10-5z"/>
|
||
<path d="M2 17l10 5 10-5"/>
|
||
<path d="M2 12l10 5 10-5"/>
|
||
</svg>
|
||
</div>
|
||
<div class="title">OpenClaw</div>
|
||
<div class="subtitle">通用 AI 助理 · 模型 / 渠道 / 记忆 / 智能体</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Hermes 右下三角 -->
|
||
<div class="panel panel-hermes" data-engine="hermes">
|
||
<div class="panel-inner">
|
||
<div class="logo">
|
||
<svg viewBox="0 0 24 24">
|
||
<path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/>
|
||
</svg>
|
||
</div>
|
||
<div class="title">Hermes</div>
|
||
<div class="subtitle">Agent 工作流 · 工具调用 / Profile / Kanban / Skills</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="hint">SELECT YOUR ENGINE</div>
|
||
</div>
|
||
|
||
<div class="reveal" id="reveal"></div>
|
||
<div class="home-mock" id="home">
|
||
✓ 已进入 <span id="home-name" style="margin-left: 6px"></span> 主页
|
||
</div>
|
||
<div class="reset-hint">点击任意三角形预览动画 · 按 R 重置</div>
|
||
|
||
<script>
|
||
const stage = document.getElementById('stage')
|
||
const reveal = document.getElementById('reveal')
|
||
const home = document.getElementById('home')
|
||
const homeName = document.getElementById('home-name')
|
||
|
||
document.querySelectorAll('.panel').forEach(panel => {
|
||
panel.addEventListener('click', () => {
|
||
const engine = panel.dataset.engine
|
||
const other = stage.querySelector(`.panel:not([data-engine="${engine}"])`)
|
||
// 阶段 1: 选中三角形展开占满
|
||
panel.classList.add('expanding')
|
||
other.style.opacity = '0'
|
||
other.style.transition = 'opacity 0.4s'
|
||
// 阶段 2: 中心圆扩散
|
||
setTimeout(() => {
|
||
reveal.style.background = engine === 'openclaw' ? '#1a1a1a' : '#fafafa'
|
||
home.style.background = engine === 'openclaw' ? '#1a1a1a' : '#fafafa'
|
||
home.style.color = engine === 'openclaw' ? '#fff' : '#000'
|
||
homeName.textContent = engine === 'openclaw' ? 'OpenClaw' : 'Hermes'
|
||
reveal.classList.add('active')
|
||
}, 500)
|
||
// 阶段 3: 显示主页 mock
|
||
setTimeout(() => home.classList.add('show'), 1100)
|
||
})
|
||
})
|
||
|
||
// R 键重置
|
||
document.addEventListener('keydown', (e) => {
|
||
if (e.key.toLowerCase() === 'r') location.reload()
|
||
})
|
||
</script>
|
||
</body>
|
||
</html>
|