desktop/index.html
Rama main · réplica de lectura del repositorio original.
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="%BASE_URL%app-icon-small.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="color-scheme" content="light dark" />
<title>Mao</title>
<script>
// 尽早标记 Capacitor 安卓(仅 localhost WebView,避免误伤手机浏览器)
// 配合 CSS 立即隐藏 #splash,并启用安卓紧凑顶栏样式
;(function () {
var ua = navigator.userAgent || ''
var host = location.hostname || ''
if (/Android/i.test(ua) && /^(localhost|127\.0\.0\.1)$/i.test(host)) {
document.documentElement.classList.add('android-capacitor')
}
})()
;(function () {
var mode = localStorage.getItem('aw-theme-mode')
var prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
if (mode === 'dark' || (mode !== 'light' && prefersDark)) {
document.documentElement.classList.add('dark')
}
})()
</script>
<style>
html,
body {
margin: 0;
height: 100%;
background: #f5f5f7;
}
html.dark body {
background: #1d1d1f;
}
/* 与 style.css 双保险:外部 CSS 未加载时也要藏掉安卓 HTML splash */
html.android-capacitor #splash {
display: none !important;
}
#splash {
position: fixed;
inset: 0;
z-index: 99999;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 20px;
background: rgba(245, 245, 247, 0.8);
color: #1d1d1f;
transition: opacity 0.28s ease, visibility 0.28s ease;
}
html.dark #splash {
background: rgba(29, 29, 31, 0.8);
color: #f5f5f7;
}
#splash.splash--fade-out {
opacity: 0;
visibility: hidden;
pointer-events: none;
}
#splash img {
width: 72px;
height: 72px;
border-radius: 16px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
html.dark #splash img {
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
#splash .splash-title {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
font-size: 22px;
font-weight: 600;
letter-spacing: 0.02em;
}
#splash .splash-dots {
display: flex;
gap: 6px;
margin-top: 4px;
}
#splash .splash-dots span {
width: 6px;
height: 6px;
border-radius: 50%;
background: #0066cc;
opacity: 0.35;
animation: splash-dot 1.2s ease-in-out infinite;
}
html.dark #splash .splash-dots span {
background: #2997ff;
}
#splash .splash-dots span:nth-child(2) {
animation-delay: 0.15s;
}
#splash .splash-dots span:nth-child(3) {
animation-delay: 0.3s;
}
@keyframes splash-dot {
0%,
80%,
100% {
opacity: 0.35;
transform: scale(1);
}
40% {
opacity: 1;
transform: scale(1.15);
}
}
</style>
</head>
<body>
<div id="splash" aria-hidden="true">
<img src="%BASE_URL%app-icon-small.png" alt="" width="72" height="72" />
<p class="splash-title" aria-hidden="true"></p>
<div class="splash-dots" aria-label="加载中">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>