forked from sebmatton/jQuery-Flight-Indicators
-
Notifications
You must be signed in to change notification settings - Fork 11
/
instrument_heading.html
executable file
·88 lines (55 loc) · 1.92 KB
/
instrument_heading.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
<!--
Skyhawk Flight Instruments (https://github.com/uw-ray/Skyhawk-Flight-Instruments)
By Raymond Blaga ([email protected]), Edward Hanna ([email protected]), Pavlo Kuzhel ([email protected])
Forked from jQuery Flight Indicators (https://github.com/sebmatton/jQuery-Flight-Indicators)
By Sébastien Matton ([email protected])
Published under GPLv3 License.
-->
<!DOCTYPE html>
<meta charset="utf-8">
<html lang="en" dir="ltr">
<head>
<title>Heading Indicator</title>
<script src="js/jquery-1.11.3.js"></script>
<script src="js/d3.min.js"></script>
<script src="js/jquery.flightindicators.js"></script>
<link rel="stylesheet" type="text/css" href="css/flightindicators.css" />
<script src="js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css" />
</head>
<body>
<div class="examples text-center">
<div>
<span id="heading"></span>
</div>
<div>
<button id="headingButton" class="btn btn-default" type="submit">Button</button>
</div>
</div>
<script type="text/javascript">
var increment = 0;
var heading = $.flightIndicator('#heading', 'heading', {heading:150, 'beacononeshow': true, 'beacontwoshow': true});
function doHeading(){
var myInterval = setInterval(function() {
$("#headingButton").text("Playing");
increment++;
// Heading update
heading.setHeading(increment);
heading.setBeaconOne(increment * 2, true);
heading.setBeaconTwo(-increment * 3, true);
if(increment == 157){
$("#headingButton").text("Start");
clearInterval(myInterval);
$("#headingButton").attr('disabled',false);
heading.setHeading(0);
}
}, 50);
}
$("#headingButton").text("Start");
$("#headingButton").on("click", function() {
$("#headingButton").attr('disabled', true);
doHeading();
});
</script>
</body>
</html>