forked from jeuelc/mworld-flat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sub-space-bh-gravity.html
112 lines (101 loc) · 5.2 KB
/
sub-space-bh-gravity.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
<!-- i-C-a -->
<div id="gravity" data-role="page">
<div class="coachcontainer" style="position:absolute;top:0px;left:0px;width:225px;height:320px;"></div>
<script src="js/slidebarbh.js"></script>
<div class="menuhousing"></div>
<div class="homebtnholder"><div class="homebtnbh"></div></div>
<div class="mpbtnholder"><div class="mpbtnbh"></div></div>
<div class="cpbtnholder"><div class="cpbtnbh"></div></div>
<div class="infobtnholder"><div class="infobtnbh"></div></div>
<div class="credsbtnholder"><div class="credsbtnbh"></div></div>
<div class="menubtnholder"><div class="menubtnbh"></div></div>
<div id="bonus-gravity" class="talkbubble" style="background:url(css/images/5-8/Space/Black_Holes/game/gravityq.png) no-repeat; width:473px;height:296px;position:absolute;left:300px;top:40px;visibility:hidden;">
<div style="width:100px;height:40px;position:relative;top:133px;left:240px;">
<input type="text" id="tfanswer2" style="background:rgba(255, 255, 255, 0.25);border:none;text-align:center;">
</div>
<div style="width:324px;height:62px;position:relative;top:129px;left:212px;">
<img id="submitans2" src="css/images/5-8/Space/Black_Holes/Where_BH_Come/submitbtn.png">
</div>
</div><!--/bonus-msm-->
<div id="spacechar">
<div data-role="content" class="kidzcontent">
<div class="storypagetitlebh"><h1>Gravity</h1></div>
<div class="storypagebh">
<p>When we drop something, such as an egg or a mobile phone, it falls to the ground. What is pulling it to the ground? It is the force of gravity. Gravity pulls the eggs and mobile phones (and people!) towards the surface of the Earth. If there was no gravity then we would be able to float in the air, like an astronaut in space!</p>
<p>The pull of gravity, which pulls us towards the Earth, also pulls the Moon towards the Earth. This is why the Moon does not fly away into outer space, but remains ‘connected’ to the Earth.</p>
<p>You might be wondering why the pull of gravity exists at all. You may be surprised to know that scientists still do not understand why gravity exists. Maybe one day you can become a scientist and help us to solve the puzzle of gravity!</p>
</div>
<div class="botlogoholder"><a href="home.html" class="homelinkbh"><img src="css/images/5-8/bottomhomebh.png"></a></div>
</div><!--end of content-->
</div><!--/spacechar-->
<section class="container" style="height:670px;margin-top:-600px;">
<div class="spriteComing"></div>
</section>
<div class="micbtnholder"><div class="micbtnbh"></div></div>
<div class="bbh"><div class="rwbh" id="gravityaudiobbtn"></div></div>
<div class="plbh"><div class="plpsbh" id="gravityaudioplbtn"></div></div>
<div class="fbh"><div class="fwbh" id="gravityaudiofbtn" ></div></div>
<div id="actualaudio-gravity" style="visibility:hidden;"></div>
<script language="javascript" type="text/javascript" src="js/coachscript.js"></script>
<script>
sound = new Audio(); // 'sound' is now an audio object
var playing;
(function() {
playing = false;
if(sound.canPlayType('audio/mpeg')) {
$('#actualaudio-gravity').html('<audio controls preload id="gravityaudio" onpause="playbh()" onplay="pausebh()"><source src="http://back.uvmate.com/sites/default/files/subjectsaudio/Gravity.mp3" type="audio/mpeg"></audio>');
}
$("#gravity").swipe( { swipeRight:goBack, allowPageScroll:"auto"} );
})();
$('.homelinkbh').on('tap', function() { mainaudiobg.play(); bgsoundbh.pause();bgsoundbh.currentTime = 0; });
$('#start-gravity').on('click', function() {
$('#actualaudio-gravity').show();
var oldHeight = $('#node-body-holder').height();
var newHeight = oldHeight - $('#actualaudio-gravity').height();
$('#node-body-holder').height(newHeight);
});
function goBack() {
$.mobile.changePage("sub-space-bh-whatisbh.html");
}
function pausedaudio() {
bgsoundbh.play();
}
function pausebg() {
bgsoundbh.pause();
}
$("#submitans2").on('tap', function() {
var tfans2 = $('#tfanswer2').val();
if(tfans2.toLowerCase() == "false") {
alert("Correct, you've earned 100 MPoints.");
} else {
alert("Sorry, that's not right, try again...");
}
});
/* ******************** */
$("#gravityaudioplbtn").on('tap', function() {
//gravityaudio.play();
//$(".audiopanel").css({"backgroundPosition":"-197px 0px"});
if(!playing) {
gravityaudio.play();
$('.micbtnbh').css('background-position-x', '-81px');
playing = true;
} else {
gravityaudio.pause();
$('.micbtnbh').css('background-position-x', '0px');
playing = false;
}
});
$("#gravityaudiofbtn").on('tap', function() {
var ctime = gravityaudio.currentTime;
gravityaudio.currentTime = ctime + 10;
});
$("#gravityaudiobbtn").on('tap', function() {
var ctime = gravityaudio.currentTime;
gravityaudio.currentTime = ctime - 10;
});
$("#gravityaudiopsbtn").on('tap', function() {
gravityaudio.pause();
$(".audiopanel").css({"backgroundPosition":"0px 0px"});
});
</script>
</div>