File size: 1,296 Bytes
671c006
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);
            }
        });
    }
});