-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-us"> | ||
<head> | ||
<!-- Google tag (gtag.js) --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-B0SKSRDZQK"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
|
||
gtag('config', 'G-B0SKSRDZQK'); | ||
</script> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<title>BitNaughts</title> | ||
<link rel="shortcut icon" type="image/x-icon" href="assets/bnico.ico"> | ||
<link rel="stylesheet" href="TemplateData/style.css"> | ||
</head> | ||
<body style="background-color: rgba(0, 0, 0)"> | ||
<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"><a href="https://github.com/bitnaughts" style="color:white; font-family: 'Abstract Slab'; font-weight: normal; font-style: normal;font-size: 30px">github.com/bitnaughts</a></div></div> | ||
</div> | ||
</div> | ||
<script> | ||
var buildUrl = "Build"; | ||
var loaderUrl = buildUrl + "/09202024-webgl.loader.js"; | ||
var config = { | ||
dataUrl: buildUrl + "/09202024-webgl.data.unityweb", | ||
frameworkUrl: buildUrl + "/09202024-webgl.framework.js.unityweb", | ||
codeUrl: buildUrl + "/09202024-webgl.wasm.unityweb", | ||
streamingAssetsUrl: "StreamingAssets", | ||
companyName: "BitNaughts", | ||
productName: "BitNaughts", | ||
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"); | ||
|
||
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) { | ||
container.className = "unity-mobile"; | ||
config.devicePixelRatio = 2; | ||
} else { | ||
container.className = "unity-mobile"; | ||
// canvas.style.width = "1910px"; | ||
// canvas.style.height = "880px"; | ||
} | ||
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> |