-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
58 lines (57 loc) · 2.81 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sorting algorithm</title>
<script src="src/sorting.js"></script>
<link href="build.css" rel="stylesheet">
</head>
<body >
<div class="m-10 xl:grid xl:grid-cols-2 xl:justify-items-stretch w-[95%] h-full">
<div class="text-2xl">
<h1 class="text-5xl font-mono">Sorting algorithms</h1>
<div class="p-6 mt-3 grid grid-cols-1 gap-1">
<input class="border-2 border-black rounded-lg p-1" type="text" id="input" placeholder="Enter amount to sort">
<button class="p-2 px-5 bg-black text-gray-400 rounded-lg" onclick="sort()" id="start-sort-btn">Sort</button>
</div>
<div>
<h2 class="text-5xl font-mono">Stats</h2>
<div class="p-6 mt-3">
<p class="text-gray-800 font-mono">Sorting algorithm: <span id="sortingAlgorithm">Bubble sort</span></p>
<p class="text-gray-800 font-mono">Array size: <span id="arraySize">0</span></p>
<p class="text-gray-800 font-mono">Comparisons: <span id="comparisons">0</span></p>
<p class="text-gray-800 font-mono">Swaps: <span id="iterations">0</span></p>
<p class="text-gray-800 font-mono">Time: <span id="time">0</span> ms</p>
<p class="text-gray-800 font-mono">Sorted: <span id="isSorted">False</span></p>
</div>
</div>
</div>
<div class="w-full h-full" id="sorting-visualisation">
<canvas class="bg-black p-5 w-full h-full" id="canvas" width="1000" height="1000" ></canvas>
</div>
</div>
<div class="text-2xl m-10">
<h3 class="text-5xl my-5">
Further Settings
</h3>
<input class="border-2 border-black rounded-lg p-1 p-" type="text" id="speed" placeholder="time between iteration">
<select name="sorting-algorithm" id="sorting-algorithm">
<option class="text-lg" value="bubble-sort">Bubble sort</option>
<option class="text-lg" value="insertion-sort">Insertion sort</option>
<option class="text-lg" value="selection-sort">Selection sort</option>
</select>
<button class="border-2 border-black rounded-lg p-1 ml-5" onclick="updateSettings()">Update Settings</button>
</div>
<footer class="text-3xl mt-auto">
<div class="bg-black">
<div class="flex flex-row items-center justify-between py-4 ">
<p class="text-gray-400 ">© 2023 Mauritz Orlinski</p>
<div class="flex text-gray-200">
<a class="mr-4 hover:scale-110" href="https://github.com/MauritzOrlinski">GitHub</a>
<a class="mr-4 hover:scale-110" href="https://mauritzorlinski.com">mauritzorlinski.com</a>
</div>
</div>
</div>
</footer>
</body>
</html>