File size: 2,342 Bytes
0caad2f
d302083
 
 
 
0caad2f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d302083
 
83e14b4
d302083
0caad2f
 
83e14b4
 
 
 
 
 
 
 
 
 
d302083
0caad2f
 
 
83e14b4
 
 
0caad2f
83e14b4
 
 
d302083
 
0caad2f
83e14b4
 
 
 
 
 
 
0caad2f
 
 
 
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

document.addEventListener('DOMContentLoaded', function() {
    // Format currency cells
    document.querySelectorAll('td').forEach(cell => {
        if (cell.textContent.includes(',')) {
            const value = parseFloat(cell.textContent.replace(/,/g, ''));
            
            // Format as currency
            cell.textContent = new Intl.NumberFormat('fr-FR', {
                style: 'currency',
                currency: 'EUR',
                minimumFractionDigits: 0,
                maximumFractionDigits: 0
            }).format(value).replace('€', '') + ' €';
            
            // Color coding based on value
            if (value > 200000) {
                cell.classList.add('cell-danger');
            } else if (value > 100000) {
                cell.classList.add('cell-warning');
            } else {
                cell.classList.add('cell-positive');
            }
        }
    });
    // Modern hover effects and click events for rows
    document.querySelectorAll('tbody tr').forEach(row => {
        row.style.cursor = 'pointer';
        
        row.addEventListener('mouseenter', function() {
            this.style.transform = 'translateY(-2px)';
            this.style.boxShadow = '0 4px 12px rgba(59, 130, 246, 0.1)';
        });
        
        row.addEventListener('mouseleave', function() {
            this.style.transform = '';
            this.style.boxShadow = '';
        });
        
        row.addEventListener('click', function() {
            const projectId = this.querySelector('td:first-child').textContent;
            console.log('Navigating to project detail:', projectId);
            
            // Modern visual feedback
            this.style.transform = 'scale(0.99)';
            this.style.boxShadow = '0 0 0 2px rgba(59, 130, 246, 0.3)';
            setTimeout(() => {
                this.style.transform = '';
                this.style.boxShadow = '';
            }, 200);
        });
    });

    // Add subtle animation to table headers
    document.querySelectorAll('thead th').forEach((th, index) => {
        th.style.opacity = '0';
        th.style.transform = 'translateY(-10px)';
        th.style.animation = `fadeInUp 0.4s ease-out ${index * 0.05}s forwards`;
    });
// Initialize Feather icons
    if (feather) {
        feather.replace();
    }
});