-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.html
315 lines (285 loc) · 16.4 KB
/
game.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<!DOCTYPE html>
<html>
<head>
<title>TreeHuggers</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="assets/css/normalize.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="assets/css/index.css">
<link rel="stylesheet" type="text/css" href="assets/css/game.css">
<link rel="apple-touch-icon" sizes="57x57" href="assets/images/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="72x72" href="assets/images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="60x60" href="assets/images/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="76x76" href="assets/images/apple-touch-icon-76x76.png">
<link rel="icon" type="image/png" href="assets/images/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="assets/images/favicon-32x32.png" sizes="32x32">
<meta name="msapplication-TileColor" content="#da532c">
</head>
<body>
<div class="preloader" id="preloader">
<div class="preloader-gif-container">
<img src="assets/images/preloader.gif" width="32" alt="preloader" />
</div>
</div>
<!-- Tutorial -->
<div class="dialog tutorial-container" id="tutorial"></div>
<script type="text/html" id="tutorialTemplate">
<div class="dialog-header tutorial-header<%= first%>">
<h3><%= heading %></h3>
</div>
<div class="dialog-content tutorial-content tutorial<%= first%>">
<%= img %>
<h2><%= title%></h2>
<span class="info"><%= content %></span>
<ul class="actions with-padding">
<% if ( first ){ %>
<li><a href="javascript: void();" class="next-tip" data-id="<%= id %>" id="nextTip">TAKE THE TOUR</a></li>
<li><a href="javascript: void();" class="green start-play" id="closeTutorial"> LET'S PLAY!</a></li>
<% } else { %>
<li><a href="javascript: void();" class="next-tip" data-id="<%= id %>" id="nextTip">NEXT TIP</a></li>
<li><a href="javascript: void();" class="close-tutorial" id="closeTutorial"> Let's play!</a></li>
<% } %>
</ul>
</div>
</script>
<div class="overlay"></div>
<div class="container">
<canvas id="world" width="1130" height="827"></canvas>
<!-- Header -->
<a href="javascript: void();" class="logo"></a>
<a href="javascript: void();" class="volume-icon mute"><img src="assets/images/mute.png" /></a>
<a href="javascript: void();" class="volume-icon volume"><img src="assets/images/volume.png" /></a>
<button class="button skeleton logout" id="logout">Log Out</button>
<hr class="header-line left"/>
<div class="air-polution" id="airPollution">
<p class="label"><span class="industry-icon icon"></span>Air Pollution</p>
<p class="value"><span class="update-target"></span>%</p>
<p class="goal uppercase">Goal is: <span class="bold">20%</span></p>
</div>
<p class="game-description half-opacity">Saving our planet. Tree by tree.</p>
<div class="logout"></div>
<hr class="header-line right"/>
<div class="user-stats" id="avatar">
<div class="left">
<h2 class="name uppercase"><span class="update-target">Bogdan Negrescu</span></h2>
<div class="rank fill-3">
<p class="leaf-fill"></p>
</div>
<p class="clear points"><span class="update-target"></span> points</p>
</div>
<div class="right avatar">
<div class="image">
<img class="update-target" src=""/>
</div>
</div>
</div>
<!-- Footer -->
<div class="bottom-block-container">
<div class="you-have bottom-block" id="youHave">
<div class="inline-block">
<p class="label uppercase bold">You have</p>
<p class="number"><span class="update-target"></span>x</p>
</div>
<div class="tree-icon icon "></div>
<p class="info half-opacity light inline-block">You will receive a new tree <br/><b>each day</b></p>
</div>
<div class="plant-now bottom-block" id="plantNow">
<aside class="trees-icon icon"></aside>
<div class="inline-block cta-block">
<button class="button green" id="plantNowButton">Plant Now</button>
<p class="text-center" >You need <span class="update-target"></span> tree(s)</p>
</div>
</div>
<div class="take-quiz bottom-block" id="takeQuiz">
<div class="quiz-image icon"></div>
<div class="inline-block cta-block">
<button class="button red">Take a Quiz</button>
<p class="text-center">Earn extra trees</p>
</div>
</div>
<div class="ask-help bottom-block" id="askHelp">
<div class="ask-help-image icon"></div>
<div class="inline-block cta-block">
<button class="button blue">Ask for help</button>
<p class="text-center"> <span class="update-target"></span> remaining</p>
</div>
</div>
<hr class="footer-line"/>
<footer>
<span class="half-opacity">© 2014 TreeHuggers.</span>
<div class="small-logo inline-block"></div>
<span class="half-opacity">All rights reserved.</span>
</footer>
</div>
</div>
<!-- Questions template -->
<script type="text/html" id="question-Dropdown-Html">
<div class="dialog question">
<div class="dialog-header question-header">
<img src="assets/images/quiz-icon.png" class="quiz-icon" />
<h3>QUIZ</h3>
</div>
<div class="dialog-content">
<div class="question-container">
<% if ( question.info ){ %>
<%= question.info %>
<span class="info-text">
Please take a quick glance at the information above. It will be helpful when answering the next question.
<% if(question.source){ %>
<a href="<%= question.source%>" target="_blank"> source </a>
<% } %>
</span>
<ul class="actions">
<li><a href="javascript: void();" id="next" class="send-response">GOT IT! QUIZ ME</a></li>
<li><a href="javascript: void();" class="close-tutorial" id="close">Cancel</a></li>
</ul>
<% } else { %>
<h1><%= question.text %></h1>
<select name="response" id="response">
<% _.each( question.answers, function( answer ){ %>
<option value="<%= answer.id %>"><%= answer.text %></value>
<% }); %>
</select>
<div class="success-message">
<img src="assets/images/quizz-good.png" alt="good" />
<strong>Congratulations!</strong> You just won a tree.
</div>
<div class="error-message">
<img src="assets/images/quizz-bad.png" alt="bad" />
<strong>Sorry!</strong> You just lost a battle against pollution.
</div>
<ul class="actions">
<li><a href="javascript: void();" class="send-response" id="sendResponse">CONFIRM ANSWER</a></li>
<li><a href="javascript: void();" class="next-question" id="nextQuestion">TAKE ANOTHER</a></li>
<li><a href="javascript: void();" class="close-tutorial" id="close">Cancel</a></li>
</ul>
<% } %>
</div>
</div>
</div>
</script>
<script type="text/html" id="question-Radio-Html">
<div class="dialog question">
<div class="dialog-header question-header">
<img src="assets/images/quiz-icon.png" class="quiz-icon" />
<h3>QUIZ</h3>
</div>
<div class="dialog-content">
<div class="question-container">
<% if ( question.info ){ %>
<%= question.info %>
<span class="info-text">
Please take a quick glance at the information above. It will be helpful when answering the next question.
<% if(question.source){ %>
<a href="<%= question.source%>" target="_blank"> source </a>
<% } %>
</span>
<ul class="actions">
<li><a href="javascript: void();" id="next" class="send-response">GOT IT! QUIZ ME</a></li>
<li><a href="javascript: void();" class="close-tutorial" id="close">Cancel</a></li>
</ul>
<% } else { %>
<h1><%= question.text %></h1>
<% _.each( question.answers, function( answer ){ %>
<input type="radio" value="<%= answer.id %>" id="response_<%= answer.id %>" checked="checked" name="response" class="response" />
<label class="checkbox-label" for="response_<%= answer.id%>"><%= answer.text %></label><br />
<% }); %>
<div class="success-message">
<img src="assets/images/quizz-good.png" alt="good" />
<strong>Congratulations!</strong> You just won a tree.
</div>
<div class="error-message">
<img src="assets/images/quizz-bad.png" alt="bad" />
<strong>Sorry!</strong> You just lost a battle against pollution.
</div>
<ul class="actions">
<li><a href="javascript: void();" class="send-response" id="sendResponse">CONFIRM ANSWER</a></li>
<li><a href="javascript: void();" class="next-question" id="nextQuestion">TAKE ANOTHER</a></li>
<li><a href="javascript: void();" class="close-tutorial" id="close">Cancel</a></li>
</ul>
<% } %>
</div>
</div>
</div>
</script>
<script type="text/html" id="question-Input-Html">
<div class="dialog question">
<div class="dialog-header question-header">
<img src="assets/images/quiz-icon.png" class="quiz-icon" />
<h3>QUIZ</h3>
</div>
<div class="dialog-content">
<div class="question-container">
<% if ( question.info ){ %>
<%= question.info %>
<span class="info-text">
Please take a quick glance at the information above. It will be helpful when answering the next question.
<% if(question.source){ %>
<a href="<%= question.source%>" target="_blank"> source </a>
<% } %>
</span>
<ul class="actions">
<li><a href="javascript: void();" id="next" class="send-response">GOT IT! QUIZ ME</a></li>
<li><a href="javascript: void();" class="close-tutorial" id="close">Cancel</a></li>
</ul>
<% } else { %>
<h1><%= question.text %></h1>
<input type="number" name="response" id="response"/>
<div class="success-message">
<img src="assets/images/quizz-good.png" alt="good" />
<strong>Congratulations!</strong> You just won a tree.
</div>
<div class="error-message">
<img src="assets/images/quizz-bad.png" alt="bad" />
<strong>Sorry!</strong> You just lost a battle against pollution.
</div>
<div class="error-input">
<img src="assets/images/quizz-bad.png" alt="bad" />
<strong>Sorry!</strong> Please insert a numeric value.
</div>
<ul class="actions">
<li><a href="javascript: void();" class="send-response" id="sendResponse">CONFIRM ANSWER</a></li>
<li><a href="javascript: void();" class="next-question" id="nextQuestion">TAKE ANOTHER</a></li>
<li><a href="javascript: void();" class="close-tutorial" id="close">Cancel</a></li>
</ul>
<% } %>
</div>
</div>
</div>
</script>
<!-- Win dialog -->
<script type="text/html" id="winDialogHtml">
<h1>You have won!!</h1>
</script>
<script src="scripts/libs/jquery-2.1.1.js"></script>
<script src="scripts/libs/underscore.js"></script>
<script src="scripts/libs/preloadjs/preloadjs-0.4.1.min.js"></script>
<script src="scripts/libs/easeljs/easeljs-0.7.1.combined.js"></script>
<script src="scripts/libs/soundjs/soundjs-0.5.2.combined.js"></script>
<script src="scripts/libs/tweenjs/tweenjs-0.5.1.combined.js"></script>
<script src="scripts/libs/tweenjs/CSSPlugin.js"></script>
<script src="scripts/global.js"></script>
<script src="scripts/game.js"></script>
<script src="scripts/map/Notifier.js"></script>
<script src="scripts/map/Zone.js"></script>
<script src="scripts/map/Country.js"></script>
<script src="scripts/map/Island.js"></script>
<script src="scripts/map/index.js"></script>
<script src="scripts/players/Player.js"></script>
<script src="scripts/players/MainPlayer.js"></script>
<script src="scripts/players/index.js"></script>
<script src="scripts/ui/Component.js"></script>
<script src="scripts/ui/AirPollution.js"></script>
<script src="scripts/ui/Avatar.js"></script>
<script src="scripts/ui/Question.js"></script>
<script src="scripts/ui/PlantNow.js"></script>
<script src="scripts/ui/TakeQuiz.js"></script>
<script src="scripts/ui/AskHelp.js"></script>
<script src="scripts/ui/Preloader.js"></script>
<script src="scripts/ui/YouHave.js"></script>
<script src="scripts/ui/WinDialog.js"></script>
<script src="scripts/ui/Tutorial.js"></script>
<script src="scripts/ui/index.js"></script>
<script src="scripts/main.js"></script>
</body>
</html>