-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.html
executable file
·73 lines (69 loc) · 2.69 KB
/
main.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
<html>
<head>
<title>Trivia Crackd</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="header">
<div id="nav-header">
<a id="navbar-brand" href="#"><img id="brand-logo" src="images/logo.png" /></a>
</div>
</div>
<div id="rest">
<div id="content">
<div id="instructions">
<h1>Connect Your Phone</h1>
<p id="main-text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse ac eros imperdiet elit egestas convallis. Maecenas sagittis nibh quis enim sodales, sed faucibus leo tincidunt. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nunc sed purus at massa fringilla faucibus. Praesent sagittis scelerisque mollis.
<br /><br />
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean dignissim vel justo in vulputate. Duis gravida quis quam eu molestie. Donec blandit dolor vel justo vulputate, id lobortis eros ullamcorper. Cras hendrerit quis mauris et dapibus. In porta eu urna non semper.
</p>
</div>
<div id="answers">
<h1 id="category"></h1>
<div id="question-panel">
<div class="panel panel-1"></div>
<div class="panel panel-2"></div>
<div class="panel panel-3">
<p id="trivia-question"></p>
</div>
</div>
<div id="answer-panel">
<div class="answer" id="a-0"></div>
<div class="answer" id="a-1"></div>
<div class="answer" id="a-2"></div>
<div class="answer" id="a-3"></div>
</div>
</div>
<script>
function update(arr) {
if(arr.length == 1) {
document.getElementById("category").innerHTML = arr[0]["question"]["category"];
document.getElementById("trivia-question").innerHTML = arr[0]["question"]["text"];
document.getElementById("a-0").innerHTML = arr[0]["question"]["answers"][0];
document.getElementById("a-1").innerHTML = arr[0]["question"]["answers"][1];
document.getElementById("a-2").innerHTML = arr[0]["question"]["answers"][2];
document.getElementById("a-3").innerHTML = arr[0]["question"]["answers"][3];
switch(arr[0]["question"]["correct_answer"]) {
case 0:
document.getElementById("a-0").className += " correct";
break;
case 1:
document.getElementById("a-1").className += " correct";
break;
case 2:
document.getElementById("a-2").className += " correct";
break;
case 3:
document.getElementById("a-3").className += " correct";
break;
}
}
}
</script>
<script src="data.js"></script>
</div>
</div>
</body>
</html>