login and dashboard pages

This commit is contained in:
2025-04-16 16:44:21 +03:00
parent 4e43c17242
commit db465d6e4e
15 changed files with 426 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
document.addEventListener('DOMContentLoaded', () => {
const themeToggle = document.getElementById('theme-toggle');
const body = document.body;
// Check for saved theme in localStorage
const savedTheme = localStorage.getItem('theme');
if (savedTheme) {
body.className = savedTheme;
updateButtonText();
}
// Toggle theme on button click
if (themeToggle) {
themeToggle.addEventListener('click', () => {
if (body.classList.contains('light-mode')) {
body.className = 'dark-mode';
localStorage.setItem('theme', 'dark-mode');
} else {
body.className = 'light-mode';
localStorage.setItem('theme', 'light-mode');
}
updateButtonText();
});
}
// Function to update the button text
function updateButtonText() {
if (body.classList.contains('light-mode')) {
themeToggle.textContent = 'Change to dark theme';
} else {
themeToggle.textContent = 'Change to light theme';
}
}
});