perf+ui: gzip (api/static precompressed), immutable attachment cache, responsive dialogs/header, safe-area + dynamic theme-color, mobile tuning

This commit is contained in:
root
2026-10-16 23:34:36 +08:00
parent 3ba44aa2de
commit 275a0313e1
21 changed files with 145 additions and 95 deletions
+8
View File
@@ -17,6 +17,14 @@ if (saved === 'dark' || (!saved && window.matchMedia('(prefers-color-scheme: dar
document.documentElement.classList.add('dark');
}
// 状态栏/标题栏颜色跟随主题(亮暗切换实时同步)
function syncThemeColor() {
const bg = getComputedStyle(document.documentElement).getPropertyValue('--bg').trim();
if (bg) document.querySelector('meta[name="theme-color"]')?.setAttribute('content', bg);
}
syncThemeColor();
window.addEventListener('fp-theme-change', syncThemeColor);
// PWA:仅生产构建且非桌面壳时注册(桌面端走 Tauri,无需 SW)
if ('serviceWorker' in navigator && import.meta.env.PROD && !('__TAURI_INTERNALS__' in window)) {
window.addEventListener('load', () => {