forked from sebmatton/jQuery-Flight-Indicators
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathinstrument_turn_cordinator.html
executable file
·72 lines (53 loc) · 1.93 KB
/
instrument_turn_cordinator.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
<!--
Skyhawk Flight Instruments (https://github.com/uw-ray/Skyhawk-Flight-Instruments)
By Raymond Blaga (raymond.blaga@gmail.com), Edward Hanna (edward.hanna@senecacollege.ca), Pavlo Kuzhel (pavlo.kuzhel@senecacollege.ca)
Forked from jQuery Flight Indicators (https://github.com/sebmatton/jQuery-Flight-Indicators)
By Sébastien Matton (seb_matton@hotmail.com)
Published under GPLv3 License.
-->
<!DOCTYPE html>
<meta charset="utf-8">
<html lang="en" dir="ltr">
<head>
<title>Turn Coordinator</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="turncoordinator"></span>
</div>
<div>
<button id="turncoordinatorButton" class="btn btn-default" type="submit">Button</button>
</div>
</div>
<script type="text/javascript">
var increment = 0;
var ball_increment = 0.5;
var ball_right = true;
var turn_coordinator = $.flightIndicator('#turncoordinator', 'turn_coordinator');
function doTurnCoordinator(){
var myInterval = setInterval(function() {
turn_coordinator.setSlip(ball_increment);
if (ball_increment <= 0) ball_right = true;
if (ball_increment >= 1) ball_right = false;
if (ball_right == false) ball_increment -= 0.01;
else ball_increment += 0.01;
turn_coordinator.setTurn(30*Math.sin(increment/10));
increment++;
}, 50);
}
$("#turncoordinatorButton").text("Start");
$("#turncoordinatorButton").on("click", function() {
$("#turncoordinatorButton").attr('disabled', true);
$("#turncoordinatorButton").text("Playing");
doTurnCoordinator();
});
</script>
</body>
</html>