File size: 1,562 Bytes
5233391
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
document.addEventListener('DOMContentLoaded', function() {
    // Simulate calculation
    const calculateBtn = document.querySelector('button');
    
    if(calculateBtn) {
        calculateBtn.addEventListener('click', function() {
            // Generate random price between 300 and 1200
            // Convert to Tunisian Dinar (TND) with realistic range
            const randomPrice = Math.floor(Math.random() * (4000 - 1000 + 1)) + 1000;
// Create result element
            const resultDiv = document.createElement('div');
            resultDiv.className = 'mt-6 p-4 bg-blue-50 rounded-lg border border-blue-200';
            resultDiv.innerHTML = `
                <h3 class="text-lg font-bold text-blue-800 mb-2">Estimation de votre tarif</h3>
                <p class="text-gray-700 mb-2">Votre tarif estimé est de :</p>
                <p class="text-3xl font-bold text-blue-600">${randomPrice}€/an</p>
                <p class="text-sm text-gray-500 mt-2">Ce tarif est une estimation et peut varier selon votre profil.</p>
                <button class="mt-4 bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition duration-200">
                    <i data-feather="phone" class="mr-2"></i> Contactez un conseiller
                </button>
            `;
            
            // Insert after the form
            const formSection = document.querySelector('section');
            formSection.appendChild(resultDiv);
            
            // Refresh icons
            feather.replace();
        });
    }
});