fix: default to dark theme in loading screen, close #549

This commit is contained in:
James Xylight committed 2025-06-25 17:06:44 -07:00
1 parent ab0be13c2f
commit 57d072f24c
2 files changed
+17 -69

No files matched your search

+5 -57
View File
@@ -6,24 +6,6 @@
<link rel="manifest" href="/manifest.json" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="keywords" content="lemmy, client" />
<script defer type="">
const dark = () =>
localStorage.theme == 'dark' ||
((!localStorage.theme || localStorage.theme == 'system') &&
window.matchMedia('(prefers-color-scheme: dark)').matches)
if (dark()) document.documentElement.classList.add('dark')
else document.documentElement.classList.remove('dark')
window
.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', event => {
if (dark()) document.documentElement.classList.add('dark')
else document.documentElement.classList.remove('dark')
})
// document.getElementById("loader")?.classList.remove('hidden')
</script>
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
@@ -33,13 +15,11 @@
height: 100vh;
z-index: -50;
position: absolute;
top: 0;
left: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1rem;
inset: 0;
display: grid;
place-items: center;
background-color: #111115;
color: #fafafe;
"
>
<svg
@@ -53,39 +33,7 @@
d="M45 20.8868C48.094 19.1004 51.906 19.1004 55 20.8868L72.7128 31.1132C75.8068 32.8996 77.7128 36.2008 77.7128 39.7735V60.2265C77.7128 63.7992 75.8068 67.1004 72.7128 68.8867L55 79.1133C51.906 80.8996 48.094 80.8996 45 79.1133L27.2872 68.8867C24.1932 67.1004 22.2872 63.7992 22.2872 60.2265V39.7735C22.2872 36.2008 24.1932 32.8996 27.2872 31.1132L45 20.8868Z"
/>
</svg>
<svg
stroke="currentColor"
fill="none"
stroke-width="2"
viewBox="0 0 24 24"
stroke-linecap="round"
stroke-linejoin="round"
height="20"
width="20"
class="animate-spin"
xmlns="http://www.w3.org/2000/svg"
>
<line x1="12" y1="2" x2="12" y2="6"></line>
<line x1="12" y1="18" x2="12" y2="22"></line>
<line x1="4.93" y1="4.93" x2="7.76" y2="7.76"></line>
<line x1="16.24" y1="16.24" x2="19.07" y2="19.07"></line>
<line x1="2" y1="12" x2="6" y2="12"></line>
<line x1="18" y1="12" x2="22" y2="12"></line>
<line x1="4.93" y1="19.07" x2="7.76" y2="16.24"></line>
<line x1="16.24" y1="7.76" x2="19.07" y2="4.93"></line>
</svg>
</div>
<div style="display: contents">%sveltekit.body%</div>
</body>
<style>
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.animate-spin {
animation: spin 0.9s linear infinite;
}
</style>
</html>
+12 -12
View File
@@ -29,18 +29,18 @@
--color-slate-900: rgb(var(--c-s-900, 15 23 42));
--color-slate-950: rgb(var(--c-s-950, 2 6 23));
--color-zinc-50: rgb(var(--c-z-50, 251 253 255));
--color-zinc-100: rgb(var(--c-z-100, 246 247 249));
--color-zinc-200: rgb(var(--c-z-200, 229 231 235));
--color-zinc-300: rgb(var(--c-z-300, 217 221 226));
--color-zinc-400: rgb(var(--c-z-400, 171 177 188));
--color-zinc-500: rgb(var(--c-z-500, 127 133 146));
--color-zinc-600: rgb(var(--c-z-600, 95 104 117));
--color-zinc-700: rgb(var(--c-z-700, 75 84 99));
--color-zinc-800: rgb(var(--c-z-800, 42 50 63));
--color-zinc-900: rgb(var(--c-z-900, 32 37 50));
--color-zinc-925: rgb(var(--c-z-925, 28 32 43));
--color-zinc-950: rgb(var(--c-z-950, 23 27 36));
--color-zinc-50: rgb(var(--c-z-50, 252 252 254));
--color-zinc-100: rgb(var(--c-z-100, 248 248 251));
--color-zinc-200: rgb(var(--c-z-200, 235 235 240));
--color-zinc-300: rgb(var(--c-z-300, 222 222 228));
--color-zinc-400: rgb(var(--c-z-400, 175 175 185));
--color-zinc-500: rgb(var(--c-z-500, 128 128 138));
--color-zinc-600: rgb(var(--c-z-600, 98 98 108));
--color-zinc-700: rgb(var(--c-z-700, 68 68 76));
--color-zinc-800: rgb(var(--c-z-800, 47 47 54));
--color-zinc-900: rgb(var(--c-z-900, 34 34 39));
--color-zinc-925: rgb(var(--c-z-925, 28 28 32));
--color-zinc-950: rgb(var(--c-z-950, 25 25 29));
--color-primary-100: rgb(var(--c-p-100, 241 245 249));
--color-primary-900: rgb(var(--c-p-900, 15 23 42));