open-webui/src/app.html

52 lines
1.9 KiB
HTML
Raw Normal View History

2023-10-09 00:38:42 +02:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
2023-11-30 21:09:55 +01:00
<link rel="manifest" href="%sveltekit.assets%/manifest.json" />
2023-10-24 10:57:51 +02:00
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="robots" content="noindex,nofollow" />
2023-11-06 00:01:55 +01:00
<script>
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
2024-03-17 08:25:33 +01:00
(() => {
if (localStorage.theme.includes('oled')) {
document.documentElement.style.setProperty('--color-gray-900', '#000000');
document.documentElement.classList.add('dark');
}
else if (
2024-03-17 08:25:33 +01:00
localStorage.theme === 'light' ||
(!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: light)').matches)
) {
document.documentElement.classList.add('light');
} else if (localStorage.theme && localStorage.theme !== 'system') {
localStorage.theme.split(' ').forEach((e) => {
document.documentElement.classList.add(e);
});
} else if (localStorage.theme && localStorage.theme === 'system') {
systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
document.documentElement.classList.add(systemTheme ? 'dark' : 'light');
2024-03-17 09:00:38 +01:00
} else {
2024-03-17 08:25:33 +01:00
document.documentElement.classList.add('dark');
}
2024-03-17 08:25:33 +01:00
window.matchMedia('(prefers-color-scheme: dark)').addListener((e) => {
if (localStorage.theme === 'system') {
if (e.matches) {
document.documentElement.classList.add('dark');
document.documentElement.classList.remove('light');
} else {
document.documentElement.classList.add('light');
document.documentElement.classList.remove('dark');
}
}
2024-03-17 09:00:38 +01:00
});
2024-03-17 08:25:33 +01:00
})();
2023-11-06 00:01:55 +01:00
</script>
2023-10-09 00:38:42 +02:00
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>