Dark mode by default.

This commit is contained in:
Michael Andrew Maurakis 2025-01-20 02:17:55 -06:00
parent 1282bf2bda
commit 5240aec346

View file

@ -291,14 +291,18 @@
document.getElementById("fumbleButton").addEventListener("click", fumble);
// Dark mode toggle
const darkModeToggle = document.getElementById("darkModeToggle");
const darkModeToggleArea = document.getElementById("darkModeToggleArea");
const body = document.body;
// Check for saved preference
if (localStorage.getItem("darkMode") === "true") {
body.classList.add("dark-mode");
darkModeToggle.textContent = "☀️";
const darkModeToggle = document.getElementById('darkModeToggle');
const darkModeToggleArea = document.getElementById('darkModeToggleArea');
const body = document.body;
// Check for saved preference, default to dark if not set
if (localStorage.getItem('darkMode') === null) {
localStorage.setItem('darkMode', 'true');
}
if (localStorage.getItem('darkMode') === 'true') {
body.classList.add('dark-mode');
darkModeToggle.textContent = '☀️';
}
const toggleDarkMode = () => {