Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ // Terminal typing effect for headlines
+ const headlines = document.querySelectorAll('h1');
+ headlines.forEach(headline => {
+ const text = headline.textContent;
+ headline.textContent = '';
+ let i = 0;
+ const typing = setInterval(() => {
+ if (i < text.length) {
+ headline.textContent += text.charAt(i);
+ i++;
+ } else {
+ clearInterval(typing);
+ }
+ }, 100);
+ });
+
+ // Matrix-style background effect
+ const canvas = document.createElement('canvas');
+ canvas.style.position = 'fixed';
+ canvas.style.top = '0';
+ canvas.style.left = '0';
+ canvas.style.zIndex = '-1';
+ canvas.style.opacity = '0.1';
+ document.body.appendChild(canvas);
+
+ const ctx = canvas.getContext('2d');
+ canvas.width = window.innerWidth;
+ canvas.height = window.innerHeight;
+
+ const matrix = '01';
+ const drops = [];
+ const fontSize = 10;
+ const columns = canvas.width/fontSize;
+
+ for(let x = 0; x < columns; x++)
+ drops[x] = 1;
+
+ function draw() {
+ ctx.fillStyle = 'rgba(0, 0, 0, 0.04)';
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
+ ctx.fillStyle = '#0F0';
+ ctx.font = fontSize + 'px monospace';
+
+ for(let i = 0; i < drops.length; i++) {
+ const text = matrix.charAt(Math.floor(Math.random() * matrix.length));
+ ctx.fillText(text, i*fontSize, drops[i]*fontSize);
+ if(drops[i]*fontSize > canvas.height && Math.random() > 0.975)
+ drops[i] = 0;
+ drops[i]++;
+ }
+ }
+
+ setInterval(draw, 35);
+ });