File size: 2,125 Bytes
d5033c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
document.addEventListener('DOMContentLoaded', function() {
    // Animation for the main CTA button
    const ctaButton = document.querySelector('.bg-primary-500');
    if (ctaButton) {
        ctaButton.classList.add('button-pulse');
        
        ctaButton.addEventListener('click', function() {
            // Simulate loading state
            this.innerHTML = '<i data-feather="loader" class="animate-spin mr-2"></i> Conjuring...';
            feather.replace();
            
            // Simulate API call
            setTimeout(() => {
                this.innerHTML = '<i data-feather="check" class="mr-2"></i> Success!';
                feather.replace();
                
                // Show notification
                showToast('Your app is being created by our AI wizards!');
                
                // Reset button after 3 seconds
                setTimeout(() => {
                    this.innerHTML = '<i data-feather="wand" class="mr-2"></i> Conjure My App';
                    feather.replace();
                    this.classList.add('button-pulse');
                }, 3000);
            }, 2000);
        });
    }
    
    // Toast notification function
    function showToast(message) {
        const toast = document.createElement('div');
        toast.className = 'fixed bottom-4 right-4 bg-gray-800 text-white px-4 py-2 rounded-lg shadow-lg border-l-4 border-secondary-500 flex items-center';
        toast.innerHTML = `
            <i data-feather="info" class="mr-2 text-secondary-500"></i>
            <span>${message}</span>
        `;
        document.body.appendChild(toast);
        feather.replace();
        
        setTimeout(() => {
            toast.remove();
        }, 5000);
    }
    
    // Dark mode toggle (if needed)
    const darkModeToggle = document.getElementById('darkModeToggle');
    if (darkModeToggle) {
        darkModeToggle.addEventListener('click', function() {
            document.documentElement.classList.toggle('dark');
            localStorage.setItem('darkMode', document.documentElement.classList.contains('dark'));
        });
    }
});