feat: splash screen support

This commit is contained in:
Timothy J. Baek 2024-04-27 18:50:26 -04:00
parent bcf78b4efa
commit 979c4290f7
2 changed files with 16 additions and 2 deletions

View file

@ -47,5 +47,16 @@
</head> </head>
<body data-sveltekit-preload-data="hover"> <body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div> <div style="display: contents">%sveltekit.body%</div>
<div id="splash-screen" style="min-height: 100vh; height: 100dvh; display: flex">
<div style="margin: auto">
<img
src="/logo.svg"
alt="logo"
style="width: 6rem; height: 6rem; margin-bottom: 2rem"
draggable="false"
/>
</div>
</div>
</body> </body>
</html> </html>

View file

@ -7,18 +7,21 @@
import { getBackendConfig } from '$lib/apis'; import { getBackendConfig } from '$lib/apis';
import { getSessionUser } from '$lib/apis/auths'; import { getSessionUser } from '$lib/apis/auths';
import '../app.css';
import '../tailwind.css'; import '../tailwind.css';
import '../app.css';
import 'tippy.js/dist/tippy.css'; import 'tippy.js/dist/tippy.css';
import { WEBUI_BASE_URL } from '$lib/constants'; import { WEBUI_BASE_URL } from '$lib/constants';
import i18n, { initI18n } from '$lib/i18n'; import i18n, { initI18n } from '$lib/i18n';
import Spinner from '$lib/components/common/Spinner.svelte';
setContext('i18n', i18n); setContext('i18n', i18n);
let loaded = false; let loaded = false;
onMount(async () => { onMount(async () => {
document.getElementById('splash-screen')?.remove();
theme.set(localStorage.theme); theme.set(localStorage.theme);
// Check Backend Status // Check Backend Status
const backendConfig = await getBackendConfig(); const backendConfig = await getBackendConfig();