Files
monkeygg2.github.io/games/time-shooter-3/index.html
T
2023-09-25 19:51:08 -04:00

106 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html lang="en-us">
<head>
<!-- Google tag (gtag.js) -->
<script async="" src="https://www.googletagmanager.com/gtag/js?id=G-7L02W3ZMS5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-7L02W3ZMS5');
</script>
<script async="" crossorigin="anonymous" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5648726754785335"></script>
<meta charset="utf-8"/>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport"/>
<title>Time Shooter SWAT</title>
<link href="TemplateData/favicon.ico" rel="shortcut icon"/>
<link href="TemplateData/style.css" rel="stylesheet"/>
</head>
<body class="dark">
<div class="unity-desktop" id="unity-container">
<canvas id="unity-canvas"></canvas>
</div>
<div id="loading-cover" style="display:none;">
<div id="unity-loading-bar">
<div id="unity-logo"><img src="logo.png"/></div>
<div id="unity-progress-bar-empty" style="display: none;">
<div id="unity-progress-bar-full"></div>
</div>
<div class="spinner"></div>
</div>
</div>
<div id="unity-fullscreen-button" style="display: none;"></div>
<script>
const hideFullScreenButton = "1";
const buildUrl = "Build";
const loaderUrl = buildUrl + "/UnityLoader.js";
const config = {
dataUrl: buildUrl + "/TimeShooter3_GD.data.unityweb",
frameworkUrl: buildUrl + "/TimeShooter3_GD.framework.js.unityweb",
codeUrl: buildUrl + "/TimeShooter3_GD.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "GoGoMan",
productName: "Time Shooter SWAT",
productVersion: "0.03",
};
const container = document.querySelector("#unity-container");
const canvas = document.querySelector("#unity-canvas");
const loadingCover = document.querySelector("#loading-cover");
const progressBarEmpty = document.querySelector("#unity-progress-bar-empty");
const progressBarFull = document.querySelector("#unity-progress-bar-full");
const fullscreenButton = document.querySelector("#unity-fullscreen-button");
const spinner = document.querySelector('.spinner');
const canFullscreen = (function() {
for (const key of [
'exitFullscreen',
'webkitExitFullscreen',
'webkitCancelFullScreen',
'mozCancelFullScreen',
'msExitFullscreen',
]) {
if (key in document) {
return true;
}
}
return false;
}());
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
container.className = "unity-mobile";
config.devicePixelRatio = 1;
}
canvas.style.background = "url('" + buildUrl + "/TimeShooter3_GD.jpg') center / cover";
loadingCover.style.display = "";
const script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
spinner.style.display = "none";
progressBarEmpty.style.display = "";
progressBarFull.style.width = `${100 * progress}%`;
}).then((unityInstance) => {
loadingCover.style.display = "none";
if (canFullscreen) {
if (!hideFullScreenButton) {
fullscreenButton.style.display = "";
}
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}
}).catch((message) => {
alert(message);
});
};
document.body.appendChild(script);
</script>
</body>
</html>