Close
Skip to content
Home
Shop
About Us
Contact
<!-- HTML for Dark/Light Mode Toggle --> <input type="checkbox" id="theme-toggle" aria-label="Dark mode toggle" /> <!-- CSS for Toggle Button --> <style> /* Basic styles for the toggle switch */ #theme-toggle { width: 40px; height: 20px; -webkit-appearance: none; background-color: #ddd; border-radius: 50px; position: relative; outline: none; cursor: pointer; transition: background-color 0.3s ease-in-out; } #theme-toggle:checked { background-color: #333; } #theme-toggle::before { content: ''; width: 16px; height: 16px; background-color: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform 0.3s ease-in-out; } #theme-toggle:checked::before { transform: translateX(20px); } /* Light and Dark Mode Styles */ body.light-mode { background-color: #fff; color: #000; } body.dark-mode { background-color: #222; color: #fff; } </style> <!-- JavaScript for Theme Switching --> <script> // Function to set the theme based on user preference function setTheme(theme) { if (theme === 'dark') { document.body.classList.add('dark-mode'); document.body.classList.remove('light-mode'); document.getElementById('theme-toggle').checked = true; } else { document.body.classList.add('light-mode'); document.body.classList.remove('dark-mode'); document.getElementById('theme-toggle').checked = false; } } // Check stored theme on page load window.onload = function () { const savedTheme = localStorage.getItem('theme') || 'light'; setTheme(savedTheme); }; // Toggle the theme when the checkbox is clicked document.getElementById('theme-toggle').addEventListener('change', function () { const theme = this.checked ? 'dark' : 'light'; setTheme(theme); localStorage.setItem('theme', theme); }); </script>
$
0
Main Menu
Home
Shop
About Us
Contact
Cart
Your cart is currently empty.
Return to shop