-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.htm
343 lines (294 loc) · 13.8 KB
/
index.htm
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>The Cafe</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" id="metaViewport" content="user-scalable=no, initial-scale=1, width=device-width, viewport-fit=cover" data-tdv-general-scale="0.5"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<script src="lib/tdvplayer.js?v=1675285454109"></script>
<link rel="shortcut icon" href="favicon.ico?v=1675285454109">
<link rel="icon" sizes="48x48 32x32 16x16" href="favicon.ico?v=1675285454109">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="misc/icon180.png?v=1675285454109">
<link rel="icon" type="image/png" sizes="16x16" href="misc/icon16.png?v=1675285454109">
<link rel="icon" type="image/png" sizes="32x32" href="misc/icon32.png?v=1675285454109">
<link rel="icon" type="image/png" sizes="192x192" href="misc/icon192.png?v=1675285454109">
<link rel="manifest" href="manifest.json?v=1675285454109">
<meta name="msapplication-TileColor" content="#FFFFFF">
<meta name="msapplication-config" content="browserconfig.xml">
<link rel="preload" href="locale/en.txt?v=1675285454109" as="fetch" crossorigin="anonymous"/>
<link rel="preload" href="script.js?v=1675285454109" as="script"/>
<meta name="description" content="Virtual Tour"/>
<meta name="theme-color" content="#FFFFFF"/>
<script src="script.js?v=1675285454109"></script>
<script type="text/javascript">
var tour;
var devicesUrl = {"general":"script_general.js?v=1675285454109"};
(function()
{
var deviceType = ['general'];
if(TDV.PlayerAPI.mobile)
deviceType.unshift('mobile');
if(TDV.PlayerAPI.device == TDV.PlayerAPI.DEVICE_IPAD)
deviceType.unshift('ipad');
var url;
for(var i=0; i<deviceType.length; ++i) {
var d = deviceType[i];
if(d in devicesUrl) {
url = devicesUrl[d];
break;
}
}
if(typeof url == "object") {
var orient = TDV.PlayerAPI.getOrientation();
if(orient in url) {
url = url[orient];
}
}
var link = document.createElement('link');
link.rel = 'preload';
link.href = url;
link.as = 'script';
var el = document.getElementsByTagName('script')[0];
el.parentNode.insertBefore(link, el);
})();
function loadTour()
{
if(tour) return;
if (/AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent)) {
var preloadContainer = document.getElementById('preloadContainer');
if(preloadContainer)
document.body.style.backgroundColor = window.getComputedStyle(preloadContainer).backgroundColor;
}
var settings = new TDV.PlayerSettings();
settings.set(TDV.PlayerSettings.CONTAINER, document.getElementById('viewer'));
settings.set(TDV.PlayerSettings.WEBVR_POLYFILL_URL, 'lib/WebVRPolyfill.js?v=1675285454109');
settings.set(TDV.PlayerSettings.HLS_URL, 'lib/Hls.js?v=1675285454109');
settings.set(TDV.PlayerSettings.QUERY_STRING_PARAMETERS, 'v=1675285454109');
tour = new TDV.Tour(settings, devicesUrl);
tour.bind(TDV.Tour.EVENT_TOUR_INITIALIZED, onVirtualTourInit);
tour.bind(TDV.Tour.EVENT_TOUR_LOADED, onVirtualTourLoaded);
tour.bind(TDV.Tour.EVENT_TOUR_ENDED, onVirtualTourEnded);
tour.load();
}
function pauseTour()
{
if(!tour)
return;
tour.pause();
}
function resumeTour()
{
if(!tour)
return;
tour.resume();
}
function onVirtualTourInit()
{
var updateTexts = function() {
document.title = this.trans("tour.name")
};
tour.locManager.bind(TDV.Tour.LocaleManager.EVENT_LOCALE_CHANGED, updateTexts.bind(tour.locManager));
if (tour.player.cookiesEnabled)
enableCookies();
else
tour.player.bind('enableCookies', enableCookies);
}
function onVirtualTourLoaded()
{
disposePreloader();
}
function onVirtualTourEnded()
{
}
function enableCookies()
{
}
function setMediaByIndex(index) {
if(!tour)
return;
tour.setMediaByIndex(index);
}
function setMediaByName(name)
{
if(!tour)
return;
tour.setMediaByName(name);
}
function showPreloader()
{
var preloadContainer = document.getElementById('preloadContainer');
if(preloadContainer != undefined)
preloadContainer.style.opacity = 1;
}
function disposePreloader()
{
var preloadContainer = document.getElementById('preloadContainer');
if(preloadContainer == undefined)
return;
var transitionEndName = transitionEndEventName();
if(transitionEndName)
{
preloadContainer.addEventListener(transitionEndName, hide, false);
preloadContainer.style.opacity = 0;
setTimeout(hide, 500); //Force hide. Some cases the transitionend event isn't dispatched with an iFrame.
}
else
{
hide();
}
function hide()
{
document.body.style.backgroundColor = window.getComputedStyle(preloadContainer).backgroundColor;
preloadContainer.style.visibility = 'hidden';
preloadContainer.style.display = 'none';
var videoList = preloadContainer.getElementsByTagName("video");
for(var i=0; i<videoList.length; ++i)
{
var video = videoList[i];
video.pause();
while (video.children.length)
video.removeChild(video.children[0]);
}
}
function transitionEndEventName () {
var el = document.createElement('div');
var transitions = {
'transition':'transitionend',
'OTransition':'otransitionend',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
};
var t;
for (t in transitions) {
if (el.style[t] !== undefined) {
return transitions[t];
}
}
return undefined;
}
}
function onBodyClick(){
document.body.removeEventListener("click", onBodyClick);
document.body.removeEventListener("touchend", onBodyClick);
}
function onLoad() {
if (/AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent))
{
var onOrientationChange = function()
{
document.documentElement.style.height = 'initial';
Array.from(document.querySelectorAll('.fill-viewport')).forEach(function(element)
{
element.classList.toggle('landscape-right', window.orientation == -90);
element.classList.toggle('landscape-left', window.orientation == 90);
});
setTimeout(function()
{
document.documentElement.style.height = '100%';
}, 500);
};
window.addEventListener('orientationchange', onOrientationChange);
onOrientationChange();
}
var params = getParams(location.search.substr(1));
if(params.hasOwnProperty("skip-loading"))
{
loadTour();
disposePreloader();
return;
}
if (isOVRWeb()){
showPreloader();
loadTour();
return;
}
showPreloader();
loadTour();
}
function playVideo(video, autoplayMuted, clickComponent) {
function isSafariDesktopV11orGreater() {
return /^((?!chrome|android|crios|ipad|iphone).)*safari/i.test(navigator.userAgent) && parseFloat(/Version\/([0-9]+\.[0-9]+)/i.exec(navigator.userAgent)[1]) >= 11;
}
function hasAudio (video) {
return video.mozHasAudio ||
Boolean(video.webkitAudioDecodedByteCount) ||
Boolean(video.audioTracks && video.audioTracks.length);
}
function detectUserAction() {
var component = clickComponent || document.getElementById('preloadContainer');
var onVideoClick = function(e) {
if(video.paused) {
video.play();
}
video.muted = false;
if(hasAudio(video))
{
e.stopPropagation();
e.stopImmediatePropagation();
e.preventDefault();
}
component.removeEventListener('click', onVideoClick);
component.removeEventListener('touchend', onVideoClick);
if(component == clickComponent) {
setComponentVisibility(false);
}
};
component.addEventListener("click", onVideoClick);
component.addEventListener("touchend", onVideoClick);
}
function setComponentVisibility(visible) {
clickComponent.style.visibility = visible ? 'visible' : 'hidden';
}
if (isSafariDesktopV11orGreater()) {
if(autoplayMuted) {
video.muted = true;
video.play();
}
} else {
var canPlay = true;
var promise = video.play();
if (promise) {
promise.catch(function() {
if(clickComponent)
setComponentVisibility(true);
canPlay = false;
if(autoplayMuted) {
video.muted = true;
video.play();
}
detectUserAction();
});
} else {
canPlay = false;
}
if (!canPlay || video.muted) {
detectUserAction();
} else if(clickComponent) {
setComponentVisibility(false);
}
}
}
function isOVRWeb(){
return window.location.hash.substring(1).split('&').indexOf('ovrweb') > -1;
}
function getParams(params) {
var queryDict = {}; params.split("&").forEach(function(item) {var k = item.split("=")[0], v = decodeURIComponent(item.split("=")[1]);queryDict[k.toLowerCase()] = v});
return queryDict;
}
document.addEventListener('DOMContentLoaded', onLoad);
</script>
<style type="text/css">
html, body { height:100%; width:100%; height:100vh; width:100vw; margin:0; padding:0; overflow:hidden; }
.fill-viewport { position:fixed; top:0; left:0; right:0; bottom:0; padding:0; margin:0; overflow: hidden; }
.fill-viewport.landscape-left { left: env(safe-area-inset-left); }
.fill-viewport.landscape-right { right: env(safe-area-inset-right); }
#viewer { z-index:1; }
#preloadContainer { z-index:2; opacity:0; background-color:rgba(255,255,255,1); transition: opacity 0.5s; -webkit-transition: opacity 0.5s; -moz-transition: opacity 0.5s; -o-transition: opacity 0.5s;}
</style>
</head>
<body>
<div id="preloadContainer" class="fill-viewport"><div style="z-index: 4; position: absolute; left: 0%; top: 44.23%; width: 100.00%; height: 24.84%" ><div style="text-align:left; color:#000; "><DIV STYLE="text-align:center;font-size:6.028833551769331vmin;"><SPAN STYLE="display:inline-block; letter-spacing:0vmin; white-space:pre-wrap;color:#777777;font-family:Arial, Helvetica, sans-serif;"><SPAN STYLE="color:#000000;font-size:6.03vmin;font-family:Impact, Charcoal, sans-serif;">Loading The Café</SPAN></SPAN></DIV><p STYLE="margin:0; line-height:6.03vmin;"><BR STYLE="display:inline-block; letter-spacing:0vmin; white-space:pre-wrap;color:#777777;font-size:1.67vmin;font-family:Arial, Helvetica, sans-serif;"/></p><DIV STYLE="text-align:center;font-size:6.028833551769331vmin;"><SPAN STYLE="display:inline-block; letter-spacing:0vmin; white-space:pre-wrap;color:#777777;font-family:Arial, Helvetica, sans-serif;"><SPAN STYLE="color:#000000;font-size:6.03vmin;font-family:Impact, Charcoal, sans-serif;"> Please wait...</SPAN></SPAN></DIV></div></div></div>
<div id="viewer" class="fill-viewport"></div>
</body>
</html>