app.html 2.94 KB
Newer Older
Timothy J. Baek's avatar
Timothy J. Baek committed
1
2
3
4
5
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<link rel="icon" href="%sveltekit.assets%/favicon.png" />
Timothy J. Baek's avatar
Timothy J. Baek committed
6
		<link rel="manifest" href="%sveltekit.assets%/manifest.json" crossorigin="use-credentials" />
Timothy J. Baek's avatar
Timothy J. Baek committed
7
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
tracer123's avatar
tracer123 committed
8
		<meta name="robots" content="noindex,nofollow" />
9
10
11
12
13
14
		<link
			rel="search"
			type="application/opensearchdescription+xml"
			title="Open WebUI"
			href="/opensearch.xml"
		/>
Timothy J. Baek's avatar
Timothy J. Baek committed
15
16
17
18

		<script type="module" src="/pyscript/core.js"></script>
		<link rel="stylesheet" href="/pyscript/core.css" />

Timothy J. Baek's avatar
Timothy J. Baek committed
19
20
		<script>
			// On page load or when changing themes, best to add inline in `head` to avoid FOUC
21
			(() => {
Timothy J. Baek's avatar
Timothy J. Baek committed
22
				if (localStorage?.theme && localStorage?.theme.includes('oled')) {
23
					document.documentElement.style.setProperty('--color-gray-900', '#000000');
24
					document.documentElement.style.setProperty('--color-gray-950', '#000000');
25
					document.documentElement.classList.add('dark');
Timothy J. Baek's avatar
Timothy J. Baek committed
26
				} else if (
27
28
29
30
31
32
33
34
35
36
37
					localStorage.theme === 'light' ||
					(!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: light)').matches)
				) {
					document.documentElement.classList.add('light');
				} else if (localStorage.theme && localStorage.theme !== 'system') {
					localStorage.theme.split(' ').forEach((e) => {
						document.documentElement.classList.add(e);
					});
				} else if (localStorage.theme && localStorage.theme === 'system') {
					systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
					document.documentElement.classList.add(systemTheme ? 'dark' : 'light');
Danny Liu's avatar
Danny Liu committed
38
				} else {
39
40
					document.documentElement.classList.add('dark');
				}
41

42
43
44
45
46
47
48
49
50
				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');
						} else {
							document.documentElement.classList.add('light');
							document.documentElement.classList.remove('dark');
						}
51
					}
Danny Liu's avatar
Danny Liu committed
52
				});
53
			})();
Timothy J. Baek's avatar
Timothy J. Baek committed
54
55
		</script>

Timothy J. Baek's avatar
Timothy J. Baek committed
56
57
		<title>Open WebUI</title>

Timothy J. Baek's avatar
Timothy J. Baek committed
58
59
60
		%sveltekit.head%
	</head>
	<body data-sveltekit-preload-data="hover">
Timothy J. Baek's avatar
Timothy J. Baek committed
61
62
63
64
65
		<py-config> interpreter = "/pyodide/pyodide.mjs" </py-config>

		<script type="py">
			print('pyscript:loaded')
		</script>
Timothy J. Baek's avatar
Timothy J. Baek committed
66
		<div style="display: contents">%sveltekit.body%</div>
Timothy J. Baek's avatar
Timothy J. Baek committed
67

Timothy J. Baek's avatar
Timothy J. Baek committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
		<div
			id="splash-screen"
			style="
				position: fixed;
				z-index: 100;
				background: #fff;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
			"
		>
			<style type="text/css" nonce="">
				html {
					overflow-y: scroll !important;
				}
			</style>

			<img
				style="
					position: absolute;
					width: 6rem;
					height: 6rem;
Timothy J. Baek's avatar
Timothy J. Baek committed
91
					top: 46%;
Timothy J. Baek's avatar
Timothy J. Baek committed
92
93
94
95
96
97
98
99
100
					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> -->
Timothy J. Baek's avatar
Timothy J. Baek committed
101
		</div>
Timothy J. Baek's avatar
Timothy J. Baek committed
102
103
	</body>
</html>