chore: 官网拆分 homepage + 关于页瘦身 + 端口 5175(当前可用状态基线)
This commit is contained in:
1 parent
5eb11826db
commit
be151cb68f
85 files changed
+4420
-1530
No files matched your search
@@ -0,0 +1,35 @@
|
||||
// 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 })
|
||||
})
|
||||
)
|
||||
})
|
||||
Reference in new issue
Block a user