File size: 1,433 Bytes
7b7c155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
// Main application script
document.addEventListener('DOMContentLoaded', function() {
    // Initialize tooltips
    const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
    
    // Channel favoriting functionality
    document.querySelectorAll('.favorite-btn').forEach(btn => {
        btn.addEventListener('click', function(e) {
            e.preventDefault();
            e.stopPropagation();
            const icon = this.querySelector('i');
            if (icon.getAttribute('data-feather') === 'heart') {
                icon.setAttribute('data-feather', 'heart');
                feather.replace();
                this.classList.remove('text-gray-400');
                this.classList.add('text-red-500');
            } else {
                icon.setAttribute('data-feather', 'heart');
                feather.replace();
                this.classList.remove('text-red-500');
                this.classList.add('text-gray-400');
            }
        });
    });

    // Mobile menu toggle (handled in navbar component)
    
    // Simulate loading popular channels
    async function loadPopularChannels() {
        try {
            // In a real app, this would fetch from your API
            console.log('Loading popular channels...');
        } catch (error) {
            console.error('Error loading channels:', error);
        }
    }
    
    loadPopularChannels();
});