Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ const greetButton = document.getElementById('greet-button');
+ const nameInput = document.getElementById('name-input');
+ const greetingOutput = document.getElementById('greeting-output');
+
+ greetButton.addEventListener('click', function() {
+ const name = nameInput.value.trim();
+ if (name) {
+ greetingOutput.textContent = `Hello, ${name}!`;
+ greetingOutput.classList.add('show');
+
+ // Create confetti effect
+ for (let i = 0; i < 50; i++) {
+ createConfetti();
+ }
+ } else {
+ greetingOutput.textContent = 'Please enter your name';
+ greetingOutput.classList.add('show');
+ }
+ });
+
+ function createConfetti() {
+ const confetti = document.createElement('div');
+ confetti.style.position = 'fixed';
+ confetti.style.width = '10px';
+ confetti.style.height = '10px';
+ confetti.style.backgroundColor = getRandomColor();
+ confetti.style.borderRadius = '50%';
+ confetti.style.left = Math.random() * window.innerWidth + 'px';
+ confetti.style.top = '-10px';
+ confetti.style.zIndex = '1000';
+ document.body.appendChild(confetti);
+
+ const animation = confetti.animate([
+ { top: '-10px', opacity: 1 },
+ { top: window.innerHeight + 'px', opacity: 0 }
+ ], {
+ duration: Math.random() * 3000 + 2000,
+ easing: 'cubic-bezier(0.1, 0.8, 0.9, 1)'
+ });
+
+ animation.onfinish = () => confetti.remove();
+ }
+
+ function getRandomColor() {
+ const colors = [
+ '#5e35b1', '#3949ab', '#1e88e5', '#039be5',
+ '#00acc1', '#00897b', '#43a047', '#7cb342',
+ '#fdd835', '#ffb300', '#fb8c00', '#f4511e'
+ ];
+ return colors[Math.floor(Math.random() * colors.length)];
+ }
+
+ // Animate features on scroll
+ const observer = new IntersectionObserver((entries) => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ entry.target.style.opacity = 1;
+ entry.target.style.transform = 'translateY(0)';
+ }
+ });
+ }, { threshold: 0.1 });
+
+ document.querySelectorAll('.feature-card').forEach(card => {
+ card.style.opacity = 0;
+ card.style.transform = 'translateY(20px)';
+ card.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
+ observer.observe(card);
+ });
+ });