| document.addEventListener('DOMContentLoaded', function() { | |
| // Theme switcher functionality | |
| const themeToggle = document.getElementById('theme-toggle'); | |
| if (themeToggle) { | |
| themeToggle.addEventListener('click', function() { | |
| const html = document.querySelector('html'); | |
| if (html.classList.contains('dark')) { | |
| html.classList.remove('dark'); | |
| localStorage.setItem('theme', 'light'); | |
| } else { | |
| html.classList.add('dark'); | |
| localStorage.setItem('theme', 'dark'); | |
| } | |
| }); | |
| } | |
| // Check for saved theme preference | |
| if (localStorage.getItem('theme') === 'light') { | |
| document.querySelector('html').classList.remove('dark'); | |
| } | |
| // Simulate build process | |
| const buildButton = document.getElementById('build-button'); | |
| if (buildButton) { | |
| buildButton.addEventListener('click', function() { | |
| const statusbar = document.querySelector('custom-statusbar'); | |
| if (statusbar) { | |
| statusbar.setAttribute('message', 'Building...'); | |
| setTimeout(() => { | |
| statusbar.setAttribute('message', 'Build successful'); | |
| }, 2000); | |
| } | |
| }); | |
| } | |
| }); |