app.html 6.1 KB

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