Below is a **complete, production‑ready blueprint** that you can copy‑paste, run locally, and later ship to the cloud.
d5033c9
verified
| 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')); | |
| }); | |
| } | |
| }); |