Spaces:
Running
Running
Download script.js from Joadm/sportspulse-prodigy: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/Joadm/sportspulse-prodigy/resolve/main/script.js
- Command line
-
hf download hf://spaces/Joadm/sportspulse-prodigy/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Joadm/sportspulse-prodigy/resolve/main/script.js
1.03 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Mobile menu toggle functionality will be added here | |
| const mobileMenuButton = document.querySelector('[data-collapse-toggle="mobile-menu"]'); | |
| const mobileMenu = document.getElementById('mobile-menu'); | |
| if (mobileMenuButton && mobileMenu) { | |
| mobileMenuButton.addEventListener('click', function() { | |
| mobileMenu.classList.toggle('hidden'); | |
| }); | |
| } | |
| // Initialize any carousels or sliders | |
| // This would be expanded with actual slider implementation | |
| }); | |
| // API fetch example for news data | |
| async function fetchSportsNews() { | |
| try { | |
| const response = await fetch('https://site.api.espn.com/apis/site/v2/sports/football/nfl/news'); | |
| const data = await response.json(); | |
| console.log('Sports news data:', data); | |
| // Process and display the data | |
| } catch (error) { | |
| console.error('Error fetching sports news:', error); | |
| } | |
| } | |
| // Call the function when needed | |
| // fetchSportsNews(); |