1
0
forked from sent/waves
waves-fork/public/assets/g/pako/index.html
2025-04-17 20:43:10 -05:00

72 lines
2.4 KiB
HTML

<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Pako Highway</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
</head>
<body>
<div id="unity-container" class="unity-desktop">
<canvas id="unity-canvas"></canvas>
<div id="unity-loading-bar">
<div id="unity-logo"></div>
<div id="unity-progress-bar-empty">
<div id="unity-progress-bar-full"></div>
</div>
</div>
<div id="unity-footer">
<div id="unity-webgl-logo"></div>
<div id="unity-fullscreen-button"></div>
<div id="unity-build-title">Pako Highway</div>
</div>
</div>
<script>
var buildUrl = "Build";
var loaderUrl = buildUrl + "/phhh.loader.js";
var config = {
dataUrl: buildUrl + "/phhh.data",
frameworkUrl: buildUrl + "/phhh.framework.js",
codeUrl: buildUrl + "/phhh.wasm",
streamingAssetsUrl: "StreamingAssets",
companyName: "Tree Men Games",
productName: "Pako Highway",
productVersion: "1.0",
};
var container = document.querySelector("#unity-container");
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var fullscreenButton = document.querySelector("#unity-fullscreen-button");
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
container.className = "unity-mobile";
config.devicePixelRatio = 1;
} else {
canvas.style.width = "960px";
canvas.style.height = "540px";
}
loadingBar.style.display = "block";
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
loadingBar.style.display = "none";
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}).catch((message) => {
alert(message);
});
};
document.body.appendChild(script);
</script>
</body>
</html>