-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
68 lines (64 loc) · 2.82 KB
/
index.html
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<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">
<title>Algo Visualizer</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id = "inputSection">
<section>
<label for="nums">Enter nums:</label>
<div style="position: relative;height: 56px">
<input type="range" min = "10" max = "1000" id= "range" value = "35" oninput="updateView();updateInput()"/>
<div id="rangeSelector">
<div id = "selectorBtn"></div>
<div id = "rangeDisplayer"></div>
</div>
</div>
<script>
updateView()
function updateView(){
var slider = document.getElementById("range")
var selector = document.getElementById("rangeSelector")
var display = document.getElementById("rangeDisplayer")
selector.style.left = (slider.value - 10)/990 * 100 + '%';
display.innerHTML = slider.value
}
</script>
</section>
<section>
<label for="type" >Sorting type</label>
<select class ="select" name = "sortingType" id = "sortingType" oninput="updateInput()">
<option value = "selection" selected>Selection Sort</option>
<option value = "bubble">Bubble Sort</option>
<option value = "insertion">Insertion Sort</option>
<option value = "merge">Merge Sort</option>
<option value = "quick" >Quick Sort</option>
<option value = "comb" >Comb Sort</option>
<option value = "counting">Counting Sort</option>
<option value = "radix">Radix Sort</option>
<option value = "cyclic" selected>Cyclic Sort</option>
</select>
</section>
<section>
<button id = "start" class = "button" onclick = "start()">start</button>
<button id = "randomise" class = "button" onclick = "randomise()">randomise</button>
</section>
<section>
<select class ="select" name = "visType" id = "visType" oninput="updateInput()">
<option value = "bar" selected>Bar Visualizer</option>
<option value = "point">Point Visualizer</option>
<option value = "coloredTri">colored Triangle Visualizer</option>
</select>
</section>
</div>
<canvas id="myCanvas"></canvas>
<script src="visualizer.js"></script>
<script src="algorithms.js"></script>
<script src="obj.js"></script>
<script src="main.js"></script>
</body>
</html>