-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
243 lines (243 loc) · 6.03 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="p5.min.js"></script>
<script src="addons/p5.dom.min.js"></script>
<script src="addons/p5.sound.min.js"></script>
<script src="sketch.js"></script>
<script src="sortingAlgorithms.js"></script>
<script src="utils.js"></script>
<!--<script src="stopwatch.js"></script>-->
<style>
/*class description*/
.description{
position: absolute;
left: 5px;
top: 355px;
width: 320px;
background: #fff;
color: #000;
font-family: Helvetica;
font-weight: bolder;
font-size: 15px;
border: solid 3px #000;
z-index: 1;
padding: 5px 5px 3px 5px;
}
/*.description txt{
background: #fff;
}
/*class stopwatch*/
.stpwatch{
position: absolute;
left: 5px;
top: 305px;
background: #fff;
color: #000;
font-family: Helvetica;
font-weight: bolder;
font-size: 20px;
border: solid 3px #000;
cursor: ne-resize;
z-index: 1;
padding: 5px 5px 3px 5px;
}
/*class array text*/
.array{
text-align: justify;
width: 100%;
font-family: monospace;
font-size: 10px;
}
.waves{
position:fixed;
top: 55px;
left: 5px;
background: #fff;
color: #000;
padding: 0px;
font-family: Helvetica;
font-weight: bolder;
font-size: 20px;
border: none;
cursor: ne-resize;
z-index: 1;
}
/*class kernel*/
.sorting{
position:fixed;
top: 5px;
left: 5px;
background: #fff;
color: #000;
padding: 0px;
font-family: Helvetica;
font-weight: bolder;
font-size: 20px;
border: none;
cursor: ne-resize;
z-index: 1;
}
.inputRange{
position: absolute;
left: 185px;
background: #fff;
color: #000;
font-family: Helvetica;
font-weight: bolder;
font-size: 20px;
border: solid 3px #000;
cursor: ne-resize;
z-index: 1;
padding: 5px;
}
.top{
position: absolute;
left: 185px;
top: 105px;
background: #fff;
color: #000;
font-family: Helvetica;
font-weight: bolder;
font-size: 15px;
border: solid 3px #000;
cursor: ne-resize;
z-index: 1;
padding: 5px 5px 3px 5px;
}
.middle{
position: absolute;
left: 185px;
top: 155px;
background: #fff;
color: #000;
font-family: Helvetica;
font-weight: bolder;
font-size: 15px;
border: solid 3px #000;
cursor: ne-resize;
z-index: 1;
padding: 5px 5px 3px 5px;
}
.bottom{
position: absolute;
left: 185px;
top: 205px;
background: #fff;
color: #000;
font-family: Helvetica;
font-weight: bolder;
font-size: 15px;
border: solid 3px #000;
cursor: ne-resize;
z-index: 1;
padding: 5px 5px 3px 5px;
}
body{
margin: 0;
}
/*styling the select element*/
select {
font-family: Helvetica;
font-weight: bolder;
font-size: 20px;
padding-top: 3px;
padding-right: 3px;
}
select:hover{
color: #000;
background-color: #fff;
}
select:not([multiple]){
-webkit-appearance:none;
-moz-appearance:none;
border: solid 3px #000;
}
/*styling the single entries of the list*/
option{
border: solid 1px #000;
font-size: 15px;
padding-top: 3px;
}
option:hover{
letter-spacing: 5px;
}
input{
top: 105px;
left: 5px;
background: #fff;
position: absolute;
width: 150px;
border: solid 3px #000;
height: 20px;
float: left;
}
/*styling buttons*/
button{
position: absolute;
left: 5px;
background-color: #fff;
border: solid 3px #000;
font-family: Helvetica;
font-weight: bolder;
font-size: 20px;
padding-top: 3px;
}
blockquote{
font-style: italic;
font-size: 13px;
}
a{
color: #f00;
border-bottom: none;
}
a:hover{
letter-spacing: 3px;
}
</style>
</head>
<body bgcolor="#FFF">
<div class="sorting">
<select id="kernel" onchange="initSorting()">
<option value="0" selected>BUBBLE SORT</option>
<option value="1">SELECTION SORT</option>
<option value="2">INSERTION SORT</option>
<option value="3">MERGE SORT</option>
<option value="4">QUICK SORT</option>
<option value="5">SHELL SORT</option>
<option value="6">RADIX SORT</option>
<option value="7">COUNTING SORT</option>
</select>
</div>
<div class="waves">
<select id="waveForm" onchange="setWave()">
<option value="0" selected>SINE WAVE</option>
<option value="1">TRIANGLE</option>
<option value="2">SAWTOOTH</option>
<option value="3">SQUARE</option>
</select>
</div>
<div>
<input type="range" id="arraySize" value="50" min="20" max="200" step="1" onchange="resizeArray()">
<input type="range" style="top: 155px" id="timeWarp" value="1" min="-10" max="10" step="1" onchange="timeWarp()">
<input type="range" style="top: 205px" id="alpha" value="15" min="5" max="255" step="5" onchange="changeAlpha()">
<button type="button" style="top: 255px;" id="playPause" onclick="playPause()">PLAY</button>
</div>
<div class="top" id="theArraySize">ARRAY SIZE: 50</div>
<div class="middle" id="time">SPEED: 1</div>
<div class="bottom" id="alphaChannel">ALPHA: 15</div>
<div class="stpwatch" id="time2">00:00:00:000</div>
<div class="description">
<txt>AlgorhythmicSorting WEB application
<blockquote>
AlgorhythmicSorting is an open source program and learning tool for people, who want to learn and analyze the diversity of sorting algorithms by hearing the different rhythmic and pattern generating behaviour of different sorting algorithms like bubble sort, merge sort, quick sort or heap sort and others. It shall be used by students, sound artists, researchers and hobbyists to learn the rhythmic basics of algorithms.
</blockquote>
Based on the work of <a href="http://shintaro-miyazaki.com/?work=algorhythmicsorting"> Shintaro Miyazaki</a> this web applications shows the behaviour of different sorting algorithms on a random list of numbers. The web application has been written in <a href="https://p5js.org">p5.js</a>, a JavaScript library similar to <a href="https://processing.org">Processing</a>.<br><br>
<a href="https://github.com/atomicCoders/SortingSound">FORK ME ON GITHUB</a></txt>
</div>
<!--<input type="button" style="top: 305px;" value="start" onclick="start();">
<input type="button" style="top: 355px;" value="stop" onclick="stop()">
<input type="button" style="top: 405px;" value="reset" onclick="reset()">-->
</body>
</html>