File size: 980 Bytes
cb2b30f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
// Initialize tooltips
document.addEventListener('DOMContentLoaded', function() {
// Any initialization code can go here
console.log('CodeCanvas Studio initialized');
});
// Example API call function
async function fetchData(endpoint) {
try {
const response = await fetch(`/api/${endpoint}`);
const data = await response.json();
return data;
} catch (error) {
console.error('Error fetching data:', error);
return null;
}
}
// Mobile menu toggle functionality
function setupMobileMenu() {
const mobileMenuButton = document.getElementById('mobile-menu-button');
const mobileMenu = document.getElementById('mobile-menu');
if (mobileMenuButton && mobileMenu) {
mobileMenuButton.addEventListener('click', () => {
mobileMenu.classList.toggle('hidden');
});
}
}
// Initialize when DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
setupMobileMenu();
}); |