Editing code with my formatting

This commit is contained in:
Sharwin24 2024-12-27 14:10:06 -08:00
parent caae7b85b7
commit aa2d0606ce
9 changed files with 503 additions and 283 deletions

View file

@ -1,9 +1,9 @@
let theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'light'
let theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'dark'
if (theme === 'system') {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
theme = 'dark'
} else {
theme = 'light'
theme = 'dark'
}
}
document.documentElement.setAttribute('data-theme', theme)

View file

@ -23,7 +23,7 @@ window.addEventListener('load', async () => {
function getPreferredColorScheme() {
const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches;
return isDarkMode ? "dark" : "light";
return isDarkMode ? "dark" : "dark";
}
function setScheme(newScheme) {