-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
83 lines (69 loc) · 2.64 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content=
"width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="slider.css">
</head>
<body>
<header>
<b>
Nilusche
</b>
<Nav>
<ul class="nav__links">
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
</ul>
</Nav>
</header>
<h2>Sorting Algorithms</h2>
<div class="buttoncontainer">
<button id="bubblesort">Bubblesort</button>
<button id="cocktailsort">Cocktailsort</button>
<button id="insertionsort">Insertionsort</button>
<button id="shellsort">Shellsort</button>
<button id="gnomesort">Gnomesort</button>
<button id="selectionsort">Selectionsort</button>
<button id="quicksort">Quicksort</button>
<button id="mergesort">Mergesort</button>
<button id="heapsort">Heapsort</button>
<button id="bogosort">Bogosort</button>
<div style="text-align: center;">
<label id="speed" style="color:#eee">Slow down</label>
<Input class="range" type="range" value="200" min="30" max="1000" onChange="changespeed(this.value)" onmousemove="changespeed(this.value)"></Input>
<span id="rangevalue">0</span>
</div>
<button id="reset" onclick="window.location.reload();">Reset</button>
</div>
<div id="array">
</div>
<div class="generatecontainer">
<button id="randomArray">Generate new Array</button>
<button class="none" id="sortedAsc">Set Values to sorted (ascending)</button>
<button class="none" id="sortedDesc">Set Values to sorted (descending)</button>
</div>
<script src="sorts.js"></script>
<script type="text/javascript">
let rand= document.getElementById("randomArray");
let asc = document.getElementById("sortedAsc");
let desc = document.getElementById("sortedDesc");
rand.addEventListener("click", ()=>{
generatearray(1, false);
let buttons = document.querySelectorAll(".none");
buttons.forEach((e)=>{
e.style.display="block";
})
});
asc.addEventListener("click", ()=>{
generatearray(2,true);
});
desc.addEventListener("click",()=>{
generatearray(2,false);
});
</script>
</body>
</html>