-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpannel.js
665 lines (607 loc) · 23 KB
/
pannel.js
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
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
pannellum.viewer('panorama', {
//initialize the starting photosphere
"default": {
"firstScene": "pano1",
"showControls": false,
},
//add all the possible different photospheres in here
"scenes": {
"pano1": {
"title": "Lower Campus",
"author": "McGill Library",
"hfov": 300,
"yaw": 0,
"autoLoad": true,
"horizonRoll": -2.5,//added to correct non-level panorama
"compass": true,
"type": "equirectangular",
"panorama": "https://i.imgur.com/KXNhLh5.jpg",
"hotSpots": [
{//welcome hotspot - sound works.
"yaw": -50,
"pitch": -10,
"type": "info",
"cssClass": "welcomeHotspot",
"clickHandlerFunc": playAudio,
"clickHandlerArgs": "lowerWelcomeAudio",
"text": "Welcome to McGill's Lower Campus. Here you see the Arts Building, but click and drag and you'll see the path to other places to explore on Campus. Go left for the Redpath Museum, or go right to make your way to Birks Reading Room and the Molson Stadium. Click here to hear more!"
},
{//help hotspot
"pitch": -15,
"yaw": -70,
"type": "info",
"cssClass": "helpHotspot",
"URL": "https://sites.google.com/view/quizthatso/hints",
"text":"Hints"
},
{
"pitch": -0.6,
"yaw": 120,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Molson Stadium",
"sceneId": "pano2",
"targetYaw": -23,
"targetPitch": 2
},
{
"pitch": -2.1,
"yaw": 0,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Moyse Hall",
"sceneId": "pano4",
"targetYaw": 5,
},
{
"pitch": -2.1,
"yaw": 45,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Birks Reading Room",
"sceneId": "pano3"
},
{
"pitch": -2.1,
"yaw": -120,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Redpath Museum",
"sceneId": "pano5"
},
{//easter egg1 - lower campus field
"pitch": -5,
"yaw": 180,
"type": "info",
"cssClass": "infoHotspot",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalCampusEgg2",
"text":"Find out more"
},
{//easter egg1
"pitch": 10,
"yaw": 60,
"type": "info",
"cssClass": "infoHotspot",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalCampusEgg",
"text":"Find out more"
},
]
},
"pano2": {
"title": "Molson Stadium",
"author": "McGill Library",
"hfov": 300,
"pitch": -3,
"yaw": 17,
"compass": true,
"autoLoad": true,
"type": "equirectangular",
//image of the panorama
"panorama": "https://i.imgur.com/aqVfdKn.jpg",
//the list of hotspots belonging to this specific hotspot
"hotSpots": [
{
"pitch": -5,
"yaw": -30,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Lower Campus",
"sceneId": "pano1"
},
{//welcome hotspot
"yaw": -2.1,
"pitch": 0,
"type": "info",
"cssClass": "welcomeHotspot",
"clickHandlerFunc": playMolsonAudio,
"clickHandlerArgs": "molsonAudio",
"text": "Welcome to Molson Stadium. Click here to hear more about this space.",
},
{//help hotspot
"pitch": -5,
"yaw": -22.1,
"type": "info",
"cssClass": "helpHotspot",
"URL": "https://sites.google.com/view/quizthatso/hints",
"text":"Hints"
},
/*commented out bc i don't think we need it{
"pitch": -2.1,
"yaw": 15,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Birks Reading Room",
"sceneId": "pano3"
},*/
{//phil map Puzzle
"pitch":-5,
"yaw": 180,
"type": "info",
"cssClass": "hotspotPuzzleImage",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalPhilMap",
"text":"Solve the puzzle, and enter the password in your card inventory to unlock this teammate."
},
{
//Daniel Compare Puzzle
"pitch": 0,
"yaw": 60,
"type": "info",
"cssClass": "hotspotPuzzleImage",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "imageModalCompare",
"text":"Solve the puzzle, and enter the password in your card inventory to unlock this teammate."
},
{//easter egg percival molson
"pitch": -1,
"yaw": 102.6,
"type": "info",
"cssClass": "infoHotspot",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalPercival",
"text":"Why Molson Stadium?"
},
{//easter egg hockey stick
"pitch": 5,
"yaw": -102.6,
"type": "info",
"cssClass": "infoHotspot",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalMolsonEgg2",
"text":"Find out more"
},
/*extras for easter eggs{
"pitch": 0.9,
"yaw": 144.4,
"type": "info",
"clickHandlerFunc": passWord,
"clickHandlerArgs": "hotspot3",
}*/
]
},
"pano3": {
"title": "Birks Reading Room",
"author": "McGill Library",
"hfov": 300,
"yaw": 5,
"compass": true,
"type": "equirectangular",
"panorama": "https://i.imgur.com/bufAOgZ.jpg",
"hotSpots": [
/*
I don't think we need this scene link. {
"pitch": -0.6,
"yaw": 37.1,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Molson Stadium",
"sceneId": "pano2",
"targetYaw": -23,
"targetPitch": 2
},*/
{//welcome hotspot birks
"yaw": -2.1,
"pitch": 0,
"type": "info",
"cssClass": "welcomeHotspot",
"clickHandlerFunc": playBirksAudio,
"clickHandlerArgs": "birksAudio",
"text": "Welcome to Birks Reading Room. Click here to hear more about this space.",
},
{//help hotspot
"pitch": -5,
"yaw": -22.1,
"type": "info",
"cssClass": "helpHotspot",
"URL": "https://sites.google.com/view/quizthatso/hints",
"text":"Hints"
},
{
"pitch": -2.1,
"yaw": 45,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Lower Campus",
"sceneId": "pano1"
},
{//beryl jigsaw external window
"pitch": 0.9,
"yaw": 150,
"type": "info",
"cssClass": "hotspotPuzzleImage",
"URL": "https://www.jigsawexplorer.com/online-jigsaw-puzzle-player.html?url=aHR0cHM6Ly9pLmltZ3VyLmNvbS9ud2o2V0ZOLmpwZ18obm9fcHJldmlld180KV8obm9wPTUwKQ~~&cred=TWNHaWxsIExpYnJhcnk~&color=white",
"text":"Solve the puzzle, and find the key hidden underneath the password in the final image."
},
{//easter egg1
"pitch": -2.1,
"yaw": 95,
"type": "info",
"cssClass": "infoHotspot",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalEgg1",
"text":"Find out more"
},
{//easter egg2
"pitch": -2.1,
"yaw": 70,
"type": "info",
"cssClass": "infoHotspot",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalBirksEgg2",
"text":"Find out more"
},
{ //Rosemary Brown puzzle
"pitch": -5,
"yaw": 212,
"type": "info",
"cssClass": "hotspotPuzzleImage",
"text":"Solve the puzzle, and enter the password in your card inventory",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalRose"
},
]
},
"pano4": {
"title": "Moyse Hall",
"author": "McGill Library",
"hfov": 200,
"yaw": 5,
"compass": true,
"type": "equirectangular",
"panorama": "https://i.imgur.com/oY9ZxJX.jpg",
"hotSpots": [
{//welcome hotspot
"yaw": -2.1,
"pitch": -30,
"type": "info",
"cssClass": "welcomeHotspot",
"clickHandlerFunc": playMoyseAudio,
"clickHandlerArgs": "moyseAudio",
"text": "Welcome to Moyse Hall. Click here to hear more about this space.",
},
{//help hotspot
"pitch": -35,
"yaw": -22.1,
"type": "info",
"cssClass": "helpHotspot",
"URL": "https://sites.google.com/view/quizthatso/hints",
"text":"Hints"
},
{
"pitch": -2.1,
"yaw": 0,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Lower Campus",
"sceneId": "pano1"
},
/*directional hotspots not necessarily needed, but save for re-deployment if beta testing suggests they should be there.
{
"pitch": -8,
"yaw": 75,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Molson Stadium",
"sceneId": "pano2",
"targetYaw": -23,
"targetPitch": 2
},
{
"pitch": -8,
"yaw": -75,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Birks Reading Room",
"sceneId": "pano3"
},*/
{//easter egg1
"pitch": -8,
"yaw": -75,
"type": "info",
"cssClass": "infoHotspot",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalMoyseEgg",
"text":"Find out more"
},
{//easter egg2
"pitch": -8,
"yaw": 75,
"type": "info",
"cssClass": "infoHotspot",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalMoyseEgg2",
"text":"Find out more"
},
{//Bertha puzzle
"pitch": 0.9,
"yaw": 100,
"type": "info",
"cssClass": "hotspotPuzzleImage",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalMyCipher",
"text":"Solve the puzzle"
},
{//barbara jones puzzle - potato puzzle
"pitch": 0.9,
"yaw": -100,
"type": "info",
"cssClass": "hotspotPuzzleImage",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalPotato",
"text":"Solve the puzzle, and enter the password in your card inventory to unlock this teammate."
},
]
},
"pano5": {
"title": "Redpath Museum",
"author": "McGill Library",
"hfov": 200,
"yaw": 0,
"compass": true,
"autoload": true,
"type": "equirectangular",
"panorama": "https://i.imgur.com/SpytBCB.jpg",
"hotSpots": [
{
"pitch": -2.1,
"yaw": 180,
"type": "scene",
"cssClass": "directionArrow",
"text": "To Lower Campus",
"sceneId": "pano1"
},
{
//Vibert douglas puzzle
"pitch": 90,
"yaw": 0,
"type": "info",
"cssClass": "hotspotPuzzleImage",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "imageModal",
"text":"Solve the puzzle, and enter the password in your card inventory"
},
{
//Harriet Brooks puzzle
"pitch": 0,
"yaw": -100,
"type": "info",
"cssClass": "hotspotPuzzleImage",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalBrooksPuzzle",
"text":"Solve the puzzle, and enter the password in your card inventory to unlock this teammate."
},
{//'welcomeHotspot' with the image of the martlet to appear in the bottom left of every landing view. I want an info box to appear on click. How do we make that happen?
"pitch": -15,
"yaw": -30,
"type": "info",
"cssClass": "welcomeHotspot",
"clickHandlerFunc": playAudioMuseum,
"clickHandlerArgs": "redpathAudio",
"text": "Welcome to Redpath Museum. Look all around to find two of your teammates. Click here to hear more about the museum."
},
{//help hotspot
"pitch": -20,
"yaw": -50,
"type": "info",
"cssClass": "helpHotspot",
"URL": "https://sites.google.com/view/quizthatso/hints",
"text":"Hints"
},
{//easter egg redpathEgg
"pitch": -2.1,
"yaw": 95,
"type": "info",
"cssClass": "infoHotspot",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalRedpathEgg",
"text":"Find out more"
},
{//easter egg redpathEgg2
"pitch": -2.1,
"yaw": -165,
"type": "info",
"cssClass": "infoHotspot",
"clickHandlerFunc": openWindowFunc,
"clickHandlerArgs": "modalRedpathEgg2",
"text":"Find out more"
},
]
}
}});
//global vars
//modals
var modalImage = document.getElementById("imageModal");
var modalImageCompare = document.getElementById("imageModalCompare");
var modalPhilMap = document.getElementById("modalPhilMap");
var modalBrooksPuzzle = document.getElementById("modalBrooksPuzzle");
var modalMyCipher = document.getElementById("modalMyCipher");
var modalRose = document.getElementById("modalRose");
var modalPotato = document.getElementById("modalPotato");
var modalEgg1 = document.getElementById("modalEgg1");
var modalPercival = document.getElementById("modalPercival");
var modalBirksEgg2 = document.getElementById("modalBirksEgg2");
var modalCampusEgg = document.getElementById("modalCampusEgg");
var modalCampusEgg2 = document.getElementById("modalCampusEgg2");
var modalMoyseEgg = document.getElementById("modalMoyseEgg");
var modalMoyseEgg2 = document.getElementById("modalMoyseEgg2");
var modalRedpathEgg2 = document.getElementById("modalRedpathEgg2");
var modalRedpathEgg = document.getElementById("modalRedpathEgg");
var modalMolsonEgg2 = document.getElementById("modalMolsonEgg2");
//close buttons
var spanImage = document.getElementsByClassName("close1")[0];
var spanImage2 = document.getElementsByClassName("close2")[0];
var spanPhilClose = document.getElementsByClassName("close3") [0];
var spanBrooksClose = document.getElementsByClassName("close4") [0];
var spanCipherClose = document.getElementsByClassName("close5") [0];
var spanRoseClose = document.getElementsByClassName("close6") [0];
var spanEgg1Close = document.getElementsByClassName("close7") [0];
var spanPotatoClose = document.getElementsByClassName("close8") [0];
var spanPercivalClose = document.getElementsByClassName("close9") [0];
var spanBirksEgg2Close = document.getElementsByClassName("close10") [0];
var spanCampusEggClose = document.getElementsByClassName("close11") [0];
var spanCampusEgg2Close = document.getElementsByClassName("close12") [0];
var spanMoyseEggClose = document.getElementsByClassName("close13") [0];
var spanMoyseEgg2Close = document.getElementsByClassName("close14") [0];
var spanRedpathEggClose = document.getElementsByClassName("close15") [0];
var spanRedpathEgg2Close = document.getElementsByClassName("close16") [0];
var spanMolsonEgg2Close = document.getElementsByClassName("close17") [0];
//audio
var audio1 = document.getElementById("audio");
//var lowerWelcomeAudio = document.getElementById("lowerWelcomeAudio");
var redpathAudio = document.getElementById("redpathAudio");
var moyseAudio = document.getElementById("moyseAudio");
var molsonAudio = document.getElementById("molsonAudio");
var birksAudio = document.getElementById("birksAudio");
var a1IsPlaying = false;
var museumAudioIsPlay = false;
var moyseAudioIsPlay = false;
var molsonAudioIsPlay = false;
var birksAudioIsPlay = false;
//function to play audio
function playAudio(hotspotDiv, args){
if(a1IsPlaying){
audio.pause();
a1IsPlaying = false;
} else{
audio.play();
a1IsPlaying = true;
}
}
function playAudioMuseum(hotspotDiv, args){
if(museumAudioIsPlay){
redpathAudio.pause();
museumAudioIsPlay = false;
} else{
redpathAudio.play();
museumAudioIsPlay = true;
}
}
function playMoyseAudio(hotspotDiv, args){
if(moyseAudioIsPlay){
moyseAudio.pause();
moyseAudioIsPlay = false;
} else{
moyseAudio.play();
moyseAudioIsPlay = true;
}
}
function playMolsonAudio(hotspotDiv, args){
if(molsonAudioIsPlay){
molsonAudio.pause();
molsonAudioIsPlay = false;
} else{
molsonAudio.play();
molsonAudioIsPlay = true;
}
}
function playBirksAudio(hotspotDiv, args){
if(birksAudioIsPlay){
birksAudio.pause();
birksAudioIsPlay = false;
} else{
birksAudio.play();
birksAudioIsPlay = true;
}
}
//functions opens a modal
function openWindowFunc(hotSpotDiv, args){
//it takes the variable modal that we have initialized as "myModal" which is an id we
//assign in the html section
var tempModal = document.getElementById(args);
tempModal.style.display = "block";
};
spanImage.onclick = function(){
modalImage.style.display = "none";
}
spanImage2.onclick = function(){
modalImageCompare.style.display = "none";
}
spanPhilClose.onclick = function(){
modalPhilMap.style.display = "none";
}
spanBrooksClose.onclick = function(){
modalBrooksPuzzle.style.display = "none";
}
spanCipherClose.onclick = function(){
modalMyCipher.style.display = "none";
}
spanEgg1Close.onclick = function(){
modalEgg1.style.display = "none";
}
spanRoseClose.onclick = function(){
modalRose.style.display = "none";
}
spanPotatoClose.onclick = function(){
modalPotato.style.display = "none";
}
spanPercivalClose.onclick = function(){
modalPercival.style.display = "none";
}
spanBirksEgg2Close.onclick = function(){
modalBirksEgg2.style.display = "none";
}
spanCampusEggClose.onclick = function(){
modalCampusEgg.style.display = "none";
}
spanCampusEgg2Close.onclick = function(){
modalCampusEgg2.style.display = "none";
}
spanMoyseEggClose.onclick = function(){
modalMoyseEgg.style.display = "none";
}
spanMoyseEgg2Close.onclick = function(){
modalMoyseEgg2.style.display = "none";
}
spanRedpathEggClose.onclick = function(){
modalRedpathEgg.style.display = "none";
}
spanRedpathEgg2Close.onclick = function(){
modalRedpathEgg2.style.display = "none";
}
spanMolsonEgg2Close.onclick = function(){
modalMolsonEgg2.style.display = "none";
}
//function that checks for a password, enters a new site once enabled
function passWord(hotspotDiv, args) {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
//the function loops until a user gives the right password
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == "hello") {
//if the password is right, open and break the loop
window.open('passwordsite.html');
break;
}
//give at least 3 tries -> this can be changed
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1.toLowerCase()!="password" & testV ==3)
history.go(-1);
return " ";
}