-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
116 lines (103 loc) · 2.85 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js"></script>
<script type='text/javascript'>
$( document ).bind( "mobileinit", function() {
// Make your jQuery Mobile framework configuration changes here!
$.mobile.allowCrossDomainPages = true;
$.support.cors = true;
});
</script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css" />
<script>//<![CDATA[
window.onload=function(){
var db = [{
"question": "You are in the middle, there are a number of exits.",
"answers": [{
"title": "South",
"response": 1
}, {
"title": "North",
"response": 2
}, {
"title": "West",
"response": 3
}, {
"title": "East",
"response": 4
}]
}, {
"question": "You are in the South, There is one exit",
"answers": [{
"title": "North",
"response": 0
}]
}, {
"question": "You are in the North, There is one exit",
"answers": [{
"title": "South",
"response": 0
}]
}, {
"question": "You are in the West, There are two exits.",
"answers": [{
"title": "East",
"response": 0
}, {
"title": "West",
"response": 5
}]
}, {
"question": "You are in the East, There is one exit",
"answers": [{
"title": "West",
"response": 0
}]
}, {
"question": "You are the winner!",
"answers": [{
"title": "Start Over",
"response": 0
}]
}];
var currentLocation = 0;
window.printCurrentLocation = function() {
document.getElementById("question").innerHTML = db[currentLocation].question;
var answers = "";
for (var i = 0, l = db[currentLocation].answers.length; i < l; i++) {
answers += "<p><button onclick='setLocation(" + db[currentLocation].answers[i].response + ")'>" + db[currentLocation].answers[i].title + "</button></p>";
}
document.getElementById("answers").innerHTML = answers;
}
window.setLocation = function(num) {
currentLocation = num;
window.printCurrentLocation();
}
window.printCurrentLocation();
}//]]>
</script>
</head>
<body>
<audio autoplay="autoplay" loop="loop">
<source src="audio/low.mp3" type="audio/mpeg" />
<source src="audio/low.ogg" type="audio/ogg" />
</audio>
<script>
$(document).ready(function() {
$.get("http://www.matthewbarr.co.uk/projects/arc/jquery/welcome.php", function(data, status){
document.getElementById("dynamic").innerHTML = data;
});
});
</script>
<div id="dynamic"></div>
v 0.1
<div>You are standing in a clearing</div>
<div id="question"></div>
<div id="answers"></div>
<div>What do you want to do?</div>
</body>
</html>