File size: 2,979 Bytes
034f264
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
document.addEventListener('DOMContentLoaded', function() {
    // Color selection
    const colorOptions = document.querySelectorAll('.color-option');
    const previewTitle = document.querySelector('.preview-title');
    
    colorOptions.forEach(option => {
        option.addEventListener('click', function() {
            const color = this.getAttribute('data-color');
            
            // Remove all color classes from title
            previewTitle.classList.remove('text-green-500', 'text-blue-500', 'text-indigo-500', 'text-teal-500');
            
            // Add selected color class
            previewTitle.classList.add(`text-${color}-500`);
            
            // Update generate button color
            const generateBtn = document.getElementById('generate-btn');
            generateBtn.classList.remove('bg-green-500', 'hover:bg-green-600', 
                                        'bg-blue-500', 'hover:bg-blue-600',
                                        'bg-indigo-500', 'hover:bg-indigo-600',
                                        'bg-teal-500', 'hover:bg-teal-600');
            generateBtn.classList.add(`bg-${color}-500`, `hover:bg-${color}-600`);
        });
    });
    
    // Theme selection
    const themeBtns = document.querySelectorAll('.theme-btn');
    const previewContainer = document.querySelector('.preview-container');
    
    themeBtns.forEach(btn => {
        btn.addEventListener('click', function() {
            const theme = this.getAttribute('data-theme');
            
            // Reset all theme classes
            previewContainer.classList.remove('bg-white', 'border-gray-200',
                                            'bg-gray-800', 'border-gray-700',
                                            'bg-gray-100', 'border-gray-300');
            
            // Apply selected theme
            if (theme === 'light') {
                previewContainer.classList.add('bg-white', 'border-gray-200');
            } else if (theme === 'dark') {
                previewContainer.classList.add('bg-gray-800', 'border-gray-700');
            } else if (theme === 'minimal') {
                previewContainer.classList.add('bg-gray-100', 'border-gray-300');
            }
        });
    });
    
    // Generate PDF button
    const generateBtn = document.getElementById('generate-btn');
    generateBtn.addEventListener('click', function() {
        // Simulate PDF generation
        this.innerHTML = '<i data-feather="loader" class="animate-spin mr-2"></i> Generating...';
        
        setTimeout(() => {
            this.innerHTML = '<i data-feather="check" class="mr-2"></i> PDF Ready!';
            feather.replace();
            
            // Reset button after 2 seconds
            setTimeout(() => {
                this.innerHTML = '<i data-feather="download" class="mr-2"></i> Generate PDF Presentation';
                feather.replace();
            }, 2000);
        }, 2000);
    });
});