1
0
forked from sent/waves
waves/public/assets/g/slope2/index.html
2025-04-09 17:11:14 -05:00

77 lines
2.8 KiB
HTML

<!DOCTYPE html>
<html lang="en-us">
<head>
<title>Slope 2</title>
<link rel="icon" type="image/png" href="/favicon.ico" />
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" />
<script src="/js/all.min.js"></script>
</head>
<body style="width: 100%; height: 100%; margin: 0;">
<div id="unity-container" style="width: 100%; height: 100%; margin: 0;" class="unity-desktop">
<canvas id="unity-canvas" style="width: 100%; height: 100%; margin: 0;"></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-mobile-warning">
WebGL builds are not supported on mobile devices.
</div>
</div>
<script>
var buildUrl = "Build";
var loaderUrl = "WebGL2Players v1.1.loader.js";
var config = {
dataUrl: "WebGL2Players v1.1.data.unityweb",
frameworkUrl: "WebGL2Players v1.1.framework.js.unityweb",
codeUrl: "WebGL2Players v1.1.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "DefaultCompany",
productName: "Slope 2 Player",
productVersion: "1",
};
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");
var mobileWarning = document.querySelector("#unity-mobile-warning");
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
container.className = "unity-mobile";
// Avoid draining fillrate performance on mobile devices,
// and default/override low DPI mode on mobile browsers.
config.devicePixelRatio = 1;
mobileWarning.style.display = "block";
setTimeout(() => {
mobileWarning.style.display = "none";
}, 5000);
}
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) => {
console.log(message);
});
};
document.body.appendChild(script);
</script>
<script defer src="sg.min.js"></script>
</body>
</html>