Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ // Create particles for interactive canvas
+ const canvas = document.querySelector('.interactive-canvas');
+ const particles = document.querySelectorAll('.particle');
+
+ // Randomize initial particle positions
+ particles.forEach(particle => {
+ const x = Math.random() * 100;
+ const y = Math.random() * 100;
+ particle.style.left = `${x}%`;
+ particle.style.top = `${y}%`;
+ particle.style.opacity = Math.random() * 0.5 + 0.5;
+ particle.style.width = `${Math.random() * 30 + 10}px`;
+ particle.style.height = particle.style.width;
+ });
+
+ // Make particles react to mouse movement
+ canvas.addEventListener('mousemove', (e) => {
+ const rect = canvas.getBoundingClientRect();
+ const x = ((e.clientX - rect.left) / rect.width) * 100;
+ const y = ((e.clientY - rect.top) / rect.height) * 100;
+
+ particles.forEach((particle, i) => {
+ const speed = 0.1 + (i * 0.05);
+ setTimeout(() => {
+ particle.style.left = `${x + (Math.random() * 20 - 10)}%`;
+ particle.style.top = `${y + (Math.random() * 20 - 10)}%`;
+ particle.style.backgroundColor = `hsl(${Math.random() * 360}, 80%, 70%)`;
+ }, i * 100);
+ });
+ });
+
+ // Make particles react to touch on mobile
+ canvas.addEventListener('touchmove', (e) => {
+ e.preventDefault();
+ const touch = e.touches[0];
+ const rect = canvas.getBoundingClientRect();
+ const x = ((touch.clientX - rect.left) / rect.width) * 100;
+ const y = ((touch.clientY - rect.top) / rect.height) * 100;
+
+ particles.forEach((particle, i) => {
+ setTimeout(() => {
+ particle.style.left = `${x + (Math.random() * 30 - 15)}%`;
+ particle.style.top = `${y + (Math.random() * 30 - 15)}%`;
+ particle.style.backgroundColor = `hsl(${Math.random() * 360}, 80%, 70%)`;
+ }, i * 100);
+ });
+ });
+
+ // Reset button functionality
+ const resetButton = document.querySelector('.reset-button');
+ if (resetButton) {
+ resetButton.addEventListener('click', () => {
+ particles.forEach(particle => {
+ const x = Math.random() * 100;
+ const y = Math.random() * 100;
+ particle.style.left = `${x}%`;
+ particle.style.top = `${y}%`;
+ particle.style.backgroundColor = 'var(--accent)';
+ });
+ });
+ }
+ });