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

86 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="/js/all.min.js"></script>
<meta charset="utf8" />
<style>
@import url(https://fonts.googleapis.com/css2?family=Inconsolata&display=swap);
body {
background: #000;
margin: 0;
width: 100vw;
height: 100vh;
display: flex;
}
.container {
display: inline-block;
position: fixed;
margin: auto !important;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100vw;
height: 100vh;
z-index: 1;
}
.container canvas {
width: 100%;
height: 100%;
}
.info {
z-index: 5;
padding: 25px;
background: #fff;
border: 1px solid #000;
margin: auto;
position: relative;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: flex;
align-content: center;
align-items: center;
justify-content: space-evenly;
gap: 15px;
color: #777;
font-family: Inconsolata, monospace;
user-select: none;
}
.info .desc {
font-weight: 700;
}
.bar {
width: 150px;
height: 10px;
background: #eee;
border: 1px solid #bbb;
display: block;
}
.bar .fill {
height: 100%;
background: #07d;
outline: 1px solid #37a;
display: block;
z-index: 7;
}
</style>
</head>
<body>
<div class="info">
<div class="desc">Downloading data...</div>
<div class="bar"><div class="fill"></div></div>
</div>
<div
class="container"
id="container"></div>
<script src="unity.js"></script>
<script>
var info = { wrap: document.querySelector(".info"), bar: document.querySelector(".info .bar .fill") };
UnityLoader.instantiate("container", { companyName: "Wix Games", productName: "Duck Life", dataUrl: "WebGL1Coolmath.data.unityweb", asmCodeUrl: "WebGL1Coolmath.asm.code.unityweb", asmMemoryUrl: "WebGL1Coolmath.asm.memory.unityweb", asmFrameworkUrl: "WebGL1Coolmath.asm.framework.unityweb", TOTAL_MEMORY: 268435456, graphicsAPI: ["WebGL 2.0", "WebGL 1.0"], webglContextAttributes: { preserveDrawingBuffer: false }, splashScreenStyle: "Dark", backgroundColor: "#000" }, { onProgress: (unity, progress) => ((info.bar.style.width = progress * 100 + "%"), progress == 1 && info.wrap.remove()) });
</script>
</body>
</html>