File size: 4,191 Bytes
559ff8d
 
 
 
 
 
 
 
 
 
 
9cbdeca
 
559ff8d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Main JavaScript for SoftFetch Pro

// Initialize tooltips for buttons
document.addEventListener('DOMContentLoaded', function() {
    // Add tooltip functionality to download buttons
    const downloadButtons = document.querySelectorAll('.download-btn');
    
    downloadButtons.forEach(button => {
        button.addEventListener('mouseenter', function() {
            const tooltip = document.createElement('div');
            tooltip.className = 'tooltip absolute -top-10 left-1/2 transform -translate-x-1/2 bg-dark text-white px-3 py-1 rounded-lg text-sm whitespace-nowrap z-50 border border-gray-700';
            tooltip.textContent = '보안 다운로드 • 검증됨';
this.appendChild(tooltip);
        });
        
        button.addEventListener('mouseleave', function() {
            const tooltip = this.querySelector('.tooltip');
            if (tooltip) {
                tooltip.remove();
            }
        });
    });
    
    // Add scroll animations
    const observerOptions = {
        threshold: 0.1,
        rootMargin: '0px 0px -50px 0px'
    };
    
    const observer = new IntersectionObserver((entries) => {
        entries.forEach(entry => {
            if (entry.isIntersecting) {
                entry.target.classList.add('animate-slide-in');
            }
        });
    }, observerOptions);
    
    // Observe all software cards and stat cards
    document.querySelectorAll('software-card, .stat-card').forEach(card => {
        observer.observe(card);
    });
    
    // Search functionality
    const searchInput = document.getElementById('search-input');
    if (searchInput) {
        searchInput.addEventListener('input', function(e) {
            const searchTerm = e.target.value.toLowerCase();
            const softwareCards = document.querySelectorAll('software-card');
            
            softwareCards.forEach(card => {
                const name = card.getAttribute('name').toLowerCase();
                const category = card.getAttribute('category').toLowerCase();
                
                if (name.includes(searchTerm) || category.includes(searchTerm)) {
                    card.style.display = 'block';
                    setTimeout(() => {
                        card.style.opacity = '1';
                        card.style.transform = 'scale(1)';
                    }, 10);
                } else {
                    card.style.opacity = '0';
                    card.style.transform = 'scale(0.9)';
                    setTimeout(() => {
                        card.style.display = 'none';
                    }, 300);
                }
            });
        });
    }
});

// Category filter functionality
function filterByCategory(category) {
    const softwareCards = document.querySelectorAll('software-card');
    const filterButtons = document.querySelectorAll('.filter-btn');
    
    // Update active filter button
    filterButtons.forEach(btn => {
        if (btn.dataset.category === category) {
            btn.classList.add('bg-primary', 'text-white');
            btn.classList.remove('bg-dark', 'text-gray-400');
        } else {
            btn.classList.remove('bg-primary', 'text-white');
            btn.classList.add('bg-dark', 'text-gray-400');
        }
    });
    
    // Filter cards
    softwareCards.forEach(card => {
        const cardCategory = card.getAttribute('category');
        
        if (category === 'all' || cardCategory === category) {
            card.style.display = 'block';
            setTimeout(() => {
                card.style.opacity = '1';
                card.style.transform = 'scale(1)';
            }, 10);
        } else {
            card.style.opacity = '0';
            card.style.transform = 'scale(0.9)';
            setTimeout(() => {
                card.style.display = 'none';
            }, 300);
        }
    });
}

// Download counter simulation
let downloadCount = 14287;
const downloadCounter = document.getElementById('download-counter');
if (downloadCounter) {
    setInterval(() => {
        downloadCount += Math.floor(Math.random() * 5) + 1;
        downloadCounter.textContent = downloadCount.toLocaleString();
    }, 3000);
}