-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatrix.html
More file actions
39 lines (35 loc) · 902 Bytes
/
Copy pathmatrix.html
File metadata and controls
39 lines (35 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
margin: 0;
overflow: hidden;
}
</style>
</head>
<body>
<canvas id=q></canvas>
<script>
const s = window.screen;
const w = (q.width = s.width);
const h = (q.height = s.height);
const ctx = q.getContext("2d");
const p = Array(Math.floor(w / 10) + 1).fill(0);
const random = (items) => items[Math.floor(Math.random() * items.length)];
const hex = "0123456789ABCDEF".split("");
setInterval(() => {
ctx.fillStyle = "rgba(0,0,0,.05)";
ctx.fillRect(0, 0, w, h);
ctx.fillStyle = "#0f0";
p.map((v, i) => {
ctx.fillText(random(hex), i * 10, v);
p[i] = v >= h || v > 50 + 10000 * Math.random() ? 0 : v + 10;
});
}, 1000 / 30);
</script>
</body>
</html>