File size: 953 Bytes
888c52f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
// --------------------Podcast Tabs Functionality--------------------
const podcastTabButtons = document.querySelectorAll('.podcast-tab-button');
const podcastContents = document.querySelectorAll('.podcast-content');

podcastTabButtons.forEach(button => {
  button.addEventListener('click', () => {
    // Remove active class from all buttons
    podcastTabButtons.forEach(btn => btn.classList.remove('active'));
    // Add active class to the clicked button
    button.classList.add('active');

    // Hide all podcast content
    podcastContents.forEach(content => {
      content.classList.add('hidden');
      content.classList.remove('active');
    });

    // Show the selected podcast content
    const target = button.getAttribute('data-podcast-tab');
    const targetContent = document.getElementById(target);
    if (targetContent) {
      targetContent.classList.remove('hidden');
      targetContent.classList.add('active');
    }
  });
});