Skip to content

Commit

Permalink
syntax error bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur-adriansens authored Jan 6, 2024
1 parent a889be2 commit 8e3be7d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
<link rel="stylesheet" href="style-dark.css" />
<link rel="icon" href="https://cdn.glitch.global/a2328394-6a2f-46f0-9a34-e8b074480846/favicon.ico?v=1699797335084" type="image/x-icon" />
<script>
document.addEventListener('DOMContentLoaded', function() {
// check if the device prefers dark mode
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.classList.add('dark');
}
document.addEventListener("DOMContentLoaded", function () {
// check if the device prefers dark mode
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
document.documentElement.classList.add("dark");
}

// check if dark mode preference is eneabled in localstorage
if (localStorage.getItem('theme') == 'dark') {
document.body.classList.add('dark');
}
}
// check if dark mode preference is eneabled in localstorage
if (localStorage.getItem("theme") == "dark") {
document.body.classList.add("dark");
}
});
</script>
</head>

Expand Down

0 comments on commit 8e3be7d

Please sign in to comment.