Updated themeing on 404 page

This commit is contained in:
Thomas Cole 2023-08-06 10:43:31 -04:00
parent abf4575151
commit 0ad815d516

View File

@ -4,7 +4,7 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/icon-512.png" />
<meta name="generator" content={Astro.generator} /> <meta name="generator" content={Astro.generator} />
<title>thomaspcole.com | 404</title> <title>thomaspcole.com | 404</title>
@ -25,22 +25,25 @@
} }
</style> </style>
<script is:inline> <script is:inline>
if (localStorage.getItem("theme") === null) { if (!('theme' in localStorage)) {
document.documentElement.setAttribute("data-theme", "business"); localStorage.setItem("theme", "light")
}
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark')
} else { } else {
document.documentElement.setAttribute("data-theme", localStorage.getItem("theme")); document.documentElement.classList.remove('dark')
} }
</script> </script>
</head> </head>
<body class="w-full h-screen"> <body class="w-full h-screen bg-white dark:bg-gray-900">
<div class="flex flex-col w-full h-screen text-center place-content-center"> <div class="flex flex-col w-full h-screen text-center text-gray-900 place-content-center dark:text-white">
<h1 class="text-5xl">Uh Oh!</h1> <h1 class="text-5xl">Uh Oh!</h1>
<p class="text-2xl">Sorry about that I can't seem to find what you are looking for.</p> <p class="text-2xl">Sorry about that I can't seem to find what you are looking for.</p>
<br> <br>
<a href="/" class="underline">Go Home</a> <a href="/" class="underline">Go Home</a>
</div> </div>
</body> </body>
</html> </html>