feat: PWA support — manifest, service worker, icons, public auth exemption
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1549,10 +1549,14 @@
|
||||
// ── Theme toggle ──────────────────────────────────────────────
|
||||
const themeBtn = document.getElementById('theme-btn');
|
||||
|
||||
const _metaThemeColor = document.getElementById('meta-theme-color');
|
||||
const _themeColors = { dark: '#1a1228', light: '#f2eef9' };
|
||||
|
||||
function applyTheme(theme) {
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
themeBtn.textContent = theme === 'dark' ? '☀' : '☾';
|
||||
themeBtn.title = theme === 'dark' ? 'Switch to light mode' : 'Switch to dark mode';
|
||||
if (_metaThemeColor) _metaThemeColor.content = _themeColors[theme] || _themeColors.dark;
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1729,3 +1733,8 @@
|
||||
const stored = get_stored_session();
|
||||
if (stored) resumeSession(stored, true).catch(clear_stored_session);
|
||||
}
|
||||
|
||||
// ── Service worker registration ───────────────────────────────
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/sw.js').catch(() => {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user