Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ // Animate feature icons
+ const featureIcons = document.querySelectorAll('.feature-icon svg');
+
+ featureIcons.forEach(icon => {
+ const paths = icon.querySelectorAll('path, circle, rect, polygon, line');
+ paths.forEach((path, index) => {
+ path.style.strokeDasharray = path.getTotalLength();
+ path.style.strokeDashoffset = path.getTotalLength();
+ path.style.animation = `draw 2s ${index * 0.3}s forwards`;
+ });
+ });
+
+ // Matrix grid animation
+ const matrixGrid = document.querySelector('.matrix-grid');
+ if (matrixGrid) {
+ const columns = Math.floor(matrixGrid.offsetWidth / 20);
+ const rows = Math.floor(matrixGrid.offsetHeight / 20);
+
+ for (let i = 0; i < columns * rows / 10; i++) {
+ const digit = document.createElement('div');
+ digit.textContent = Math.random() > 0.5 ? '1' : '0';
+ digit.style.position = 'absolute';
+ digit.style.left = `${Math.random() * 100}%`;
+ digit.style.top = `${Math.random() * 100}%`;
+ digit.style.color = `rgba(0, 255, 255, ${Math.random() * 0.5 + 0.1})`;
+ digit.style.fontSize = `${Math.random() * 10 + 10}px`;
+ digit.style.opacity = '0';
+
+ matrixGrid.appendChild(digit);
+
+ animateDigit(digit);
+ }
+ }
+
+ // Circuit animation
+ const circuit = document.querySelector('.circuit-animation');
+ if (circuit) {
+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ svg.setAttribute('width', '100%');
+ svg.setAttribute('height', '100%');
+ circuit.appendChild(svg);
+
+ const colors = ['#00ffff', '#ff00ff', '#ffff00', '#ff8800'];
+
+ for (let i = 0; i < 10; i++) {
+ const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+ const points = generateRandomPath(
+ Math.random() * circuit.offsetWidth,
+ Math.random() * circuit.offsetHeight,
+ 10
+ );
+
+ path.setAttribute('d', points);
+ path.setAttribute('fill', 'none');
+ path.setAttribute('stroke', colors[Math.floor(Math.random() * colors.length)]);
+ path.setAttribute('stroke-width', '1');
+ path.setAttribute('stroke-dasharray', '5,5');
+
+ svg.appendChild(path);
+
+ animatePath(path);
+ }
+ }
+ });
+
+ function animateDigit(digit) {
+ let opacity = 0;
+ let yPos = parseFloat(digit.style.top);
+
+ const fadeIn = setInterval(() => {
+ opacity += 0.05;
+ digit.style.opacity = opacity;
+
+ if (opacity >= 1) {
+ clearInterval(fadeIn);
+ const fall = setInterval(() => {
+ yPos += 0.5;
+ digit.style.top = `${yPos}%`;
+
+ if (yPos > 100) {
+ digit.style.top = '-10%';
+ yPos = -10;
+ digit.textContent = Math.random() > 0.5 ? '1' : '0';
+ }
+ }, 50);
+ }
+ }, 100);
+ }
+
+ function generateRandomPath(startX, startY, segments) {
+ let path = `M${startX},${startY}`;
+ let x = startX;
+ let y = startY;
+
+ for (let i = 0; i < segments; i++) {
+ const segmentType = Math.random() > 0.5 ? 'L' : 'Q';
+
+ if (segmentType === 'L') {
+ x += Math.random() * 100 - 50;
+ y += Math.random() * 50;
+ path += `L${x},${y}`;
+ } else {
+ const cp1x = x + Math.random() * 100 - 50;
+ const cp1y = y + Math.random() * 100 - 50;
+ x += Math.random() * 100 - 50;
+ y += Math.random() * 100 - 50;
+ path += `Q${cp1x},${cp1y} ${x},${y}`;
+ }
+ }
+
+ return path;
+ }
+
+ function animatePath(path) {
+ const length = path.getTotalLength();
+ path.style.strokeDasharray = length;
+ path.style.strokeDashoffset = length;
+
+ let offset = length;
+ const animation = setInterval(() => {
+ offset -= 5;
+ path.style.strokeDashoffset = offset;
+
+ if (offset <= -length) {
+ offset = length;
+ }
+ }, 50);
+ }
+
+ // Add CSS animations
+ const style = document.createElement('style');
+ style.textContent = `
+ @keyframes draw {
+ to {
+ stroke-dashoffset: 0;
+ }
+ }
+
+ @keyframes pulse {
+ 0%, 100% {
+ opacity: 0.5;
+ }
+ 50% {
+ opacity: 1;
+ }
+ }
+ `;
+ document.head.appendChild(style);