|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function switchTab(tabName) {
|
|
|
document.querySelectorAll('.tab-button').forEach(btn => btn.classList.remove('active'));
|
|
|
document.querySelectorAll('.tab-content').forEach(content => content.classList.remove('active'));
|
|
|
|
|
|
const tabButton = document.querySelector(`[data-tab="${tabName}"]`);
|
|
|
const tabContent = document.getElementById(tabName);
|
|
|
|
|
|
if (tabButton) tabButton.classList.add('active');
|
|
|
if (tabContent) tabContent.classList.add('active');
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function setupTabListeners() {
|
|
|
document.querySelectorAll('.tab-button').forEach(button => {
|
|
|
button.addEventListener('click', () => switchTab(button.dataset.tab));
|
|
|
});
|
|
|
}
|
|
|
|