initial commit
This commit is contained in:
39
views/layout_bottom.php
Normal file
39
views/layout_bottom.php
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
</main>
|
||||
</div>
|
||||
<script>
|
||||
// Dark Mode Toggle
|
||||
const themeBtn = document.getElementById('theme-toggle');
|
||||
const iconLight = document.getElementById('theme-icon-light');
|
||||
const iconDark = document.getElementById('theme-icon-dark');
|
||||
|
||||
function updateThemeIcon() {
|
||||
if(document.body.classList.contains('dark-mode')) {
|
||||
iconLight.style.display = 'block';
|
||||
iconDark.style.display = 'none';
|
||||
} else {
|
||||
iconLight.style.display = 'none';
|
||||
iconDark.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
if(themeBtn) {
|
||||
updateThemeIcon();
|
||||
themeBtn.addEventListener('click', () => {
|
||||
document.body.classList.toggle('dark-mode');
|
||||
const isDark = document.body.classList.contains('dark-mode');
|
||||
localStorage.setItem('theme', isDark ? 'dark' : 'light');
|
||||
updateThemeIcon();
|
||||
});
|
||||
}
|
||||
|
||||
// Toast Notifier
|
||||
function showToast(msg) {
|
||||
const t = document.getElementById('toast');
|
||||
t.textContent = msg;
|
||||
t.classList.add('show');
|
||||
setTimeout(() => t.classList.remove('show'), 3000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user