Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <style>
- /*basic reset */
- *{
- margin: 0;
- padding: 0;
- }
- body {background: black;}
- canvas {display:block;}
- </style>
- </head>
- <body>
- <canvas id="c"></canvas>
- <script>
- // geting canvas by id c
- var c = document.getElementById("c");
- var ctx = c.getContext("2d");
- //making the canvas full screen
- c.height = window.innerHeight;
- c.width = window.innerWidth;
- var matrix = "`1234567890-=!@#$%^&*()_+qwertyuiop[]asdfghjkl;'zxcvbnm,./QWERTYUIOPASDFGHJKLZXCVBNM<>?;'\"\\|~";
- matrix = matrix.split("");
- var font_size = 10;
- var columns = c.width/font_size;
- var drops = [];
- for(var x = 0; x < columns; x++)
- drops[x] = 1;
- function draw()
- {
- ctx.fillStyle = "rgba(0, 0, 0, 0.04)";
- ctx.fillRect(0, 0, c.width, c.height);
- ctx.fillStyle = "#FF8000";
- ctx.font = font_size + "px arial";
- for(var i = 0; i < drops.length; i++)
- {
- var text = matrix[Math.floor(Math.random()*matrix.length)];
- ctx.fillText(text, i*font_size, drops[i]*font_size);
- if(drops[i]*font_size > c.height && Math.random() > 0.975)
- drops[i] = 0;
- drops[i]++;
- }
- }
- setInterval(draw, 35);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement