mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
refac
This commit is contained in:
parent
bc8d24c951
commit
704d07e9a2
1 changed files with 1 additions and 29 deletions
|
|
@ -2,40 +2,12 @@
|
|||
import { getContext } from 'svelte';
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
import { WEBUI_BASE_URL } from '$lib/constants';
|
||||
|
||||
export let show = true;
|
||||
export let getStartedHandler = () => {};
|
||||
|
||||
let videoElement;
|
||||
let playOnInteractionRegistered = false;
|
||||
|
||||
function setLogoImage() {
|
||||
const logo = document.getElementById('logo');
|
||||
|
||||
if (logo) {
|
||||
const isDarkMode = document.documentElement.classList.contains('dark');
|
||||
|
||||
if (isDarkMode) {
|
||||
const darkImage = new Image();
|
||||
darkImage.src = `${WEBUI_BASE_URL}/static/favicon-dark.png`;
|
||||
|
||||
darkImage.onload = () => {
|
||||
logo.src = `${WEBUI_BASE_URL}/static/favicon-dark.png`;
|
||||
logo.style.filter = ''; // Ensure no inversion is applied if splash-dark.png exists
|
||||
};
|
||||
|
||||
darkImage.onerror = () => {
|
||||
logo.style.filter = 'invert(1)'; // Invert image if splash-dark.png is missing
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$: if (show) {
|
||||
setLogoImage();
|
||||
}
|
||||
|
||||
function playBackgroundVideo() {
|
||||
if (!videoElement) {
|
||||
return;
|
||||
|
|
@ -71,7 +43,7 @@
|
|||
<img
|
||||
id="logo"
|
||||
crossorigin="anonymous"
|
||||
src="{WEBUI_BASE_URL}/static/favicon.png"
|
||||
src="/static/favicon.png"
|
||||
class="size-6 rounded-full"
|
||||
alt="logo"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue