-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcam2.html
148 lines (144 loc) · 4.62 KB
/
cam2.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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Virtuális háztúra</title>
<link rel="stylesheet" href="/css/pannellum.css"/>
<script type="text/javascript" src="/js/pannellum.js"></script>
<link rel="stylesheet" href="/css/cam.css">
</head>
<body>
<div id="panorama">
<div id="minimap">
<div class="cam cam1"></div>
<div class="cam cam2"></div>
<div class="cam cam3"></div>
<div class="cam cam4"></div>
<div class="cam cam5"></div>
<div class="cam cam6"></div>
<div class="cam cam7"></div>
<div class="cam cam8"></div>
<div class="cam cam9"></div>
</div>
<div id="fszhistory">
<span id="close" onclick="this.parentNode.style.display='none'; return false;">x</span>
<div class="fsz-hotspot fsz1"></div>
<div class="fsz-hotspot fsz2"></div>
<div class="fsz-hotspot fsz3"></div>
<div class="fsz-hotspot fsz4"></div>
<div class="fsz-hotspot fsz5"></div>
<div class="fsz-hotspot fsz6"></div>
<div class="fsz-hotspot fsz7"></div>
<div class="fsz-hotspot fsz8"></div>
<div class="fsz-hotspot fsz9"></div>
<div class="fsz-hotspot fsz10"></div>
</div>
</div>
<script>
var hs = document.getElementById('fszhistory');
function loadJSON(url, callback) {
var xobj = new XMLHttpRequest();
xobj.overrideMimeType("application/json");
xobj.open('GET', url, true);
xobj.onreadystatechange = function () {
if (xobj.readyState == 4 && xobj.status == "200") {
callback(xobj.responseText);
}
};
xobj.send(null);
}
function fszhistory(hotSpotDiv, args){
hs.style.display = "flex";
}
loadJSON("scenes.json", function(response) {
// Parse JSON string into object
var myscenes = JSON.parse(response);
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const cam = urlParams.get('cam');
switch(urlParams.get('cam')){
case "1": myscenes.default.firstScene="nappali"; break;
case "2": myscenes.default.firstScene="haloszoba"; break;
case "3": myscenes.default.firstScene="furdoszoba"; break;
case "4": myscenes.default.firstScene="folyoso"; break;
case "5": myscenes.default.firstScene="szoba"; break;
case "6": myscenes.default.firstScene="eloter"; break;
case "7": myscenes.default.firstScene="konyha"; break;
case "8": myscenes.default.firstScene="etkezo"; break;
case "9": myscenes.default.firstScene="lepcsohaz"; break;
case "10": myscenes.default.firstScene="emelet"; break;
case "11": myscenes.default.firstScene="emszoba1"; break;
case "12": myscenes.default.firstScene="emszoba2"; break;
}
var viewer = pannellum.viewer('panorama', myscenes);
document.querySelectorAll('.cam').forEach(function(item){
item.addEventListener('click', function(event){
hs.style.display='none';
if (event.target.classList.contains('cam1')){
viewer.loadScene('nappali');
}
if (event.target.classList.contains('cam2')){
viewer.loadScene('haloszoba');
}
if (event.target.classList.contains('cam3')){
viewer.loadScene('furdoszoba');
}
if (event.target.classList.contains('cam4')){
viewer.loadScene('folyoso');
}
if (event.target.classList.contains('cam5')){
viewer.loadScene('szoba');
}
if (event.target.classList.contains('cam6')){
viewer.loadScene('eloter');
}
if (event.target.classList.contains('cam7')){
viewer.loadScene('konyha');
}
if (event.target.classList.contains('cam8')){
viewer.loadScene('etkezo');
}
if (event.target.classList.contains('cam9')){
viewer.loadScene('lepcsohaz');
}
});
});
document.querySelectorAll('.fsz-hotspot').forEach(function(item){
item.addEventListener('click', function(event){
if (event.target.classList.contains('fsz1')){
viewer.loadScene('fsz1');
}
if (event.target.classList.contains('fsz2')){
viewer.loadScene('fsz2');
}
if (event.target.classList.contains('fsz3')){
viewer.loadScene('fsz3');
}
if (event.target.classList.contains('fsz4')){
viewer.loadScene('fsz4');
}
if (event.target.classList.contains('fsz5')){
viewer.loadScene('fsz5');
}
if (event.target.classList.contains('fsz6')){
viewer.loadScene('fsz6');
}
if (event.target.classList.contains('fsz7')){
viewer.loadScene('fsz7');
}
if (event.target.classList.contains('fsz8')){
viewer.loadScene('fsz8');
}
if (event.target.classList.contains('fsz9')){
viewer.loadScene('fsz9');
}
if (event.target.classList.contains('fsz10')){
viewer.loadScene('fsz10');
}
});
});
});
</script>
</body>
</html>