Spaces:
Running
Running
Download script.js from qmerfp/officeshare-hub: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/spaces/qmerfp/officeshare-hub/resolve/main/script.js
- Command line
-
hf download hf://spaces/qmerfp/officeshare-hub/script.js
-
curl -L -o script.js https://huggingface.co/spaces/qmerfp/officeshare-hub/resolve/main/script.js
1.35 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Mobile menu toggle functionality | |
| const mobileMenuButton = document.querySelector('[data-menu-toggle]'); | |
| const mobileMenu = document.querySelector('[data-menu]'); | |
| if(mobileMenuButton && mobileMenu) { | |
| mobileMenuButton.addEventListener('click', () => { | |
| mobileMenu.classList.toggle('hidden'); | |
| }); | |
| } | |
| // 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' | |
| }); | |
| }); | |
| }); | |
| // Testimonial slider | |
| const testimonials = document.querySelectorAll('.testimonial-item'); | |
| let currentTestimonial = 0; | |
| if(testimonials.length > 0) { | |
| function showTestimonial(index) { | |
| testimonials.forEach(testimonial => { | |
| testimonial.classList.add('hidden'); | |
| }); | |
| testimonials[index].classList.remove('hidden'); | |
| } | |
| setInterval(() => { | |
| currentTestimonial = (currentTestimonial + 1) % testimonials.length; | |
| showTestimonial(currentTestimonial); | |
| }, 5000); | |
| } | |
| }); |