Download script.js from KN3AUX-CODE/codenest-android-studio-clone: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/spaces/KN3AUX-CODE/codenest-android-studio-clone/resolve/main/script.js
- Command line
-
hf download hf://spaces/KN3AUX-CODE/codenest-android-studio-clone/script.js
-
curl -L -o script.js https://huggingface.co/spaces/KN3AUX-CODE/codenest-android-studio-clone/resolve/main/script.js
1.3 kB
| 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); | |
| } | |
| }); | |
| } | |
| }); |