Spaces:
Running
Running
Download script.js from LMLK/deepsite-project-jbsif: direct link, hf CLI and curl.
- Browser
- Download file 1.81 kB
-
https://huggingface.co/spaces/LMLK/deepsite-project-jbsif/resolve/main/script.js
- Command line
-
hf download hf://spaces/LMLK/deepsite-project-jbsif/script.js
-
curl -L -o script.js https://huggingface.co/spaces/LMLK/deepsite-project-jbsif/resolve/main/script.js
1.81 kB
| // Initialize Lucide icons | |
| lucide.createIcons(); | |
| // Mobile menu toggle | |
| const mobileMenuBtn = document.getElementById('mobile-menu-btn'); | |
| const mobileMenu = document.getElementById('mobile-menu'); | |
| const menuIcon = mobileMenuBtn.querySelector('i'); | |
| mobileMenuBtn.addEventListener('click', () => { | |
| mobileMenu.classList.toggle('hidden'); | |
| const isOpen = !mobileMenu.classList.contains('hidden'); | |
| menuIcon.setAttribute('data-lucide', isOpen ? 'x' : 'menu'); | |
| lucide.createIcons(); | |
| }); | |
| // Close mobile menu on link click | |
| document.querySelectorAll('.mobile-nav-link').forEach(link => { | |
| link.addEventListener('click', () => { | |
| mobileMenu.classList.add('hidden'); | |
| menuIcon.setAttribute('data-lucide', 'menu'); | |
| lucide.createIcons(); | |
| }); | |
| }); | |
| // Scroll reveal animations | |
| const revealElements = document.querySelectorAll('.reveal, .reveal-left, .reveal-right'); | |
| const revealObserver = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('active'); | |
| } | |
| }); | |
| }, { | |
| threshold: 0.1, | |
| rootMargin: '0px 0px -50px 0px' | |
| }); | |
| revealElements.forEach(el => revealObserver.observe(el)); | |
| // Navbar shadow on scroll | |
| const navbar = document.getElementById('navbar'); | |
| window.addEventListener('scroll', () => { | |
| if (window.scrollY > 50) { | |
| navbar.classList.add('shadow-md'); | |
| } else { | |
| navbar.classList.remove('shadow-md'); | |
| } | |
| }); | |
| // Update footer year | |
| document.getElementById('year').textContent = new Date().getFullYear(); | |
| // Contact form submission | |
| const contactForm = document.getElementById('contact-form'); | |
| contactForm.addEventListener('submit', (e) => { | |
| e.preventDefault(); | |
| alert('转讜讚讛! 驻谞讬讬转讱 谞砖诇讞讛 讘讛爪诇讞讛, 讛讜讚讬讛 转讞讝讜专 讗诇讬讬讱 讘讛拽讚诐.'); | |
| contactForm.reset(); | |
| }); |