Skip to content

Commit 95d8ef9

Browse files
committed
added debug console
1 parent 8ca0813 commit 95d8ef9

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

index.css

456 Bytes
Binary file not shown.

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010

1111
<body>
1212
<canvas id="neomatrix"></canvas>
13+
<p id="debug"></p>
1314
</body>
1415
</html>

index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ window.onload = function () {
4545
}
4646
};
4747

48+
var debug = document.getElementById("debug"), logs = [];
4849
var fpsInterval, startTime, now, then, elapsed, letters, columns, rows, drops, drop_chars, trail_length = 0.05, highlight_first_character = true;
4950
var color = "0,255,0", color_mode = "0", color_animation_speed = 0, column_hue, row_hue;
5051
var char_set = "4", custom_char_set;
@@ -249,5 +250,14 @@ window.onload = function () {
249250
startTime = then;
250251
loop();
251252
}
253+
254+
function Log(text) {
255+
logs.push(text);
256+
if (logs.length > 10)
257+
logs.splice(0, 1);
258+
var tmp = "";
259+
logs.forEach(l => { tmp += l + "\n" });
260+
debug.innerText = tmp;
261+
}
252262
};
253263

0 commit comments

Comments
 (0)