Spaces:
Running
Running
| // Initialize tooltips | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize any tooltips if needed | |
| }); | |
| // Function to fetch data from APIs | |
| async function fetchData(endpoint) { | |
| try { | |
| const response = await fetch(endpoint); | |
| if (!response.ok) throw new Error('Network response was not ok'); | |
| return await response.json(); | |
| } catch (error) { | |
| console.error('Error fetching data:', error); | |
| return null; | |
| } | |
| } | |
| // Smooth scroll for anchor links | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function (e) { | |
| e.preventDefault(); | |
| document.querySelector(this.getAttribute('href')).scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| }); | |
| }); |