-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
80 lines (74 loc) · 2.92 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>idx-audiovis | idx-peerplay-AudioVisTut</title>
<meta name="description" content="Check out this audio visualizer">
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="webvr.css">
<script src="Build/UnityLoader.js"></script>
<script>
/* global UnityLoader */
(function () {
UnityLoader.SystemInfo.mobile = false; // Workaround to force `UnityLoader` to actually load on mobile.
window.gameInstance = UnityLoader.instantiate('gameContainer', 'Build/webvr.json', {
Module: {
// `preserveDrawingBuffer` is needed for WebVR content to be mirrored to the `<canvas>`.
webglContextAttributes: {
preserveDrawingBuffer: true
}
},
onProgress: unityProgress
});
function unityProgress (gameInstance, progress) {
if (!gameInstance.progress) {
gameInstance.loader = document.getElementById('loader');
gameInstance.progress = document.getElementById('progress');
gameInstance.loading = document.getElementById('loading');
}
gameInstance.progress.style.width = (100 * progress) + '%';
if (progress === 1) {
document.dispatchEvent(new CustomEvent('UnityLoaded'));
}
}
})();
</script>
<link rel="manifest" href="manifest.webmanifest">
</head>
<body>
<div id="loader">
<div id="loading" class="loading">Loading</div>
<div id="progress" class="progress"></div>
</div>
<div id="game">
<div id="gameContainer"></div>
</div>
<div id="instruction">
<div id="novr" class="panel center">
<h3>You’ll need a <a href="https://webvr.rocks/">WebVR-enabled browser</a> and VR headset to fully enjoy this experience.</h3>
<p><img src="mousedrag.png" width="70" alt="Click-and-drag your mouse"></p>
<p>In the meantime, <strong><em>click and drag</em></strong> to have a look around!</p>
<p>
<button class="confirm">Continue</button>
</p>
</div>
</div>
<div id="vr">
<div id="status">
<strong>Ready!</strong>
<div id="icons">
<img src="vr.png" height="36" alt="VR icon">
<template id="motion-controller">
<img src="motion-controllers.png" height="33" alt="Motion Controller icon">
</template>
</div>
<small><a href="https://webvr.rocks/">Not working?</a></small>
</div>
<button id="entervr" value="Enter VR"></button>
</div>
<script src="gl-matrix-min.js"></script>
<script src="webvr-polyfill.min.js"></script>
<script src="webvr.js"></script>
</body>
</html>