Flatlogic Bot d076708932 feat: Implement new design and features for the main page
- Redesigned the main page with a modern look and feel.
- Added search and filtering functionality for drills.
- Implemented pagination for browsing drills.
- Added the ability for users to mark drills as favorites.
2025-12-07 18:15:23 +00:00

21 lines
728 B
JavaScript

document.addEventListener('DOMContentLoaded', function () {
const themeSwitcher = document.getElementById('theme-switcher');
const body = document.body;
// Set the default theme to light if no preference is saved
const savedTheme = localStorage.getItem('theme') || 'light';
body.setAttribute('data-theme', savedTheme);
themeSwitcher.checked = savedTheme === 'dark';
themeSwitcher.addEventListener('change', function() {
if (this.checked) {
body.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
} else {
body.setAttribute('data-theme', 'light');
localStorage.setItem('theme', 'light');
}
});
});