app.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <link rel="icon" href="%sveltekit.assets%/favicon.png" />
  6. <link rel="manifest" href="%sveltekit.assets%/manifest.json" crossorigin="use-credentials" />
  7. <meta
  8. name="viewport"
  9. content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover"
  10. />
  11. <meta name="theme-color" content="#171717" />
  12. <meta name="robots" content="noindex,nofollow" />
  13. <meta name="description" content="Open WebUI" />
  14. <link
  15. rel="search"
  16. type="application/opensearchdescription+xml"
  17. title="Open WebUI"
  18. href="/opensearch.xml"
  19. />
  20. <script>
  21. function resizeIframe(obj) {
  22. obj.style.height = obj.contentWindow.document.documentElement.scrollHeight + 'px';
  23. }
  24. </script>
  25. <script>
  26. // On page load or when changing themes, best to add inline in `head` to avoid FOUC
  27. (() => {
  28. const metaThemeColorTag = document.querySelector('meta[name="theme-color"]');
  29. const prefersDarkTheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
  30. if (!localStorage?.theme) {
  31. localStorage.theme = 'system';
  32. }
  33. if (localStorage.theme === 'system') {
  34. document.documentElement.classList.add(prefersDarkTheme ? 'dark' : 'light');
  35. metaThemeColorTag.setAttribute('content', prefersDarkTheme ? '#171717' : '#ffffff');
  36. } else if (localStorage.theme === 'oled-dark') {
  37. document.documentElement.style.setProperty('--color-gray-800', '#101010');
  38. document.documentElement.style.setProperty('--color-gray-850', '#050505');
  39. document.documentElement.style.setProperty('--color-gray-900', '#000000');
  40. document.documentElement.style.setProperty('--color-gray-950', '#000000');
  41. document.documentElement.classList.add('dark');
  42. metaThemeColorTag.setAttribute('content', '#000000');
  43. } else if (localStorage.theme === 'light') {
  44. document.documentElement.classList.add('light');
  45. metaThemeColorTag.setAttribute('content', '#ffffff');
  46. } else if (localStorage.theme === 'her') {
  47. document.documentElement.classList.add('dark');
  48. document.documentElement.classList.add('her');
  49. metaThemeColorTag.setAttribute('content', '#983724');
  50. } else {
  51. document.documentElement.classList.add('dark');
  52. metaThemeColorTag.setAttribute('content', '#171717');
  53. }
  54. window.matchMedia('(prefers-color-scheme: dark)').addListener((e) => {
  55. if (localStorage.theme === 'system') {
  56. if (e.matches) {
  57. document.documentElement.classList.add('dark');
  58. document.documentElement.classList.remove('light');
  59. metaThemeColorTag.setAttribute('content', '#171717');
  60. } else {
  61. document.documentElement.classList.add('light');
  62. document.documentElement.classList.remove('dark');
  63. metaThemeColorTag.setAttribute('content', '#ffffff');
  64. }
  65. }
  66. });
  67. })();
  68. </script>
  69. <title>Open WebUI</title>
  70. %sveltekit.head%
  71. </head>
  72. <body data-sveltekit-preload-data="hover">
  73. <div style="display: contents">%sveltekit.body%</div>
  74. <div
  75. id="splash-screen"
  76. style="position: fixed; z-index: 100; top: 0; left: 0; width: 100%; height: 100%"
  77. >
  78. <style type="text/css" nonce="">
  79. html {
  80. overflow-y: scroll !important;
  81. }
  82. </style>
  83. <img
  84. id="logo"
  85. style="
  86. position: absolute;
  87. width: auto;
  88. height: 6rem;
  89. top: 44%;
  90. left: 50%;
  91. transform: translateX(-50%);
  92. "
  93. src="/static/splash.png"
  94. />
  95. <div
  96. style="
  97. position: absolute;
  98. top: 33%;
  99. left: 50%;
  100. width: 24rem;
  101. transform: translateX(-50%);
  102. display: flex;
  103. flex-direction: column;
  104. align-items: center;
  105. "
  106. >
  107. <img
  108. id="logo-her"
  109. style="width: auto; height: 13rem"
  110. src="/static/splash.png"
  111. class="animate-pulse-fast"
  112. />
  113. <div style="position: relative; width: 24rem; margin-top: 0.5rem">
  114. <div
  115. id="progress-background"
  116. style="
  117. position: absolute;
  118. width: 100%;
  119. height: 0.75rem;
  120. border-radius: 9999px;
  121. background-color: #fafafa9a;
  122. "
  123. ></div>
  124. <div
  125. id="progress-bar"
  126. style="
  127. position: absolute;
  128. width: 0%;
  129. height: 0.75rem;
  130. border-radius: 9999px;
  131. background-color: #fff;
  132. "
  133. class="bg-white"
  134. ></div>
  135. </div>
  136. </div>
  137. <!-- <span style="position: absolute; bottom: 32px; left: 50%; margin: -36px 0 0 -36px">
  138. Footer content
  139. </span> -->
  140. </div>
  141. </body>
  142. </html>
  143. <style type="text/css" nonce="">
  144. html {
  145. overflow-y: hidden !important;
  146. }
  147. #splash-screen {
  148. background: #fff;
  149. }
  150. html.dark #splash-screen {
  151. background: #000;
  152. }
  153. html.dark #splash-screen img {
  154. filter: invert(1);
  155. }
  156. html.her #splash-screen {
  157. background: #983724;
  158. }
  159. #logo-her {
  160. display: none;
  161. }
  162. #progress-background {
  163. display: none;
  164. }
  165. #progress-bar {
  166. display: none;
  167. }
  168. html.her #logo {
  169. display: none;
  170. }
  171. html.her #logo-her {
  172. display: block;
  173. filter: invert(1);
  174. }
  175. html.her #progress-background {
  176. display: block;
  177. }
  178. html.her #progress-bar {
  179. display: block;
  180. }
  181. @media (max-width: 24rem) {
  182. html.her #progress-background {
  183. display: none;
  184. }
  185. html.her #progress-bar {
  186. display: none;
  187. }
  188. }
  189. @keyframes pulse {
  190. 50% {
  191. opacity: 0.65;
  192. }
  193. }
  194. .animate-pulse-fast {
  195. animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  196. }
  197. </style>