-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
502 lines (436 loc) · 15.1 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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<!DOCTYPE html>
<html lang="en" >
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-MJQM5PWEBN"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-MJQM5PWEBN');
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Voice Accounting</title>
<link rel="stylesheet" href="./style.css">
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div id="container" class="container">
<div>
<h1>Voice Accounting</h1>
</div>
<div id="expression">
</div>
<div id="standard-buttons" class="container-fluid">
<div class="row button-row">
<div class="col-xs-1">
<button id="num-7" class="btn num" title="7">7</button>
</div>
<div class="col-xs-1">
<button id="num-8" class="btn num" title="8">8</button>
</div>
<div class="col-xs-1">
<button id="num-9" class="btn num" title="9">9</button>
</div>
<div class="col-xs-1">
<button id="op-divide" class="btn" title="Divide">÷</button>
</div>
<div class="col-xs-1">
<button id="clear" class="btn button-orange" title="Clear all">AC</button>
</div>
</div>
<div class="row button-row">
<div class="col-xs-1">
<button id="num-4" class="btn num" title="4">4</button>
</div>
<div class="col-xs-1">
<button id="num-5" class="btn num" title="5">5</button>
</div>
<div class="col-xs-1">
<button id="num-6" class="btn num" title="6">6</button>
</div>
<div class="col-xs-1">
<button id="op-multiply" class="btn" title="Multiply">x</button>
</div>
<div class="col-xs-1">
<button id="delete" class="btn button-orange" title="Delete">DEL</button>
</div>
</div>
<div class="row button-row">
<div class="col-xs-1">
<button id="num-1" class="btn num" title="1">1</button>
</div>
<div class="col-xs-1">
<button id="num-2" class="btn num" title="2">2</button>
</div>
<div class="col-xs-1">
<button id="num-3" class="btn num" title="3">3</button>
</div>
<div class="col-xs-1">
<button id="op-subtract" class="btn" title="Subtract">-</button>
</div>
<div class="col-xs-1">
<button id="equals" class="btn button-blue" title="Equals">=</button>
</div>
</div>
<div class="row button-row">
<div class="col-xs-1">
<button id="period" class="btn" title="Decimal point">.</button>
</div>
<div class="col-xs-1">
<button id="num-0" class="btn num" title="0">0</button>
</div>
<div class="col-xs-1">
<button id="op-negate" class="btn" title="Negate">(-)</button>
</div>
<div class="col-xs-1">
<button id="op-add" class="btn" title="Add">+</button>
</div>
<div class="col-xs-1">
<button id="toggle-advanced" class="btn button-off" title="Toggle advanced panel"><span class="glyphicon glyphicon-triangle-bottom"></span></button>
</div>
</div>
</div>
<div id="calc-history">
<span>Accounting History</span>
<hr>
<div id="maintenance">
<button id="hcopy" class="" title="Copy History To Clipboard" style="color:black;" onclick="CopyToClipboard('calc-history-box')">Copy</button>
<button id="hclear" class="" title="Clear History" style="color:black;" onclick="ClearHistory('calc-history-box')">Clear</button>
</div>
<hr>
<br>
<div id="calc-history-box"></div>
</div>
<div id="advanced-buttons" class="container-fluid">
<div class="row button-row">
<div class="col-xs-1">
<button id="op-power" class="btn" title="Exponentiate">^</button>
</div>
<div class="col-xs-1">
<button id="num-pi" class="btn num" title="Pi">π</button>
</div>
<div class="col-xs-1">
<button id="op-inverse-sin" class="btn" title="Inverse sine">asin</button>
</div>
<div class="col-xs-1">
<button id="op-inverse-cos" class="btn" title="Inverse cosine">acos</button>
</div>
<div class="col-xs-1">
<button id="op-inverse-tan" class="btn" title="Inverse tangent">atan</button>
</div>
</div>
<div class="row button-row">
<div class="col-xs-1">
<button id="op-square-root" class="btn" title="Square root">√</button>
</div>
<div class="col-xs-1">
<button id="op-nth-root" class="btn" title="nth root">x*√</button>
</div>
<div class="col-xs-1">
<button id="op-sin" class="btn" title="Sine">sin</button>
</div>
<div class="col-xs-1">
<button id="op-cos" class="btn" title="Cosine">cos</button>
</div>
<div class="col-xs-1">
<button id="op-tan" class="btn" title="Tangent">tan</button>
</div>
</div>
<div class="row button-row">
<div class="col-xs-1">
<button id="op-log" class="btn" title="Log base 10">log</button>
</div>
<div class="col-xs-1">
<button id="op-natural-log" class="btn" title="Natural log (base e)">ln</button>
</div>
<div class="col-xs-1">
<button id="op-e" class="btn" title="Exponential function">e^x</button>
</div>
<div class="col-xs-1">
<button id="bracket-left" class="btn" title="Open bracket">(</button>
</div>
<div class="col-xs-1">
<button id="bracket-right" class="btn" title="Closed bracket">)</button>
</div>
</div>
</div>
<center><h4>Hint: Just Type from the Numeric Keypad itself &<br>Also Adjust Speaker Volume to the desired level.<br><br>Can attach a USB Keyboard with Numeric Keypad as well.</h4></center>
<div id="footer">
<p></p>
</div>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js'></script>
<script src="./script.js"></script>
<script type="text/javascript">
function CopyToClipboard(containerid) {
if (document.selection) {
var range = document.body.createTextRange();
range.moveToElementText(document.getElementById(containerid));
range.select().createTextRange();
document.execCommand("copy");
} else if (window.getSelection) {
var range = document.createRange();
range.selectNode(document.getElementById(containerid));
window.getSelection().addRange(range);
document.execCommand("copy");
alert("Text has been copied to clipboard")
}
}
</script>
<script type="text/javascript">
function ClearHistory(containerid) {
// containerid.innerHTML="";
localStorage.clear();
window.location.reload();
}
</script>
<audio id='8' controls style='display:none'>
<source src='sounds/8.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='96' controls style='display:none'>
<source src='sounds/96.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='97' controls style='display:none'>
<source src='sounds/97.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='98' controls style='display:none'>
<source src='sounds/98.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='99' controls style='display:none'>
<source src='sounds/99.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='100' controls style='display:none'>
<source src='sounds/100.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='101' controls style='display:none'>
<source src='sounds/101.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='102' controls style='display:none'>
<source src='sounds/102.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='103' controls style='display:none'>
<source src='sounds/103.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='104' controls style='display:none'>
<source src='sounds/104.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='105' controls style='display:none'>
<source src='sounds/105.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='106' controls style='display:none'>
<source src='sounds/106.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='107' controls style='display:none'>
<source src='sounds/107.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='109' controls style='display:none'>
<source src='sounds/109.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='110' controls style='display:none'>
<source src='sounds/110.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='111' controls style='display:none'>
<source src='sounds/111.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='144' controls style='display:none'>
<source src='sounds/144.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='13' controls style='display:none'>
<source src='sounds/13.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='61' controls style='display:none'>
<source src='sounds/61.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<audio id='39' controls style='display:none'>
<source src='sounds/39.mp3' type='audio/mpeg'> Your browser does not support the audio element.
</audio>
<script type="text/javascript">
document.addEventListener('keydown', function(e) {
if (e.keyCode == 8) {
document.getElementById('8').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 96) {
document.getElementById('96').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 97) {
document.getElementById('97').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 98) {
document.getElementById('98').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 99) {
document.getElementById('99').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 100) {
document.getElementById('100').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 101) {
document.getElementById('101').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 102) {
document.getElementById('102').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 103) {
document.getElementById('103').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 104) {
document.getElementById('104').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 105) {
document.getElementById('105').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 106) {
document.getElementById('106').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 107) {
document.getElementById('107').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 109) {
document.getElementById('109').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 110) {
document.getElementById('110').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 111) {
document.getElementById('111').play();
}
});
document.addEventListener('keydown', function(e) {
if (e.keyCode == 144) {
document.getElementById('144').play();
}
});
/*
document.addEventListener('keydown', function(e) {
console.log(e.keyCode);
if (e.keyCode == 13) {
document.getElementById('13').play();
}
});
*/
/*
document.addEventListener('keydown', function(e) {
if (e.keyCode == 39) {
document.getElementById('61').play();
// event.preventDefault();
// document.getElementById('61').play();
// speak();
// document.getElementById('13').play();
document.getElementById("equals").click();
saveData();
window.location.reload();
// document.getElementById("clear").click();
}
});
*/
</script>
<script type="text/javascript">
$(document).on("keypress", function (event) {
if (event.keyCode === 13) {
alert('You hit me');
console.log('jquery keypress');
}
})
</script>
<!--
<script type="text/javascript">
$(document).keydown(function(e){
if (e.keyCode == 13) {
document.getElementById('13').play();
return false;
}
});
</script>
<script type="text/javascript">
window.onkeydown=function(ev)
{
var e= ev || window.event,
key = e.keyCode
if (key===13) {
console.log("got ya");
console.log(e.location);
}
}
</script>
-->
<script src="https://code.responsivevoice.org/responsivevoice.js?key=uYTHNXd7"></script>
<!--
<script src="https://code.responsivevoice.org/responsivevoice.js?key=QugTbpmd"></script>
-->
<script src="https://cdn.jsdelivr.net/jquery/2.2.1/jquery.min.js"></script>
<script src="./moment-with-locales.min.js"></script>
<script>
function voiceStartCallback() {
console.log("Voice started");
}
function voiceEndCallback() {
console.log("Voice ended");
}
var parameters = {
onstart: voiceStartCallback,
onend: voiceEndCallback,
rate: 0.95
}
</script>
<script type="text/javascript">
/*
responsiveVoice.speak("Hello, this is a test using callbacks","UK English Female", parameters);
responsiveVoice.speak("hello world", "UK English Male", {pitch: 2});
responsiveVoice.speak("hello world", "UK English Male", {rate: 1.5});
responsiveVoice.speak("hello world", "UK English Male", {volume: 1});
*/
</script>
<script type="text/javascript">
// var text = document.getElementById(secondElementChild).innerHTML;
// var text = "Equals";
// responsiveVoice.speak(text,'UK English Female', parameters);
</script>
<style>
footer h4 {
position: relative;
left: 0;
bottom: 0;
width: 100%;
padding: 10px;
background-color: indigo;
color: white;
text-align: center;
}
</style>
<footer><center><a href="https://responsivevoice.org" title="ResponsiveVoice"><h4>Powered By ResponsiveVoice Text-To-Speech For Non-commercial personal or non-profit project</h4></a></center></footer>
</body>
</html>