-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·121 lines (110 loc) · 5.7 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
117
118
119
120
121
<!DOCTYPE HTML>
<html ng-app="bcsScienceCity">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=1920, height=1080, initial-scale=1.0, minimum-scale=1">
<title>BCS Science City</title>
<link rel="stylesheet" type="text/css" href="assets/styles/css/main.css">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="bcsScienceCity" ng-controller="QuizController">
<!-- PROGRESS BAR -->
<div class="progress" ng-class="{
'game-over': isGameOver(),
'restarted': isGameRestarted()
}">
<div ng-show="(activeQuestion > -1)" class="
{{ myQuestion.class }}
{{ ($index === activeQuestion) ? 'on' : 'off' }}
{{ (myQuestion.questionState === 'answered') ? 'answered' : 'unanswered' }}
{{ (myQuestion.correctness === 'correct') ? 'correct' : 'incorrect' }}
" ng-repeat="myQuestion in myQuestions">
</div>
<!-- RESULTS -->
<div class="results">
<h3>Results</h3>
<h2>You scored {{ percentage }}% by answering {{ score }} of the total {{ totalQuestions }} questions.</h2>
<p class="btn pulse-btn restart-game" ng-click="restartGame()">Play another quiz</p>
</div>
</div>
<!-- INTRO -->
<div ng-if="activeQuestion < 0" class="intro {{ activeQuestion > -1 ? 'inactive' : 'active' }}"
ng-class="{
'game-over': isGameOver(),
}"
>
<h1>How does Union Station use energy, water and air to keep the building running?</h1>
<div class="characters-container">
<div class="character-wrapper">
<div class="character energy">
<div ng-include src="'views/energy-robot.html'"></div>
</div>
<p class="btn start-game" ng-click="startGame('energy')">Play</p>
</div>
<div class="character-wrapper">
<div class="character water">
<div ng-include src="'views/water.html'"></div>
<div ng-include src="'views/water-robot.html'"></div>
</div>
<p class="btn start-game" ng-click="startGame('water')">Play</p>
</div>
<div class="character-wrapper">
<div class="character air">
<div ng-include src="'views/air-robot.html'"></div>
</div>
<p class="btn start-game" ng-click="startGame('air')">Play</p>
</div>
</div>
</div>
<!-- QUESTION -->
<div class="question
{{ myQuestion.questionState === 'answered' ? 'answered' : 'unanswered' }}
{{ $index === activeQuestion ? 'active' : 'inactive' }}
" ng-repeat="myQuestion in myQuestions">
<div class="txt-container {{ myQuestion.class }}">
<div class="txt">
<h1>{{ myQuestion.question }}</h1>
<p>{{ myQuestion.questionSubcopy }}</p>
</div>
<div class="ans-container">
<div class="ans-wrapper">
<p class="ans" ng-class="{
image: Answer.image,
'selected': isSelected($parent.$index, $index),
'correct': isCorrect($parent.$index, $index),
'pulse-btn': isCorrect($parent.$index, $index)
}" ng-style="{ 'background-image': 'url({{Answer.image}})' }" ng-click="selectAnswer($parent.$index, $index)" ng-repeat="Answer in myQuestions[$index].answers">
{{Answer.text}}
</p>
</div>
<div class="feedback">
<h3>{{myQuestion.feedbackAns}}</h3>
<p ng-bind-html="trust(myQuestion.feedbackCopy)"></p>
<div class="feedback-img" ng-if="myQuestion.feedbackImg">
<img src="{{myQuestion.feedbackImg}}">
</div>
<div class="next-question btn pulse-btn {{ (myQuestion.questionState === 'answered') ? 'fadeIn': 'fadeOut' }}" ng-click="selectContinue()">{{ (totalQuestions-1) === $index ? 'See Results' : 'Next Question' }}</div>
</div>
</div>
</div>
<div ng-include src="'views/quote.html'" class="{{ myQuestion.class }}"></div>
</div>
<!-- ROBOT BACKGROUND -->
<div class="
robot-background
{{ myQuestions[activeQuestion].class }}
{{ isGameOver() ? myQuestions[totalQuestions-1].class : ''}}">
<div ng-include src="'views/water.html'" ng-if="myQuestions[activeQuestion].class == 'water'"></div>
<div ng-include src="'views/water-robot.html'" ng-if="myQuestions[activeQuestion].class == 'water'"></div>
<div ng-include src="'views/energy-robot.html'" ng-if="myQuestions[activeQuestion].class == 'energy'"></div>
<div ng-include src="'views/air-robot.html'" ng-if="myQuestions[activeQuestion].class == 'air'"></div>
</div>
</div>
<script type="text/javascript" src="assets/js/library/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="assets/js/library/angular.min.js"></script>
<script type="text/javascript" src="assets/js/quiz.js"></script>
</body>
</html>