-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
452 lines (403 loc) · 13 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
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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<!DOCTYPE html/css>
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-169285999-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-169285999-1');
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<title>Welcome!</title>
<style>
@font-face {
font-family: Gotham-Bold;
src: url(Gotham-Bold.otf);
}
@font-face {
font-family: Gotham-Book;
src: url(Gotham-Book.otf);
}
body {
background-color: #003066;
}
#header {
display: flex;
justify-content: center;
height: 16vh;
position: fixed;
top: 0px;
background-color: #003066;
}
#greeting {
display: block;
}
.text {
color: white;
font-size: 60px;
font-family: Gotham-Book;
padding-left: 50px;
padding-right: 50px;
}
.toggles {
display: flex;
justify-content: center;
align-content: center;
width: 100%;
margin-top: -50px;
}
.toggleOn {
color: white;
font-family: Gotham-Book;
font-size: 50px;
background-color: #009760;
/*border-radius: 50px;*/
width: 300px;
height: 140px;
text-align: center;
margin-top: 100px;
border: 0px;
margin-left: 10px;
margin-right: 10px;
}
.toggleOff {
color: white;
font-family: Gotham-Book;
font-size: 50px;
background-color: gray;
/*border-radius: 50px;*/
width: 300px;
height: 140px;
text-align: center;
margin-top: 100px;
border: 0px;
margin-left: 10px;
margin-right: 10px;
}
#langToggles{
padding-top: 16vh;
}
#mediaToggles{
display: flex;
}
#overlay {
position: absolute;
display: none;
width: 100%;
height: 100%;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 0;
margin-left: auto;
margin-right: auto;
padding-top: 30%;
background-color: rgba(0,0,0,0.9);
}
#audio-check {
text-align: center;
margin-top: 10%;
padding: 25px;
}
#testSoundButton {
color: white;
font-family: Gotham-Book;
font-size: 65px;
background-color: #db0961;
/*border-radius: 50px;*/
width: 75%;
height: 120px;
border: 0px;
}
#endSoundTestButton {
color: white;
font-family: Gotham-Book;
font-size: 75px;
background-color: #009760;
/*border-radius: 50px;*/
width: 75%;
height: 120px;
border: 0px;
}
#enToggle {
display: none;
}
#esToggle {
display: none;
}
#textSizeLabel {
display: none;
}
#textSize {
display: none;
}
#textSizeSlider {
width: 620px;
-webkit-appearance: none;
height: 15px;
border-radius: 5px;
background: gray;
outline: none;
}
#textSizeSlider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 50px;
height: 50px;
border-radius: 50%;
background: #009760;
cursor: pointer;
}
#textSizeSlider::-moz-range-thumb {
width: 50px;
height: 50px;
border-radius: 50%;
background: #009760;
cursor: pointer;
}
#textSizeSample {
display: none;
}
.objectText {
font-size: 45px;
color: white;
font-family: Gotham-Book;
padding-top: 10px;
padding-left: 20px;
overflow-y: auto;
}
#goButton {
color: white;
font-family: Gotham-Book;
font-size: 75px;
background-color: #009760;
/*border-radius: 50px;*/
width: 600px;
height: 140px;
border: 0px;
}
#goPane {
display: flex;
justify-content: center;
align-content: center;
width: 100%;
height: 10%;
margin-top: 100px;
display: none;
}
#rotationWarning {
position: fixed;
display: none;
width: 100%;
height: 100%;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 0;
margin-left: auto;
margin-right: auto;
background-color: rgba(0,0,0,0.9);
font-size: 60px;
color: white;
font-family: Gotham-Book;
text-align: center;
padding-top: 10%;
}
* {
-webkit-text-size-adjust: none;
touch-action: manipulation;
}
button:active {
outline: none;
border: none;
}
</style>
</head>
<body>
<div id='header'><img src='FWMSH_logo.png' style='object-fit: cover; width: 100%;'></div>
<div id='langToggles' class=toggles>
<button id='enToggle' class='toggleOff' onclick="toggleLang('en')">English</button>
<button id='esToggle' class='toggleOff' onclick="toggleLang('es')">Español</button>
</div>
<div id='greeting' class='text'>
<p>
<h2>Welcome!</h2> This app will be your companion during your Museum visit. It can provide you with extra info about the objects you'll see today.
<p> Would you prefer to read or listen?
</div>
<div id='mediaToggles' class='toggles'>
<button id='textToggle' class='toggleOff' onclick="toggleMedia('text')">Read</button>
<button id='audioToggle' class='toggleOff' onclick="toggleMedia('audio')">Listen</button>
</div>
<div id='textSizeLabel' class='text' style='margin-top: 75px;'>
Choose your text size:
</div>
<div id='textSize' class='toggles' style='margin-top: 100px;'>
<input type="range" min="25" max="100" value="45" id="textSizeSlider" onchange="changeTextSize(this.value)">
</div>
<div id='textSizeSample' class='objectText' style='padding-top: 50px;'>This is some sample text</div>
<div id='goPane'>
<button id='goButton' onclick="switchPage()">Let's Go!</button>
</div>
<div id='overlay'>
<div id='audio-check'>
<audio id='testSound' onended='resetButton()'>
<source src='sound-test.wav'>
</audio>
<div class='text' id='levelCheckText'>
Let's check your audio level.
<p>
</div>
<button id='testSoundButton' onclick='playTestSound()'>Play test sound</button>
<div class='text' id='soundCourtesy'>
<p>
Please be considerate of other guests and keep your audio no louder than you need to hear the content.
<p>
</div>
<button id='endSoundTestButton' onclick='dismissPopup()'>Sounds good!</button>
</div>
</div>
<div id='rotationWarning'>Please rotate your device<p>Por favor gire su dispositivo</overlay>
</body>
<script>
// User preferences to pass back and forth with the other pages
var lang = 'en';
var mediaType = 'text';
var fontSize = 45;
// Check for options passed from previous page
var queryString = decodeURIComponent(window.location.search);
var searchParams = new URLSearchParams(queryString);
if(searchParams.has('skipAudioCheck')) {
dismissPopup();
}
if(searchParams.has('lang')) {
lang = searchParams.get('lang');
}
if(searchParams.has('mediaType')) {
mediaType = searchParams.get('mediaType');
}
if (searchParams.has('fontSize')) {
fontSize = searchParams.get('fontSize');
}
function toggleMedia(type) {
// Function to switch between displaying text or the audio guide.
var textToggle = document.getElementById('textToggle');
var audioToggle = document.getElementById('audioToggle');
if (type == 'text') {
textToggle.className = 'toggleOn';
audioToggle.className = 'toggleOff';
} else if (type == 'audio') {
textToggle.className = 'toggleOff';
audioToggle.className = 'toggleOn';
document.getElementById('overlay').style.display = 'block';
}
mediaType = type;
document.getElementById('textSize').style.display = 'flex';
document.getElementById('textSizeSample').style.display = 'block';
document.getElementById('textSizeLabel').style.display = 'block';
document.getElementById('goPane').style.display = 'flex';
if (type == 'text') { // Otherwise we will show the audio test panel
window.scrollTo(0,document.body.scrollHeight);
}
}
function toggleLang(newLang) {
// Function to select a langauge and switch the dictionaries over
var enToggle = document.getElementById('enToggle');
var esToggle = document.getElementById('esToggle');
var textToggle = document.getElementById('textToggle');
var audioToggle = document.getElementById('audioToggle');
var greeting = document.getElementById('greeting');
var levelCheckText = document.getElementById('levelCheckText');
var soundCourtesy = document.getElementById('soundCourtesy');
var testSoundButton = document.getElementById('testSoundButton');
var endSoundTestButton = document.getElementById('endSoundTestButton');
var goButton = document.getElementById('goButton');
lang = newLang;
if (lang == 'en') {
enToggle.className = 'toggleOn';
esToggle.className = 'toggleOff';
textToggle.innerHTML = 'Read';
audioToggle.innerHTML = 'Listen';
greeting.innerHTML = `
<p>
<h2>Welcome!</h2> This app will be your companion during your Museum visit. It can provide you with extra info about the objects you'll see today.
<p> Would you prefer to read or listen?
`;
levelCheckText.innerHTML = "Let's check your audio level.<p>";
soundCourtesy.innerHTML = "<p>Please be considerate of other guests and keep your audio no louder than you need to hear the content.<p>";
testSoundButton.innerHTML = 'Play test sound';
endSoundTestButton.innerHTML = 'Sounds good!';
goButton.innerHTML = "Let's go!";
} else if (lang == 'es') {
enToggle.className = 'toggleOff';
esToggle.className = 'toggleOn';
textToggle.innerHTML = 'Lee';
audioToggle.innerHTML = 'Escucha';
greeting.innerHTML = `
<p>
<h2>¡Bienvenidos!</h2> Esta aplicación será su acompañante durante su visita al museo. Puede proporcionarle información adicional sobre los objetos que verá hoy.
<p> ¿Prefieres leer o escuchar?
`;
levelCheckText.innerHTML = "Verifiquemos su nivel de audio.<p>";
soundCourtesy.innerHTML = "<p>Sea considerado con otros invitados y mantenga su audio no más alto de lo que necesita para escuchar el contenido.</p>";
testSoundButton.innerHTML = 'Reproducir sonido';
endSoundTestButton.innerHTML = 'Suena bueno!';
goButton.innerHTML = "¡Vamonos!";
}
document.getElementById('greeting').style.display = 'block';
document.getElementById('mediaToggles').style.display = 'flex';
window.scrollTo(0,document.body.scrollHeight);
}
function changeTextSize(size) {
// Function to change the text size, which will then be applied to
// the object text and object caption elements
fontSize = size; // Set the global property
// Update the sample text
document.getElementById('textSizeSample').style.fontSize = size + 'px';
}
function switchPage() {
// Function to switch pages while appending the user preferences
// Check for options passed from previous page
var queryString = decodeURIComponent(window.location.search);
var searchParams = new URLSearchParams(queryString);
if (searchParams.has('page')) {
passed_page = searchParams.get('page');
page = passed_page + "/" + passed_page + ".html";
}
else {
page = "home.html";
}
var link = page + '?lang='+lang+'&mediaType='+mediaType+'&fontSize='+fontSize;
window.location.href = link;
}
function dismissPopup() {
// Hide the overlay
document.getElementById('overlay').style.display = 'none';
window.scrollTo(0,document.body.scrollHeight);
}
function resetButton() {
// Called after audio stops to reset the button text.
button = document.getElementById('testSoundButton');
button.innerHTML = 'Play again';
}
function playTestSound() {
sound = document.getElementById('testSound');
button = document.getElementById('testSoundButton');
sound.play();
button.innerHTML = 'Playing...';
}
// Detect landscape and warn
$(window).resize(function() {
var screenAspect = $(this).width()/$(this).height();
var overlay = document.getElementById('rotationWarning');
if (screenAspect > 1) {
overlay.style.display = 'block';
} else {
overlay.style.display = 'none';
}
});
</script>
</html>