mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-03 18:17:56 -05:00
refac
This commit is contained in:
1 parent
e4264ec664
commit
05e2a6bbe2
82 files changed
+811
-213
No files matched your search
+7
-120
@@ -32,7 +32,7 @@
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover, interactive-widget=resizes-content"
|
||||
/>
|
||||
<meta name="theme-color" content="#171717" />
|
||||
<meta name="theme-color" content="#121212" />
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
|
||||
<script src="/static/loader.js" defer crossorigin="use-credentials"></script>
|
||||
@@ -57,7 +57,8 @@
|
||||
const metaThemeColorTag = document.querySelector('meta[name="theme-color"]');
|
||||
const prefersDarkTheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (!localStorage?.theme) {
|
||||
// The Her theme was removed.
|
||||
if (!localStorage?.theme || localStorage.theme === 'her') {
|
||||
localStorage.theme = 'system';
|
||||
}
|
||||
|
||||
@@ -73,16 +74,13 @@
|
||||
|
||||
if (localStorage.theme === 'system') {
|
||||
document.documentElement.classList.add(prefersDarkTheme ? 'dark' : 'light');
|
||||
metaThemeColorTag.setAttribute('content', prefersDarkTheme ? '#171717' : '#ffffff');
|
||||
metaThemeColorTag.setAttribute('content', prefersDarkTheme ? '#121212' : '#ffffff');
|
||||
} else if (localStorage.theme === 'light') {
|
||||
document.documentElement.classList.add('light');
|
||||
metaThemeColorTag.setAttribute('content', '#ffffff');
|
||||
} else if (localStorage.theme === 'her') {
|
||||
document.documentElement.classList.add('her');
|
||||
metaThemeColorTag.setAttribute('content', '#983724');
|
||||
} else {
|
||||
document.documentElement.classList.add('dark');
|
||||
metaThemeColorTag.setAttribute('content', '#171717');
|
||||
metaThemeColorTag.setAttribute('content', '#121212');
|
||||
}
|
||||
|
||||
// User theme colours; keep in sync with applyThemeColors in $lib/utils/theme.
|
||||
@@ -94,7 +92,7 @@
|
||||
root.classList.contains('dark') ? 'dark' : 'light'
|
||||
];
|
||||
} catch {}
|
||||
if (colors && !root.classList.contains('her')) {
|
||||
if (colors) {
|
||||
root.style.setProperty('--app-bg', colors.bg);
|
||||
root.style.setProperty('--app-fg', colors.fg);
|
||||
metaThemeColorTag.setAttribute('content', colors.bg);
|
||||
@@ -123,7 +121,7 @@
|
||||
if (e.matches) {
|
||||
document.documentElement.classList.add('dark');
|
||||
document.documentElement.classList.remove('light');
|
||||
metaThemeColorTag.setAttribute('content', '#171717');
|
||||
metaThemeColorTag.setAttribute('content', '#121212');
|
||||
} else {
|
||||
document.documentElement.classList.add('light');
|
||||
document.documentElement.classList.remove('dark');
|
||||
@@ -148,10 +146,6 @@
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const splash = document.getElementById('splash-screen');
|
||||
if (document.documentElement.classList.contains('her')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (splash) splash.prepend(logo);
|
||||
});
|
||||
})();
|
||||
@@ -175,60 +169,6 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div
|
||||
style="
|
||||
position: absolute;
|
||||
top: 33%;
|
||||
left: 50%;
|
||||
|
||||
width: 24rem;
|
||||
transform: translateX(-50%);
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
"
|
||||
>
|
||||
<!-- LICENSE covers this Open WebUI splash logo.
|
||||
Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
https://docs.openwebui.com/license. -->
|
||||
<img
|
||||
id="logo-her"
|
||||
alt=""
|
||||
style="width: auto; height: 13rem"
|
||||
src="/static/splash.png"
|
||||
loading="eager"
|
||||
fetchpriority="high"
|
||||
class="animate-pulse-fast"
|
||||
/>
|
||||
|
||||
<div style="position: relative; width: 24rem; margin-top: 0.5rem">
|
||||
<div
|
||||
id="progress-background"
|
||||
style="
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 0.75rem;
|
||||
|
||||
border-radius: 9999px;
|
||||
background-color: #fafafa9a;
|
||||
"
|
||||
></div>
|
||||
|
||||
<div
|
||||
id="progress-bar"
|
||||
style="
|
||||
position: absolute;
|
||||
width: 0%;
|
||||
height: 0.75rem;
|
||||
border-radius: 9999px;
|
||||
background-color: #fff;
|
||||
"
|
||||
class="bg-white"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <span style="position: absolute; bottom: 32px; left: 50%; margin: -36px 0 0 -36px">
|
||||
Footer content
|
||||
</span> -->
|
||||
@@ -248,58 +188,5 @@
|
||||
html.dark #splash-screen {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
html.her #splash-screen {
|
||||
background: #983724;
|
||||
}
|
||||
|
||||
#logo-her {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#progress-background {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#progress-bar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html.her #logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html.her #logo-her {
|
||||
display: block;
|
||||
filter: invert(1);
|
||||
}
|
||||
|
||||
html.her #progress-background {
|
||||
display: block;
|
||||
}
|
||||
|
||||
html.her #progress-bar {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (max-width: 24rem) {
|
||||
html.her #progress-background {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html.her #progress-bar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
50% {
|
||||
opacity: 0.65;
|
||||
}
|
||||
}
|
||||
|
||||
.animate-pulse-fast {
|
||||
animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
||||
}
|
||||
</style>
|
||||
</html>
|
||||
Reference in new issue
Block a user