Skip to content

Commit

Permalink
Deploying to gh-pages from @ e62d37d 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
tolstenko committed Apr 3, 2024
0 parents commit 2f81ae0
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 0 deletions.
Binary file added Build/WebGL.data.unityweb
Binary file not shown.
Binary file added Build/WebGL.framework.js.unityweb
Binary file not shown.
1 change: 1 addition & 0 deletions Build/WebGL.loader.js

Large diffs are not rendered by default.

Binary file added Build/WebGL.wasm.unityweb
Binary file not shown.
1 change: 1 addition & 0 deletions StreamingAssets/UnityServicesProjectConfiguration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Keys":["com.unity.services.core.version","com.unity.services.core.initializer-assembly-qualified-names","com.unity.services.core.all-package-names"],"Values":[{"m_Value":"1.6.0","m_IsReadOnly":true},{"m_Value":"Unity.Services.Core.Registration.CorePackageInitializer, Unity.Services.Core.Registration, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_IsReadOnly":true},{"m_Value":"com.unity.services.core","m_IsReadOnly":false}]}
Binary file added TemplateData/favicon.ico
Binary file not shown.
Binary file added TemplateData/fullscreen-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 105 additions & 0 deletions TemplateData/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
html, body {
height: 100%;
}
canvas {
display: block;
}
body {
margin: 0;
}
#unity-container {
width: 100%;
height: 100%;
}
#unity-canvas {
width: 100%;
height: 100%;
background: #231F20;
}
#loading-cover {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
#unity-loading-bar {
flex: 1 1 auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#unity-logo {
text-align: center;
}
#unity-logo img {
max-width: 80%;
}
#unity-progress-bar-empty {
width: 80%;
height: 24px;
margin: 10px 20px 20px 10px;
text-align: left;
border: 1px solid white;
padding: 2px;
}
#unity-progress-bar-full {
width: 0%;
height: 100%;
background: white;
}
.light #unity-progress-bar-empty {
border-color: black;
}
.light #unity-progress-bar-full {
background: black;
}

#unity-fullscreen-button {
position: absolute;
right: 10px;
bottom: 10px;
width: 38px;
height: 38px;
background: url('fullscreen-button.png') no-repeat center;
background-size: contain;
}

.spinner,
.spinner:after {
border-radius: 50%;
width: 5em;
height: 5em;
}
.spinner {
margin: 10px;
font-size: 10px;
position: relative;
text-indent: -9999em;
border-top: 1.1em solid rgba(255, 255, 255, 0.2);
border-right: 1.1em solid rgba(255, 255, 255, 0.2);
border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
border-left: 1.1em solid #ffffff;
transform: translateZ(0);
animation: spinner-spin 1.1s infinite linear;
}
@keyframes spinner-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}


92 changes: 92 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>DocDoViewer</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
</head>
<body class="dark">
<div id="unity-container" class="unity-desktop">
<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 = "";
const buildUrl = "Build";
const loaderUrl = buildUrl + "/WebGL.loader.js";
const config = {
dataUrl: buildUrl + "/WebGL.data.unityweb",
frameworkUrl: buildUrl + "/WebGL.framework.js.unityweb",
codeUrl: buildUrl + "/WebGL.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "InfiniBrains",
productName: "DocDoViewer",
productVersion: "0.0.19",
};

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;
}
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>
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2f81ae0

Please sign in to comment.