-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
272 lines (229 loc) · 9.09 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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Seismokraft</title>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCJe8gm6aPqX280tYK6yCjms2NgA_fUzh0&sensor=false"
type="text/javascript"></script>
<!--<script type="text/javascript" src="jqueryStyle/js/jquery-ui-1.10.3.custom.min.js"></script>-->
<script language="javascript" type="text/javascript">
var processorURL = "AudioProcessor.php";
var LENGTHMIN = 400;
var LENGTHMAX = 12000;
var MINMAGMIN = 3.0;
var MINMAGMAX = 10.0;
var MAXMAGMIN = 3.0;
var MAXMAGMAX = 10.0;
var MAGMINSPREAD = 1.0;
var length = 8000;
var minMag = 5.5;
var maxMag = 9.0;
var ev1idx = 0;
var ev2idx = 2;
var ev3idx = 5;
$(document).ready(function () {
$('#seismokraftApp').load("AudioProcessor.php", function () {
$("#loadingPrompt").fadeOut(400, function () {
$("#loadingPrompt").hide();
});
});
});
changeLength = function(element) {
var lengthLabel = document.getElementById('length_status');
var x = parseFloat(element.value) / parseFloat(element.max);
length = x * (LENGTHMAX - LENGTHMIN) + LENGTHMIN;
lengthLabel.innerHTML = length.toFixed(0) + " samples"
};
changeMinMag = function (element) {
var minmagLabel = document.getElementById('minmag_status');
var maxmagLabel = document.getElementById('maxmag_status');
var maxMagSlider = document.getElementById('maxmag_slider');
var x = parseFloat(element.value) / parseFloat(element.max);
minMag = x * (MINMAGMAX - MINMAGMIN) + MINMAGMIN;
if (maxMag < (minMag + MAGMINSPREAD)) {
maxMag = minMag + MAGMINSPREAD;
maxMagSlider.value = ((maxMag - MAXMAGMIN)/ (MAXMAGMAX-MAXMAGMIN))*element.max;
}
minmagLabel.innerHTML = minMag.toFixed(1);
maxmagLabel.innerHTML = maxMag.toFixed(1);
};
changeMaxMag = function (element) {
var minmagLabel = document.getElementById('minmag_status');
var maxmagLabel = document.getElementById('maxmag_status');
var minMagSlider = document.getElementById('minmag_slider');
var x = parseFloat(element.value) / parseFloat(element.max);
maxMag = x * (MAXMAGMAX - MAXMAGMIN) + MAXMAGMIN;
if (minMag > maxMag - MAGMINSPREAD) {
minMag = maxMag - MAGMINSPREAD;
minMagSlider.value = ((minMag - MINMAGMIN)/ (MINMAGMAX-MINMAGMIN))*element.max;
}
minmagLabel.innerHTML = minMag.toFixed(1);
maxmagLabel.innerHTML = maxMag.toFixed(1);
};
changeIdx = function (element, idx) {
var evLabel;
if (idx == 1) {
evLabel = document.getElementById('ev1_status');
ev1idx = element.value;
evLabel.innerHTML = ev1idx;
}
if (idx == 2) {
evLabel = document.getElementById('ev2_status');
ev2idx = element.value;
evLabel.innerHTML = ev2idx;
}
if (idx == 3) {
evLabel = document.getElementById('ev3_status');
ev3idx = element.value;
evLabel.innerHTML = ev3idx;
}
}
reloadProcessor = function () {
var newURL = processorURL + "?min_mag=" + minMag.toFixed(2) + "&max_mag=" + maxMag.toFixed(2) + "&ev1=" +
ev1idx + "&ev2=" + ev2idx + "&ev3=" + ev3idx + "&length=" + length.toFixed(0);
if(typeof audio !== 'undefined') if(audio.isPlaying) audio.togglePlayback();
$('#seismokraftApp').load("loadingPrompt.html", function() {
$('#applicationWindow').fadeOut(400, function() {
$('#seismokraftApp').empty();
});
});
$('#seismokraftApp').load(newURL, function () {
$("#loadingPrompt").fadeOut(400, function () {
$("#seismokraftApp").empty();
});
});
}
</script>
<style type="text/css">
body {
background-color: #202525;
}
#container {
background-color: #6D6D6D;
margin-top: 0;
margin-bottom: 0;
padding-top: 10px;
padding-right: 0;
padding-bottom: 20px;
padding-left: 0;
border-radius: 10px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
#footer {
text-align: right;
padding-right: 5px;
text-decoration: none;
color: #CCCCCC;
}
a {
text-decoration: none;
color: #CC2222;
}
a:hover {
color: #FF9999;
}
#title {
font-size: 36px;
font-weight: bold;
text-transform: uppercase;
color: #CCCC99;
letter-spacing: 1.5em;
text-align: center;
}
#loadingPrompt {
font-size: 16px;
color: #CCCC99;
letter-spacing: 0.2em;
text-align: center;
}
#seismokraftApp {
vertical-align: middle;
width: 95%;
padding-top: 30px;
padding-right: 1%;
padding-bottom: 30px;
padding-left: 1%;
}
#queryParams {
vertical-align: middle;
width: 93%;
padding-top: 30px;
padding-right: 1%;
padding-bottom: 30px;
padding-left: 1%;
margin-left: 1%;
margin-right: 1%;
background-color: #AAAA77;
border-radius: 5px;
}
</style>
<link href="seismokraft.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p> </p>
<p> </p>
<div id="container">
<p> </p>
<div id="title">seismokraft</div>
<p> </p>
<div id="seismokraftApp">
<div id="loadingPrompt">
<p>Fetching data from IRIS servers...</p>
<p><img src="images/ajax-loader.gif" width="220" height="19" alt="loader"/></p>
<p> </p>
</div>
</div>
<div id="queryParams">
<h2>GET DIFFERENT DATA</h2>
<h3>LENGTH</h3>
<div class="statusLabel" id="length_status">8000 samples</div>
<input id="length_slider" type="range" name="max_mag" min="0" step="0.01" max="100" value="0"
onchange="changeLength(this);"
oninput="changeLength(this);">
<h3>MINIMUM MAGNITUDE</h3>
<div class="statusLabel" id="minmag_status">3.0</div>
<input id="minmag_slider" type="range" name="min_mag" min="0" step="0.01" max="100" value="0"
onchange="changeMinMag(this);"
oninput="changeMinMag(this);">
<h3>MAXIMUM MAGNITUDE</h3>
<div class="statusLabel" id="maxmag_status">3.0</div>
<input id="maxmag_slider" type="range" name="max_mag" min="0" step="0.01" max="100" value="0"
onchange="changeMaxMag(this);"
oninput="changeMaxMag(this);">
<h2>More sliders to fiddle around with:</h2>
<h3>INDEX 1</h3>
<div class="statusLabel" id="ev1_status">0</div>
<input id="ev1_slider" type="range" name="max_mag" min="0" step="1" max="5" value="0"
onchange="changeIdx(this, 1);"
oninput="changeIdx(this, 1);">
<h3>INDEX 2</h3>
<div class="statusLabel" id="ev2_status">2</div>
<input id="ev2_slider" type="range" name="max_mag" min="2" step="1" max="7" value="0"
onchange="changeIdx(this, 2);"
oninput="changeIdx(this, 2);;">
<h3>INDEX 3</h3>
<div class="statusLabel" id="ev3_status">3</div>
<input id="ev3_slider" type="range" name="max_mag" min="4" step="1" max="8" value="0"
onchange="changeIdx(this, 3);"
oninput="changeIdx(this, 3);">
<button style="display: block margin-top: 30px" class="btn" id="reloadButton" onclick="reloadProcessor()">RELOAD</button>
</div>
<div id="underConstruction">
<p>
Seismokraft is a web-based seismic sonification application currently under development.
</p>
<div id="gitHubButton">
<p>
<a href="https://github.com/felakuti4life/Seismokraft">track the progress of Seismokraft</a>
</p>
</div>
</div>
<div id="footer">Layout, design and code by <a href="http://ethangeller.com">Ethan Geller</a>. Research by Elizabeth
Davis.
</div>
</div>
<p> </p>
</body>
</html>