-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
172 lines (171 loc) · 5.28 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1NWJDVHN40"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-1NWJDVHN40');
</script>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
/>
<link rel="icon" href="/favicon.png" />
<link rel="stylesheet" href="css/style.css" />
<script>
// const barpurple = "#7952b3";
const barpurple = "#D62AD0"; // original color
const merge_left_color = "#FF6701"; // left half of merging array.
const merge_right_color = "#FFC107";
// const intermediate_sorted_color = "lightgreen";
const intermediate_sorted_color = "#66DE93";
// when one ele is compared against other eles
// used in selection and insetion sort.
const comparing_ele_color = "#00EAD3";
const traverse_color = "lightblue";
const sorted_color = "green";
</script>
<script src="js/utility.js" async></script>
<script src="js/bubble.js" async></script>
<script src="js/insert.js" async></script>
<script src="js/selection.js" async></script>
<script src="js/merge.js" async></script>
<script src="js/quick.js" async></script>
<script src="js/main.js" defer></script>
<title>Algo Visualizer</title>
</head>
<body>
<div class="p-3">
<nav>
<h3 class="text-white text-center">Algo Visualizer 🔮</h3>
<div class="ip-container">
<div class="me-3">
<label for="size_input" class="ip_label">Array Size ↔️</label>
<br />
<input
type="range"
name="array_size"
id="size_input"
min="10"
max="150"
value="60"
/>
</div>
<div class="me-3">
<label for="speed_input" class="ip_label">Speed ⚡</label>
<br />
<input
type="range"
name="delay"
id="speed_input"
min="0"
max="150"
value="50"
/>
</div>
<button
type="button"
id="new-arraybtn"
class="btn btn-dark btn-outline-success border border-info me-3"
>
New Array
</button>
<button
type="button"
id="resetbtn"
class="btn btn-dark btn-outline-info me-3"
>
Reset Array
</button>
</div>
<div class="srtbtn-container">
<button
type="button"
class="btn btn-dark srtbtn"
id="bubbleSort"
data-sort-name="bubble"
>
Bubble Sort
</button>
<button
type="button"
class="btn btn-dark srtbtn"
id="insertSort"
data-sort-name="insert"
>
Insertion Sort
</button>
<button
type="button"
class="btn btn-dark srtbtn"
id="selectionSort"
data-sort-name="select"
>
Selection Sort
</button>
<button
type="button"
class="btn btn-dark srtbtn"
id="mergeSort"
data-sort-name="merge"
>
Merge Sort
</button>
<button
type="button"
class="btn btn-dark srtbtn"
id="quickSort"
data-sort-name="quick"
>
Quick Sort
</button>
<button
type="button"
class="btn btn-dark srtbtn"
id="randomQuickSort"
data-sort-name="randquick"
>
Random Quick Sort
</button>
</div>
</nav>
<div id="viz-board">
<div id="srt-status" class="invisible">
<div>
<div>
No. of Comparison:
<span id="ncomp" class="badge bg-light text-dark">0</span>
</div>
<div>
No. of Swap:
<span id="nswap" class="badge bg-light text-dark">0</span>
</div>
<small id="mgsrt-info" class="d-none"
>(not-in-place, no swapping!)</small
>
</div>
</div>
<div id="array-container"></div>
<!-- <div id="srt-info">Time Complexity</div> -->
<div id="srt-info"></div>
</div>
</div>
</body>
</html>