mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-03 18:17:56 -05:00
193 lines
6.3 KiB
HTML
193 lines
6.3 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<!-- LICENSE covers this Open WebUI branding surface, including name, logo,
|
|
visual, textual, symbolic identifiers, metadata, and surrounding UI.
|
|
Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
|
https://docs.openwebui.com/license. -->
|
|
<link rel="icon" type="image/png" href="/static/favicon.png" crossorigin="use-credentials" />
|
|
<link
|
|
rel="icon"
|
|
type="image/png"
|
|
href="/static/favicon-96x96.png"
|
|
sizes="96x96"
|
|
crossorigin="use-credentials"
|
|
/>
|
|
<link
|
|
rel="icon"
|
|
type="image/svg+xml"
|
|
href="/static/favicon.svg"
|
|
crossorigin="use-credentials"
|
|
/>
|
|
<link rel="shortcut icon" href="/static/favicon.ico" crossorigin="use-credentials" />
|
|
<link
|
|
rel="apple-touch-icon"
|
|
sizes="180x180"
|
|
href="/static/apple-touch-icon.png"
|
|
crossorigin="use-credentials"
|
|
/>
|
|
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
|
<meta
|
|
name="viewport"
|
|
content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover, interactive-widget=resizes-content"
|
|
/>
|
|
<meta name="theme-color" content="#121212" />
|
|
<meta name="robots" content="noindex,nofollow" />
|
|
|
|
<script src="/static/loader.js" defer crossorigin="use-credentials"></script>
|
|
<link rel="stylesheet" href="/static/custom.css" crossorigin="use-credentials" />
|
|
|
|
<script>
|
|
function resizeIframe(obj) {
|
|
obj.style.height = obj.contentWindow.document.documentElement.scrollHeight + 'px';
|
|
}
|
|
</script>
|
|
|
|
<script>
|
|
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
|
|
(() => {
|
|
document.documentElement.classList.toggle(
|
|
'native-scrollbars',
|
|
/Android|iPhone|iPad|iPod/i.test(navigator.userAgent) ||
|
|
// iPadOS can report a desktop Mac user agent.
|
|
(/Macintosh/i.test(navigator.userAgent) && navigator.maxTouchPoints > 1)
|
|
);
|
|
|
|
const metaThemeColorTag = document.querySelector('meta[name="theme-color"]');
|
|
const prefersDarkTheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
|
|
// The Her theme was removed.
|
|
if (!localStorage?.theme || localStorage.theme === 'her') {
|
|
localStorage.theme = 'system';
|
|
}
|
|
|
|
// OLED Dark is now the dark theme with a black background colour.
|
|
if (localStorage.theme === 'oled-dark') {
|
|
localStorage.theme = 'dark';
|
|
try {
|
|
const colors = JSON.parse(localStorage.themeColors ?? '{}');
|
|
colors.dark ??= { bg: '#000000', fg: '#ffffff' };
|
|
localStorage.themeColors = JSON.stringify(colors);
|
|
} catch {}
|
|
}
|
|
|
|
if (localStorage.theme === 'system') {
|
|
document.documentElement.classList.add(prefersDarkTheme ? 'dark' : 'light');
|
|
metaThemeColorTag.setAttribute('content', prefersDarkTheme ? '#121212' : '#ffffff');
|
|
} else if (localStorage.theme === 'light') {
|
|
document.documentElement.classList.add('light');
|
|
metaThemeColorTag.setAttribute('content', '#ffffff');
|
|
} else {
|
|
document.documentElement.classList.add('dark');
|
|
metaThemeColorTag.setAttribute('content', '#121212');
|
|
}
|
|
|
|
// User theme colours; keep in sync with applyThemeColors in $lib/utils/theme.
|
|
const applyThemeColors = () => {
|
|
const root = document.documentElement;
|
|
let colors;
|
|
try {
|
|
colors = JSON.parse(localStorage.themeColors ?? '{}')[
|
|
root.classList.contains('dark') ? 'dark' : 'light'
|
|
];
|
|
} catch {}
|
|
if (colors) {
|
|
root.style.setProperty('--app-bg', colors.bg);
|
|
root.style.setProperty('--app-fg', colors.fg);
|
|
metaThemeColorTag.setAttribute('content', colors.bg);
|
|
} else {
|
|
root.style.removeProperty('--app-bg');
|
|
root.style.removeProperty('--app-fg');
|
|
}
|
|
};
|
|
applyThemeColors();
|
|
|
|
// LICENSE covers these Open WebUI splash logo assets.
|
|
// Do not alter, remove, obscure, or replace them except as LICENSE permits:
|
|
// https://docs.openwebui.com/license.
|
|
const preloadHref = document.documentElement.classList.contains('dark')
|
|
? '/static/splash-dark.png'
|
|
: '/static/splash.png';
|
|
const preload = document.createElement('link');
|
|
preload.rel = 'preload';
|
|
preload.as = 'image';
|
|
preload.href = preloadHref;
|
|
preload.setAttribute('fetchpriority', 'high');
|
|
document.head.appendChild(preload);
|
|
|
|
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');
|
|
metaThemeColorTag.setAttribute('content', '#121212');
|
|
} else {
|
|
document.documentElement.classList.add('light');
|
|
document.documentElement.classList.remove('dark');
|
|
metaThemeColorTag.setAttribute('content', '#ffffff');
|
|
}
|
|
applyThemeColors();
|
|
}
|
|
});
|
|
const isDarkMode = document.documentElement.classList.contains('dark');
|
|
|
|
const logo = document.createElement('img');
|
|
logo.id = 'logo';
|
|
logo.style =
|
|
'position: absolute; width: auto; height: 6rem; top: 44%; left: 50%; transform: translateX(-50%); display:block;';
|
|
logo.loading = 'eager';
|
|
logo.fetchPriority = 'high';
|
|
// LICENSE covers this Open WebUI splash logo.
|
|
// Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
|
// https://docs.openwebui.com/license.
|
|
logo.src = isDarkMode ? '/static/splash-dark.png' : '/static/splash.png';
|
|
logo.alt = '';
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
const splash = document.getElementById('splash-screen');
|
|
if (splash) splash.prepend(logo);
|
|
});
|
|
})();
|
|
</script>
|
|
|
|
<title>Open WebUI</title>
|
|
|
|
%sveltekit.head%
|
|
</head>
|
|
|
|
<body data-sveltekit-preload-data="hover">
|
|
<div style="display: contents">%sveltekit.body%</div>
|
|
|
|
<div
|
|
id="splash-screen"
|
|
style="position: fixed; z-index: 100; top: 0; left: 0; width: 100%; height: 100%"
|
|
>
|
|
<style type="text/css" nonce="">
|
|
html {
|
|
overflow-y: scroll !important;
|
|
}
|
|
</style>
|
|
|
|
<!-- <span style="position: absolute; bottom: 32px; left: 50%; margin: -36px 0 0 -36px">
|
|
Footer content
|
|
</span> -->
|
|
</div>
|
|
</body>
|
|
|
|
<style type="text/css" nonce="">
|
|
html {
|
|
overflow-y: hidden !important;
|
|
overscroll-behavior-y: none;
|
|
}
|
|
|
|
#splash-screen {
|
|
background: #fff;
|
|
}
|
|
|
|
html.dark #splash-screen {
|
|
background: #000;
|
|
}
|
|
</style>
|
|
</html>
|