-
Notifications
You must be signed in to change notification settings - Fork 0
/
stopwatch.html
66 lines (64 loc) · 1.47 KB
/
stopwatch.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
---
layout: default
title: Color Picker
favicon: stopwatch/stopwatch.png
---
<h1>Stopwatch
<br>
<small>Press space for start/stop</small>
</h1>
<br>
<div>
<span><span class="timer" id="minute">000</span>:<span class="timer" id="second">00</span>.<span class="timer" id="millisecond">0</span></span>
</div>
<br>
<br>
<div class="row">
<div class="col-md-6">
<input type="submit" id="Run" class="btn btn-custom btn-lg" value="Run" style="padding:10px 0px 10px 0px;">
</div>
<div class="col-md-6">
<input type="submit" id="Reset" class="btn btn-custom btn-lg" value="Reset" style="padding:10px 0px 10px 0px;">
</div>
</div>
<br>
<div>
<input type="submit" id="Save" class="btn btn-custom btn-lg" value="Save" style="padding:10px 0px 10px 0px;">
</div>
<br>
<!--<h2>High Scores
<small>
<ol id="high-scores">
</ol>
</small>
</h2>-->
<script>
$(document).ready(function() {
$("#nav-stopwatch").addClass("active");
highScores();
$('body').keyup(function(e){
if(e.keyCode == 32){ // Space bar
if(!timer){
runWatch();
} else {
clearInterval(timer);
timer = false;
}
}
});
$("#Run").on('click', function(){
if(!timer){
runWatch();
} else {
clearInterval(timer);
timer = false;
}
});
$("#Reset").on('click', function(){
resetTimer();
});
//$("#Save").on('click', function(){
// saveScore();
//});
});
</script>