OrangeTV/index.html

45 lines
1.6 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
/>
<meta name="description" content="影视聚合" />
<link rel="manifest" href="/manifest.json" />
<link rel="apple-touch-icon" href="/icons/icon-192x192.png" />
<script src="/runtime-config.js"></script>
<script>
(function () {
try {
const cachedTheme = localStorage.getItem('theme-cache');
if (!cachedTheme) return;
const themeConfig = JSON.parse(cachedTheme);
const html = document.documentElement;
html.removeAttribute('data-theme');
if (themeConfig.defaultTheme && themeConfig.defaultTheme !== 'default') {
html.setAttribute('data-theme', themeConfig.defaultTheme);
}
if (themeConfig.customCSS) {
let customStyleEl = document.getElementById('custom-theme-css');
if (!customStyleEl) {
customStyleEl = document.createElement('style');
customStyleEl.id = 'custom-theme-css';
document.head.appendChild(customStyleEl);
}
customStyleEl.textContent = themeConfig.customCSS;
}
} catch (error) {
localStorage.removeItem('theme-cache');
}
})();
</script>
<title>OrangeTV</title>
</head>
<body class="min-h-[100dvh] bg-background text-foreground antialiased">
<div id="root"></div>
<script type="module" src="/src/client/main.tsx"></script>
</body>
</html>