Changed around line 1
+ const canvas = document.getElementById('matrixCanvas');
+ const ctx = canvas.getContext('2d');
+
+ canvas.width = window.innerWidth;
+ canvas.height = window.innerHeight;
+
+ const letters = 'ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZ';
+ const lettersArray = letters.split('');
+
+ const fontSize = 14;
+ const columns = canvas.width / fontSize;
+
+ const drops = [];
+ for (let i = 0; i < columns; i++) {
+ drops[i] = Math.floor(Math.random() * canvas.height);
+ }
+
+ function drawMatrix() {
+ ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
+ 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 = lettersArray[Math.floor(Math.random() * lettersArray.length)];
+ ctx.fillText(text, i * fontSize, drops[i] * fontSize);
+
+ if (drops[i] * fontSize > canvas.height && Math.random() > 0.975) {
+ drops[i] = 0;
+ }
+
+ drops[i]++;
+ }
+ }
+
+ function animatePhrase() {
+ const phrase = document.getElementById('phraseOfTheDay');
+ const text = 'Phrase of the Day';
+ let index = 0;
+
+ const interval = setInterval(() => {
+ phrase.textContent = text.slice(0, index);
+ index++;
+
+ if (index > text.length) {
+ clearInterval(interval);
+ }
+ }, 100);
+ }
+
+ function resizeCanvas() {
+ canvas.width = window.innerWidth;
+ canvas.height = window.innerHeight;
+ }
+
+ window.addEventListener('resize', resizeCanvas);
+
+ setInterval(drawMatrix, 50);
+ setTimeout(animatePhrase, 1000);