Spaces:
Running
Running
I want to design a first page as dashboard a clean and professional for the following app as
fe27297 verified Download script.js from test5667890/dark-mode-delight: direct link, hf CLI and curl.
- Browser
- Download file 1.42 kB
-
https://huggingface.co/spaces/test5667890/dark-mode-delight/resolve/main/script.js
- Command line
-
hf download hf://spaces/test5667890/dark-mode-delight/script.js
-
curl -L -o script.js https://huggingface.co/spaces/test5667890/dark-mode-delight/resolve/main/script.js
1.42 kB
| document.addEventListener('DOMContentLoaded', () => { | |
| // Smooth scrolling for anchor links | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function (e) { | |
| e.preventDefault(); | |
| document.querySelector(this.getAttribute('href')).scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| }); | |
| }); | |
| // Dark mode toggle | |
| const darkModeToggle = document.getElementById('darkModeToggle'); | |
| if (darkModeToggle) { | |
| darkModeToggle.addEventListener('click', () => { | |
| document.documentElement.classList.toggle('dark'); | |
| }); | |
| } | |
| // Initialize sidebar active state | |
| const sidebarItems = document.querySelectorAll('custom-sidebar .sidebar-item'); | |
| sidebarItems.forEach(item => { | |
| item.addEventListener('click', () => { | |
| sidebarItems.forEach(i => i.classList.remove('active')); | |
| item.classList.add('active'); | |
| }); | |
| }); | |
| // Page card click handler | |
| document.querySelectorAll('.bg-white.rounded-lg.shadow').forEach(card => { | |
| card.addEventListener('click', (e) => { | |
| // Check if click was on a button inside the card | |
| if (!e.target.closest('button')) { | |
| console.log('Navigate to page editor'); | |
| // window.location.href = '/editor.html'; | |
| } | |
| }); | |
| }); | |
| }); | |