This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const draw = () => { | |
context.fillStyle = 'rgba(0, 0, 0, 0.05)'; | |
context.fillRect(0, 0, canvas.width, canvas.height); | |
context.fillStyle = '#0F0'; | |
context.font = fontSize + 'px monospace'; | |
for(let i = 0; i < rainDrops.length; i++) | |
{ | |
const text = alphabet.charAt(Math.floor(Math.random() * alphabet.length)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="./styles.css"> | |
<title>Matrix digital rain</title> | |
</head> | |
<body> | |
<canvas id="Matrix"></canvas> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const draw = () => { | |
context.fillStyle = 'rgba(0, 0, 0, 0.05)'; | |
context.fillRect(0, 0, canvas.width, canvas.height); | |
context.fillStyle = '#0F0'; | |
context.font = fontSize + 'px monospace'; | |
for(let i = 0; i < rainDrops.length; i++) | |
{ | |
const text = alphabet.charAt(Math.floor(Math.random() * alphabet.length)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
background: black; | |
height: 100%; | |
overflow: hidden; | |
} | |
body { | |
margin: 0; | |
padding: 0; | |
height: 100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isMagic = (num) => { | |
if (num === 1){ | |
return true; | |
} else if (num.toString().length === 1){ | |
return false; | |
} | |
const numArr = num.toString().split(''); | |
const digitSum = numArr.reduce((acc, currentValue) => { | |
return parseInt(acc) + parseInt(currentValue); | |
}); |