Spaces:
Running
Running
Download script.js from hashunst/techfusion-summit-2024: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/hashunst/techfusion-summit-2024/resolve/main/script.js
- Command line
-
hf download hf://spaces/hashunst/techfusion-summit-2024/script.js
-
curl -L -o script.js https://huggingface.co/spaces/hashunst/techfusion-summit-2024/resolve/main/script.js
1.12 kB
| // Initialize sidebar to be visible by default on desktop | |
| document.addEventListener('DOMContentLoaded', () => { | |
| const sidebar = document.querySelector('custom-sidebar'); | |
| if (window.innerWidth > 768) { | |
| sidebar.classList.add('open'); | |
| } | |
| }); | |
| // Toggle sidebar on mobile | |
| window.addEventListener('resize', () => { | |
| const sidebar = document.querySelector('custom-sidebar'); | |
| if (window.innerWidth > 768) { | |
| sidebar.classList.add('open'); | |
| } else { | |
| sidebar.classList.remove('open'); | |
| } | |
| }); | |
| // 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' | |
| }); | |
| }); | |
| }); | |
| // Form submission handler | |
| document.querySelector('#register form')?.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| alert('Thank you for your registration! We will contact you shortly.'); | |
| this.reset(); | |
| }); | |
| // Mobile menu functionality would go here | |
| // (Handled by navbar component) |