-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
105 lines (98 loc) · 3.77 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sorting visuals | Franz von der Lippe</title>
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style media="screen">
* {
font-family: "Montserrat", sans-serif;
}
body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
main {
flex: 1 0 auto;
}
input[type=range]::-webkit-slider-thumb {
background-color: red;
}
input[type=range] + .thumb {
background-color: #dedede;
}
input[type=range] + .thumb.active .value {
color: red;
}
</style>
</head>
<body class="grey darken-4 white-text">
<div class="container">
<div class="row">
<div style="text-align:center">
<a href="https://github.com/franzwilhelm/SortingVisuals">
<h3 class="white-text">Sorting visuals</h3>
<h5 class="white-text">Franz von der Lippe - 2017</h5>
</a>
</div>
<div class="center-align col s12 m6 l6">
<div class="">
<canvas id="canvas"/>
</div>
<h2 id="index">0</h2>
</div>
<div class="col s12 m6 l6">
<ul class="collapsible" data-collapsible="expandable">
<li class="grey darken-4">
<div class="collapsible-header grey darken-4"><i class="material-icons">timer</i>Speed</div>
<div class="collapsible-body">
<p class="range-field s12 m3 l3">
<input type="range" id="speed" min="1" max="50" oninput="changeSpeed(this.value)"/>
</p>
</div>
</li>
<li>
<div class="collapsible-header grey darken-4"><i class="material-icons">insert_chart</i>Random array</div>
<div class="collapsible-body">
<span>Specify length and click on a sorting algorithm below</span>
<input id="length" type="number" value="50" oninput="generate(this.value);draw();">
<div class="row">
<div class="col s12 m6 l6">
<button class="col s12 waves-effect waves-light btn red " type="button" name="button" onclick="generate();insertion()">Insertion sort</button>
</div>
<div class="col s12 m6 l6">
<button class="col s12 waves-effect waves-light btn blue" type="button" name="button" onclick="generate();inPlaceRadix()">Radix</button>
</div>
</div>
</div>
</li>
<li>
<div class="collapsible-header grey darken-4"><i class="material-icons">settings_applications</i>Custom array</div>
<div class="collapsible-body">
<div class="row">
<p class="col s12">
Enter custom sorting steps here (example: [ [3,1,2], [1,3,2], [1,2,3] ])
</p>
<div class="input-field col s12">
<textarea id="custom" class="materialize-textarea" oninput="check(this.value)"></textarea>
<label for="textarea1">Textarea</label>
<p class="red-text" id="error"></p>
<button class="btn col s12 m12 l12" type="button" name="button" onclick="custom()">Run</button>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
<script type="text/javascript" src="index.js"></script>
</body>
</html>