Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
9ef843d4
Commit
9ef843d4
authored
Apr 27, 2024
by
Timothy J. Baek
Browse files
refac: splash screen
parent
975e078f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
22 deletions
+35
-22
src/app.html
src/app.html
+33
-9
src/routes/+layout.svelte
src/routes/+layout.svelte
+2
-13
No files found.
src/app.html
View file @
9ef843d4
...
@@ -50,15 +50,39 @@
...
@@ -50,15 +50,39 @@
<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
<div
style=
"margin: auto"
>
id=
"splash-screen"
<img
style=
"
src=
"/logo.svg"
position: fixed;
alt=
"logo"
z-index: 100;
style=
"width: 6rem; height: 6rem; margin-bottom: 2rem"
background: #fff;
draggable=
"false"
top: 0;
/>
left: 0;
</div>
width: 100%;
height: 100%;
"
>
<style
type=
"text/css"
nonce=
""
>
html
{
overflow-y
:
scroll
!important
;
}
</style>
<img
style=
"
position: absolute;
width: 6rem;
height: 6rem;
top: 45%;
left: 50%;
margin: -40px 0 0 -40px;
"
src=
"/logo.svg"
/>
<!-- <span style="position: absolute; bottom: 32px; left: 50%; margin: -36px 0 0 -36px">
Footer content
</span> -->
</div>
</div>
</body>
</body>
</html>
</html>
src/routes/+layout.svelte
View file @
9ef843d4
...
@@ -20,8 +20,6 @@
...
@@ -20,8 +20,6 @@
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();
...
@@ -64,6 +62,8 @@
...
@@ -64,6 +62,8 @@
}
}
await tick();
await tick();
document.getElementById('splash-screen')?.remove();
loaded = true;
loaded = true;
});
});
</script>
</script>
...
@@ -80,17 +80,6 @@
...
@@ -80,17 +80,6 @@
{#if loaded}
{#if loaded}
<slot />
<slot />
{:else}
<div class=" min-h-screen h-[100dvh] flex">
<div class="m-auto">
<img
src="/logo.svg"
alt="logo"
class=" size-24 rounded-full border-[1px] border-gray-200 dark:border-none mx-auto mb-8"
draggable="false"
/>
</div>
</div>
{/if}
{/if}
<Toaster richColors position="top-center" />
<Toaster richColors position="top-center" />
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment