-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisualizations.js
More file actions
44 lines (37 loc) · 1.24 KB
/
Copy pathvisualizations.js
File metadata and controls
44 lines (37 loc) · 1.24 KB
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
40
41
42
43
44
var speed = 1000;
inp_aspeed.addEventListener("input", vis_speed);
function vis_speed() {
var array_speed = inp_aspeed.value;
switch (parseInt(array_speed)) {
case 1: speed = 1;
break;
case 2: speed = 10;
break;
case 3: speed = 100;
break;
case 4: speed = 1000;
break;
case 5: speed = 10000;
break;
}
delay_time = 10000 / (Math.floor(array_size / 10) * speed);
}
var delay_time = 10000 / (Math.floor(array_size / 10) * speed);
var c_delay = 0;
function div_update(cont, height, color) {
window.setTimeout(function () {
cont.style = " margin:0% " + margin_size + "%; width:" + (100 / array_size - (2 * margin_size)) + "%; height:" + height + "%; background-color:" + color + ";";
}, c_delay += delay_time);
}
function enable_buttons() {
window.setTimeout(function () {
for (var i = 0; i < butts_algos.length; i++) {
butts_algos[i].classList = [];
butts_algos[i].classList.add("butt_unselected");
butts_algos[i].disabled = false;
inp_as.disabled = false;
inp_gen.disabled = false;
inp_aspeed.disabled = false;
}
}, c_delay += delay_time);
}