CI / Lint & TypeCheck (push) Canceled after 0s
CI / Test (push) Canceled after 0s
CI / Tauri Foundation Acceptance (push) Canceled after 0s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Build (ubuntu-latest) (push) Canceled after 0s
CI / Build (windows-latest) (push) Canceled after 0s
- apps/server:Gin embed 官网 + /docs + /health + /download(无操作 API) - run.sh 重写 web/gui 场景;.gitignore 排除 server 二进制与挂载的安装包 - README/AGENTS/CLAUDE 同步「浏览器只看官网、操作走桌面」的产品形态说明 - 终端视口背景变量与全宽终端边缘 hairline 修正(serial/terminal/i18n 微调)
36 lines
1.3 KiB
JavaScript
36 lines
1.3 KiB
JavaScript
// OpsXShell 产品站 — 无依赖静态脚本
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
// 移动端导航
|
|
const toggle = document.querySelector('.nav-toggle')
|
|
const links = document.querySelector('.nav-links')
|
|
toggle?.addEventListener('click', () => links?.classList.toggle('open'))
|
|
links?.querySelectorAll('a').forEach((a) =>
|
|
a.addEventListener('click', () => links.classList.remove('open'))
|
|
)
|
|
|
|
// 复制 SHA-256
|
|
document.querySelectorAll('[data-copy]').forEach((button) => {
|
|
button.addEventListener('click', async () => {
|
|
const value = button.getAttribute('data-copy') || ''
|
|
try {
|
|
await navigator.clipboard.writeText(value)
|
|
const original = button.textContent
|
|
button.textContent = '已复制 ✓'
|
|
setTimeout(() => { button.textContent = original }, 1600)
|
|
} catch {
|
|
// 剪贴板不可用(如 file:// 非安全上下文)时退回选中文本提示
|
|
button.textContent = '请手动复制'
|
|
setTimeout(() => { button.textContent = original }, 1600)
|
|
}
|
|
})
|
|
})
|
|
|
|
// FAQ 单开(details 互斥)
|
|
const faqs = document.querySelectorAll('.faq-item')
|
|
faqs.forEach((item) =>
|
|
item.addEventListener('toggle', () => {
|
|
if (item.open) faqs.forEach((other) => { if (other !== item) other.open = false })
|
|
})
|
|
)
|
|
})
|