// Toggle dark mode by adding/removing 'dark-mode' class to the body document.addEventListener('DOMContentLoaded', function() { // Check for existing dark mode preference in localStorage if (localStorage.getItem('darkMode') === 'enabled') { document.body.classList.add('dark-mode'); } // Function to toggle dark mode on click function toggleDarkMode() { document.body.classList.toggle('dark-mode'); // Save the current mode to localStorage if (document.body.classList.contains('dark-mode')) { localStorage.setItem('darkMode', 'enabled'); } else { localStorage.setItem('darkMode', 'disabled'); } } // Listen for a button click or any other trigger you want to use document.getElementById('dark-mode-toggle').addEventListener('click', toggleDarkMode); });
top of page
saucy boodah background.jpg
bottom of page