Spaces:
Running
Running
File size: 10,171 Bytes
e0293f8 63d06f7 e0293f8 f526bf0 e0293f8 63d06f7 e0293f8 63d06f7 f526bf0 63d06f7 f526bf0 63d06f7 f526bf0 e0293f8 63d06f7 5f467ac 63d06f7 e0293f8 f526bf0 e0293f8 63d06f7 e0293f8 f526bf0 e0293f8 f526bf0 e0293f8 f526bf0 e0293f8 f526bf0 e0293f8 f526bf0 e0293f8 f526bf0 e0293f8 f526bf0 e0293f8 f526bf0 e0293f8 56c3d77 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
<!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>Echoes in the Dark</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico" />
<link rel="stylesheet" href="TemplateData/style.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap"
rel="stylesheet"
/>
<style>
body,
#unity-canvas,
#loading-cover {
background-color: #000000;
}
#unity-loading-bar,
#unity-logo,
#unity-progress-bar-empty,
.spinner {
display: none !important;
}
#loading-text {
color: white;
font-family: "Bebas Neue", Arial, sans-serif;
font-size: 40px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -100%);
text-align: center;
max-width: 80%;
line-height: 1.5;
margin-bottom: 10px;
}
#loading-cover {
transition: opacity 1.5s ease-in-out;
}
.fade-out {
opacity: 0;
}
#hf-logo {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
width: 50px;
height: auto;
}
/* Start Game Button Styles */
#start-game-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #000000;
display: none;
justify-content: center;
align-items: center;
z-index: 100;
}
#start-game-button {
font-family: "Bebas Neue", Arial, sans-serif;
font-size: 32px;
padding: 15px 40px;
color: white;
background-color: transparent;
border: 2px solid white;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
}
#start-game-button:hover {
background-color: rgba(255, 255, 255, 0.1);
transform: scale(1.05);
}
</style>
</head>
<body class="dark">
<div id="unity-container" class="unity-desktop">
<canvas id="unity-canvas"></canvas>
</div>
<div id="loading-cover" style="display: none; background-color: #000000">
<div class="loading-content">
<div id="loading-text">Echoes in the Dark</div>
<img
id="hf-logo"
src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-pirate.png"
alt="Hugging Face Logo"
/>
</div>
</div>
<div id="start-game-container">
<button id="start-game-button">START GAME</button>
<audio
id="audio-element"
src="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4Ljc2LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAAAwAAAbsAVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVA=="
type="audio/mp3"
></audio>
</div>
<div id="unity-fullscreen-button" style="display: none"></div>
<a
target="_blank"
href="https://jam.pieter.com"
style="
font-family: 'system-ui', sans-serif;
position: fixed;
bottom: -1px;
right: -1px;
padding: 7px;
font-size: 14px;
font-weight: bold;
background: #fff;
color: #000;
text-decoration: none;
z-index: 10;
border-top-left-radius: 12px;
z-index: 10000;
border: 1px solid #fff;
"
>🕹️ Vibe Jam 2025</a
>
<script>
const hideFullScreenButton = "1";
const buildUrl = "Build";
const loaderUrl = buildUrl + "/Build.loader.js";
const config = {
dataUrl: buildUrl + "/Build.data",
frameworkUrl: buildUrl + "/Build.framework.js",
codeUrl: buildUrl + "/Build.wasm",
streamingAssetsUrl: "StreamingAssets",
companyName: "IndividualKex",
productName: "Echoes in the Dark",
productVersion: "0.1.0",
};
const container = document.querySelector("#unity-container");
const canvas = document.querySelector("#unity-canvas");
const loadingCover = document.querySelector("#loading-cover");
const fullscreenButton = document.querySelector("#unity-fullscreen-button");
const startGameContainer = document.querySelector("#start-game-container");
const startGameButton = document.querySelector("#start-game-button");
const audioElement = document.querySelector("#audio-element");
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 = "";
// Set minimum display time (3 seconds)
const minDisplayTime = 3000; // milliseconds
let loadingStartTime = Date.now();
let loadingFinished = false;
let minTimeElapsed = false;
let unityInstance = null;
// Function to check if we can show the start button
function tryShowStartButton() {
if (loadingFinished && minTimeElapsed) {
loadingCover.classList.add('fade-out');
setTimeout(() => {
loadingCover.style.display = "none";
loadingCover.classList.remove('fade-out');
startGameContainer.style.display = "flex";
}, 1500); // Match the CSS transition time
}
}
// Start the minimum display time timer
setTimeout(() => {
minTimeElapsed = true;
tryShowStartButton();
}, minDisplayTime);
// Initialize Unity
function initUnity() {
if (unityInstance) return; // Prevent multiple initializations
createUnityInstance(canvas, config, (progress) => {
// No progress visualization needed
}).then((instance) => {
unityInstance = instance;
if (canFullscreen) {
if (!hideFullScreenButton) {
fullscreenButton.style.display = "";
}
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}
}).catch((message) => {
alert(message);
});
}
// Start button click handler
startGameButton.addEventListener('click', () => {
// Play silent audio to unlock audio on Safari
audioElement.play().catch(error => console.log("Audio play failed:", error));
// Hide start button container
startGameContainer.style.display = "none";
// Initialize Unity if not already done
initUnity();
});
const script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
// Signal that loading is finished
loadingFinished = true;
tryShowStartButton();
};
document.body.appendChild(script);
</script>
</body>
</html>
|