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 = ' Conjuring...';
feather.replace();
// Simulate API call
setTimeout(() => {
this.innerHTML = ' Success!';
feather.replace();
// Show notification
showToast('Your app is being created by our AI wizards!');
// Reset button after 3 seconds
setTimeout(() => {
this.innerHTML = ' 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 = `
${message}
`;
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'));
});
}
});