1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < title > Sorting algorithm</ title >
6
+ < script src ="src/sorting.js "> </ script >
7
+ < link href ="build.css " rel ="stylesheet ">
8
+ </ head >
9
+ < body >
10
+ < div class ="m-10 xl:grid xl:grid-cols-2 xl:justify-items-stretch w-[95%] h-full ">
11
+ < div class ="text-2xl ">
12
+ < h1 class ="text-5xl font-mono "> Sorting algorithms</ h1 >
13
+ < div class ="p-6 mt-3 grid grid-cols-1 gap-1 ">
14
+ < input class ="shadow-sm border-gray-300 rounded-lg m-2 focus:ring-2 focus:ring-indigo-200 focus:border-indigo-400 " type ="text " id ="input " placeholder ="Enter numbers to sort ">
15
+ < button class ="p-2 px-5 bg-black text-gray-400 " onclick ="sort() "> Sort</ button >
16
+ < button class ="p-2 px-5 bg-black text-gray-400 " onclick ="reset() "> Reset</ button >
17
+ </ div >
18
+ < div >
19
+ < h2 class ="text-5xl font-mono "> Stats</ h2 >
20
+ < div class ="p-6 mt-3 ">
21
+ < p class ="text-gray-800 font-mono "> Sorting algorithm: < span id ="sortingAlgorithm "> Bubble sort</ span > </ p >
22
+ < p class ="text-gray-800 font-mono "> Array size: < span id ="arraySize "> 0</ span > </ p >
23
+ < p class ="text-gray-800 font-mono "> Comparisons: < span id ="comparisons "> 0</ span > </ p >
24
+ < p class ="text-gray-800 font-mono "> Swaps: < span id ="iterations "> 0</ span > </ p >
25
+ < p class ="text-gray-800 font-mono "> Time: < span id ="time "> 0</ span > ms</ p >
26
+ < p class ="text-gray-800 font-mono "> Sorted: < span id ="isSorted "> False</ span > </ p >
27
+ </ div >
28
+ </ div >
29
+ </ div >
30
+ < div class ="w-full h-full " id ="sorting-visualisation ">
31
+ < canvas class ="bg-black p-5 w-full h-full " id ="canvas " width ="1000 " height ="1000 " > </ canvas >
32
+ </ div >
33
+ </ div >
34
+ < div class ="text-2xl m-10 ">
35
+ < h3 class ="text-5xl my-5 ">
36
+ Further Settings
37
+ </ h3 >
38
+ < input class ="border-black border-2 rounded-lg " type ="text " id ="speed " placeholder ="speed ">
39
+ < select name ="sorting-algorithm " id ="sorting-algorithm ">
40
+ < option class ="text-lg " value ="bubble-sort "> Bubble sort</ option >
41
+ < option class ="text-lg " value ="insertion-sort "> Insertion sort</ option >
42
+ < option class ="text-lg " value ="selection-sort "> Selection sort</ option >
43
+ </ select >
44
+ < button onclick ="updateSettings() "> Update Settings</ button >
45
+ </ div >
46
+ < footer class ="text-2xl mt-auto ">
47
+ < div class ="bg-black ">
48
+ < div class ="flex flex-row items-center justify-between py-4 ">
49
+ < p class ="text-lg text-gray-400 "> © 2023 Mauritz Orlinski</ p >
50
+ < div class ="flex text-gray-200 ">
51
+ < a class ="mr-4 hover:scale-110 " href ="https://github.com/MauritzOrlinski "> GitHub</ a >
52
+ < a class ="mr-4 hover:scale-110 " href ="https://mauritzorlinski.com "> mauritzorlinski.com</ a >
53
+ </ div >
54
+ </ div >
55
+ </ div >
56
+ </ footer >
57
+ </ body >
58
+ </ html >
0 commit comments