-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
144 lines (127 loc) · 5.34 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
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>GameName Virtual Art Gallery</title>
<link rel="shortcut icon" href="TemplateData/img/favicon.ico">
<link rel="stylesheet" href="TemplateData/css/style.css">
<script src="Build/UnityLoader.js"></script>
<script>
function ToggleFullScreen() {
var isInFullScreen = (document.fullscreenElement && document.fullscreenElement !== null) ||
(document.webkitFullscreenElement && document.webkitFullscreenElement !== null) ||
(document.mozFullScreenElement && document.mozFullScreenElement !== null) ||
(document.msFullscreenElement && document.msFullscreenElement !== null);
var element = document.body.getElementsByClassName("webgl-content")[0];
if (!isInFullScreen) {
document.getElementById("fullScreenButton").style.backgroundImage="url('TemplateData/img/fullScreen_off.png')";
return (element.requestFullscreen ||
element.webkitRequestFullscreen ||
element.mozRequestFullScreen ||
element.msRequestFullscreen).call(element);
}
else {
document.getElementById("fullScreenButton").style.backgroundImage="url('TemplateData/img/fullScreen_on.png')";
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
}
function CheckCompatibility(gameInstance, onsuccess, onerror)
{
if (!UnityLoader.SystemInfo.hasWebGL) {
document.getElementById("errorBrowserBlock").style.display = "inherit";
onerror();
} else if (UnityLoader.SystemInfo.mobile) {
document.getElementById("warningMobileBlock").style.display = "inherit";
onsuccess();
} else if (["Firefox", "Chrome", "Safari"].indexOf(UnityLoader.SystemInfo.browser) == -1) {
document.getElementById("warningBrowserBlock").style.display = "inherit";
onsuccess();
} else {
onsuccess();
}
}
function RuntimeInitialized(){
}
function UnityProgress(gameInstance, progress) {
if (!gameInstance.Module)
return;
document.getElementById("loadingBlock").style.display = "inherit";
document.getElementById("fullBar").style.width = (100 * progress) + "%";
document.getElementById("emptyBar").style.width = (100 * (1 - progress)) + "%";
if (progress == 1)
{
setTimeout(function(){ document.getElementById("loadingBlock").style.display = "none"; }, 3000);
}
}
var gameInstance = UnityLoader.instantiate("gameContainer", "Build/WebGl.json", {
onProgress: UnityProgress,
compatibilityCheck:CheckCompatibility,
Module: {
//TOTAL_MEMORY: 268435456,
onRuntimeInitialized:RuntimeInitialized,
},
});
</script>
</head>
<body>
<div class="keepRatio">
<div class="webgl-content">
<button id="fullScreenButton" onclick="ToggleFullScreen()"></button>
<div id="gameContainer"></div>
</div>
<div id="loadingBlock">
<img class="logo" src="TemplateData/img/Logo.png"></img>
<span class="subtitle"> CATCHPHRASE <br>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</span>
<div id="progressBar">
<div>LOADING ...</div>
<div class="centered">
<div id="emptyBar"></div>
<div id="fullBar"></div>
</div>
</div>
<div id="warningBrowserBlock" style="display:none;">
<div class="warningBrowserText">
Your browser may not be compatible with this website. For an optimal experience, we suggest you to download one of this popular web browsers.
</div>
<div class="browserIcons">
<a href="https://www.mozilla.org/firefox" target="_blank"><img src="TemplateData/img/browser-firefox.png" alt="Firefox browser"></a>
<a href="https://www.google.com/chrome" target="_blank"><img src="TemplateData/img/browser-chrome.png" alt="Chrome browser"></a>
<a href="https://www.apple.com/safari/" target="_blank"><img src="TemplateData/img/browser-safari.png" alt="Safari browser"></a>
</div>
</div>
<div id="warningMobileBlock" style="display:none;">
<div class="warningBrowserText">
Please note that Unity WebGL is not currently supported on mobiles.
</div>
</div>
</div>
<div id="errorBrowserBlock" style="display:none;">
<img class="logo" src="TemplateData/img/Logo.png"></img>
<span class="subtitle"> CATCHPHRASE <br>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</span>
<div id="errorContent">
<div id="errorBrowserText">
Your browser does not support WebGL. <br> You can download one of this popular web browsers.
</div>
<div class="browserIcons">
<a href="https://www.mozilla.org/firefox" target="_blank"><img src="TemplateData/img/browser-firefox.png" alt="Firefox browser"></a>
<a href="https://www.google.com/chrome" target="_blank"><img src="TemplateData/img/browser-chrome.png" alt="Chrome browser"></a>
<a href="https://www.apple.com/safari/" target="_blank"><img src="TemplateData/img/browser-safari.png" alt="Safari browser"></a>
</div>
</div>
</div>
</div>
</body>
</html>