Spaces:
Running
Running
File size: 1,260 Bytes
f853e9d |
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 |
document.addEventListener('DOMContentLoaded', function() {
// Add floating animation to random elements
const elements = document.querySelectorAll('.floating-element');
elements.forEach(el => {
el.classList.add('floating');
el.style.animationDelay = `${Math.random() * 2}s`;
});
// Add pulse animation to interactive elements
const interactiveElements = document.querySelectorAll('.pulse-element');
interactiveElements.forEach(el => {
el.classList.add('pulsing');
});
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Form submission handler
const form = document.querySelector('form');
if (form) {
form.addEventListener('submit', function(e) {
e.preventDefault();
// Here you would typically send the form data to a server
alert('Thank you for planting your idea! It will grow in our garden soon.');
form.reset();
});
}
}); |