Spaces:
Running
Running
Download script.js from Worexj/orbit-premium-clone: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/Worexj/orbit-premium-clone/resolve/main/script.js
- Command line
-
hf download hf://spaces/Worexj/orbit-premium-clone/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Worexj/orbit-premium-clone/resolve/main/script.js
1.04 kB
| // Mobile menu toggle functionality | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const mobileMenuButton = document.getElementById('mobile-menu-button'); | |
| const mobileMenu = document.getElementById('mobile-menu'); | |
| if (mobileMenuButton && mobileMenu) { | |
| mobileMenuButton.addEventListener('click', function() { | |
| mobileMenu.classList.toggle('hidden'); | |
| }); | |
| } | |
| // Close mobile menu when clicking outside | |
| document.addEventListener('click', function(event) { | |
| if (mobileMenu && !mobileMenu.contains(event.target) && | |
| mobileMenuButton && !mobileMenuButton.contains(event.target)) { | |
| mobileMenu.classList.add('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' | |
| }); | |
| }); | |
| }); |