// Partner Category Navigation functionality let currentCategory = 'connectivity'; function showCategory(categoryName) { // Hide all categories const categories = document.querySelectorAll('.partner-category'); categories.forEach(category => { category.classList.add('hidden'); }); // Show selected category const selectedCategory = document.getElementById(`${categoryName}-partners`); if (selectedCategory) { selectedCategory.classList.remove('hidden'); } // Update button states const buttons = document.querySelectorAll('.category-btn'); buttons.forEach(button => { button.classList.remove('active'); button.classList.remove('bg-[var(--navy-color)]', 'text-white'); button.classList.add('bg-gray-200', 'text-[var(--navy-color)]'); }); // Activate clicked button const activeButton = document.querySelector(`[data-category="${categoryName}"]`); if (activeButton) { activeButton.classList.add('active'); activeButton.classList.remove('bg-gray-200', 'text-[var(--navy-color)]'); activeButton.classList.add('bg-[var(--navy-color)]', 'text-white'); } currentCategory = categoryName; } function handleCategoryClick(event) { const categoryName = event.currentTarget.getAttribute('data-category'); if (categoryName) { showCategory(categoryName); } } function init() { // Initialize category buttons const categoryButtons = document.querySelectorAll('.category-btn'); categoryButtons.forEach(button => { button.addEventListener('click', handleCategoryClick); }); // Show initial category showCategory(currentCategory); } function teardown() { // Remove event listeners const categoryButtons = document.querySelectorAll('.category-btn'); categoryButtons.forEach(button => { button.removeEventListener('click', handleCategoryClick); }); } // Export functions for the system export { init, teardown };