Spaces:
Running
Running
File size: 1,180 Bytes
bf865b4 | 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 | document.addEventListener('DOMContentLoaded', function() {
// Initialize animations
const animateElements = document.querySelectorAll('.animate-fade-in');
animateElements.forEach((el, index) => {
el.style.animationDelay = `${index * 0.1}s`;
});
// Newsletter form handling
const newsletterForm = document.querySelector('form');
if (newsletterForm) {
newsletterForm.addEventListener('submit', function(e) {
e.preventDefault();
const email = this.querySelector('input[type="email"]').value;
// Here you would typically send the email to your backend
alert('Thanks for subscribing! Check your email for confirmation.');
this.reset();
});
}
// Product card interactions
const productCards = document.querySelectorAll('.product-card');
productCards.forEach(card => {
card.addEventListener('mouseenter', function() {
this.querySelector('img').style.transform = 'scale(1.05)';
});
card.addEventListener('mouseleave', function() {
this.querySelector('img').style.transform = 'scale(1)';
});
});
}); |