mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-07-23 05:53:55 -04:00
31 lines
911 B
HTML
31 lines
911 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width" />
|
|
%sveltekit.head%
|
|
<script>
|
|
const darkTheme = 'dark';
|
|
const lightTheme = 'cupcake';
|
|
const preferesDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
const theme = localStorage.getItem('theme')
|
|
? localStorage.getItem('theme')
|
|
: preferesDark
|
|
? darkTheme
|
|
: lightTheme;
|
|
document.documentElement.setAttribute('data-theme', theme);
|
|
|
|
window
|
|
.matchMedia('(prefers-color-scheme: dark)')
|
|
.addEventListener('change', ({ matches }) => {
|
|
matches
|
|
? document.documentElement.setAttribute('data-theme', darkTheme)
|
|
: document.documentElement.setAttribute('data-theme', lightTheme);
|
|
});
|
|
</script>
|
|
</head>
|
|
<body data-sveltekit-preload-data="hover">
|
|
<div style="display: contents">%sveltekit.body%</div>
|
|
</body>
|
|
</html>
|