Download script.js from Crossberry/codecollabx-where-devs-unite: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/spaces/Crossberry/codecollabx-where-devs-unite/resolve/main/script.js
- Command line
-
hf download hf://spaces/Crossberry/codecollabx-where-devs-unite/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Crossberry/codecollabx-where-devs-unite/resolve/main/script.js
1.48 kB
| document.addEventListener('DOMContentLoaded', () => { | |
| // Mobile menu toggle | |
| const mobileMenuButton = document.getElementById('mobile-menu-button'); | |
| const mobileMenu = document.getElementById('mobile-menu'); | |
| if (mobileMenuButton && mobileMenu) { | |
| mobileMenuButton.addEventListener('click', () => { | |
| mobileMenu.classList.toggle('hidden'); | |
| }); | |
| } | |
| // Dropdown menu functionality | |
| const dropdownButtons = document.querySelectorAll('[data-dropdown-toggle]'); | |
| dropdownButtons.forEach(button => { | |
| button.addEventListener('click', () => { | |
| const dropdownId = button.getAttribute('data-dropdown-toggle'); | |
| const dropdown = document.getElementById(dropdownId); | |
| dropdown.classList.toggle('hidden'); | |
| }); | |
| }); | |
| // Close dropdown when clicking outside | |
| document.addEventListener('click', (e) => { | |
| if (!e.target.closest('[data-dropdown-toggle]')) { | |
| document.querySelectorAll('[data-dropdown]').forEach(dropdown => { | |
| dropdown.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' | |
| }); | |
| }); | |
| }); | |
| }); |