459 lines
15 KiB
HTML
459 lines
15 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
|
|
<head>
|
|
|
|
<meta charset='utf-8' />
|
|
<meta name='viewport' content='width=device-width, user-scalable=no' />
|
|
<title>The Minions Resurrection</title>
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap">
|
|
|
|
<style type='text/css'>
|
|
|
|
body {
|
|
touch-action: none;
|
|
margin: 0;
|
|
border: 0 none;
|
|
padding: 0;
|
|
text-align: center;
|
|
background-color: black;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.background {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background-size: cover;
|
|
z-index: -2;
|
|
}
|
|
|
|
|
|
#canvas {
|
|
display: block;
|
|
margin: 0;
|
|
color: white;
|
|
}
|
|
|
|
#canvas:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.godot {
|
|
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
|
|
color: #e0e0e0;
|
|
background-color: #3b3943;
|
|
background-image: linear-gradient(to bottom, #403e48, #35333c);
|
|
border: 1px solid #45434e;
|
|
box-shadow: 0 0 1px 1px #2f2d35;
|
|
}
|
|
|
|
|
|
/* Status display
|
|
* ============== */
|
|
|
|
#status {
|
|
position: absolute;
|
|
left: 0;
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
/* don't consume click events - make children visible explicitly */
|
|
visibility: hidden;
|
|
}
|
|
|
|
#status-progress {
|
|
width: 500px;
|
|
height: 12px;
|
|
background-color: #00000000;
|
|
border: 3px solid #ffffff;
|
|
padding: 1px;
|
|
border-radius: 12px;
|
|
visibility: visible;
|
|
}
|
|
|
|
@media only screen and (orientation:portrait) {
|
|
#status-progress {
|
|
width: 61.8%;
|
|
}
|
|
}
|
|
|
|
#status-progress-inner {
|
|
|
|
height: 1px;
|
|
width: 0%;
|
|
box-sizing: border-box;
|
|
transition: width 0.4s linear;
|
|
background-color: #ffffff;
|
|
border: 1px solid #00000000;
|
|
border-radius: 5px;
|
|
padding: 3px;
|
|
text-align: center;
|
|
transform: translate(2px, 2px);
|
|
}
|
|
|
|
#status-indeterminate {
|
|
height: 42px;
|
|
visibility: visible;
|
|
position: relative;
|
|
}
|
|
|
|
#status-indeterminate > div {
|
|
width: 4.5px;
|
|
height: 0;
|
|
border-style: solid;
|
|
border-width: 9px 3px 0 3px;
|
|
border-color: #2b2b2b transparent transparent transparent;
|
|
transform-origin: center 21px;
|
|
position: absolute;
|
|
}
|
|
|
|
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
|
|
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
|
|
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
|
|
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
|
|
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
|
|
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
|
|
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
|
|
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
|
|
|
|
#status-notice {
|
|
margin: 0 100px;
|
|
line-height: 1.3;
|
|
visibility: visible;
|
|
padding: 4px 6px;
|
|
visibility: visible;
|
|
}
|
|
#loading-header {
|
|
position: absolute;
|
|
top: 39%;
|
|
left: 0;
|
|
right: 0;
|
|
font-size: 24px;
|
|
font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
|
|
color: white;
|
|
}
|
|
#loading-footer {
|
|
position: absolute;
|
|
top: 55%;
|
|
left: 0;
|
|
right: 0;
|
|
font-size: 24px;
|
|
font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
|
|
color: white;
|
|
}
|
|
</style>
|
|
<link id='-gd-engine-icon' rel='icon' type='image/png' href='index.icon.png' />
|
|
<link rel='apple-touch-icon' href='index.apple-touch-icon.png'/>
|
|
|
|
</head>
|
|
<body>
|
|
<div class="background"></div>
|
|
<div id='loading-header'><b>Alimad Interactive Entertainment<b></div>
|
|
<div id='loading-footer'><b>Downoading, Please Stand By.</b></div>
|
|
<canvas id='canvas'>
|
|
HTML5 canvas appears to be unsupported in the current browser.<br />
|
|
Please try updating or use a different browser.
|
|
</canvas>
|
|
<div id='status'>
|
|
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
|
|
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
</div>
|
|
<div id='status-notice' class='godot' style='display: none;'></div>
|
|
</div>
|
|
|
|
<script type='text/javascript' src='index.js'></script>
|
|
<script type='text/javascript'>//<![CDATA[
|
|
|
|
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"index","experimentalVK":true,"fileSizes":{"index.pck":2925248,"index.wasm":18790437},"focusCanvas":true,"gdnativeLibs":[]};
|
|
var engine = new Engine(GODOT_CONFIG);
|
|
// Continuously rotate the background image
|
|
const Background = document.querySelector('.background');
|
|
let rotation = 0;
|
|
const rotationSpeed = 0.5; // Change this value to control the rotation speed
|
|
function rotateBackground() {
|
|
rotation += rotationSpeed;
|
|
Background.style.transform = `rotate(${rotation}deg) scale(${4.5})`;
|
|
requestAnimationFrame(rotateBackground);
|
|
}
|
|
|
|
rotateBackground();
|
|
// Function to generate a random hue
|
|
|
|
let currentHue = getRandomHue();
|
|
let animationRequestId = null;
|
|
|
|
function getRandomHue() {
|
|
return Math.floor(Math.random() * 360);
|
|
}
|
|
|
|
function animateColorChange(timestamp) {
|
|
if (!animationRequestId) {
|
|
animationRequestId = timestamp;
|
|
}
|
|
|
|
const background = document.querySelector('.background');
|
|
const currentTime = timestamp || performance.now();
|
|
const duration = 5000; // Duration of the animation in milliseconds
|
|
|
|
function updateColor(currentTime) {
|
|
const startTime = animationRequestId;
|
|
const elapsed = currentTime - startTime;
|
|
const progress = (elapsed % duration) / duration;
|
|
|
|
const currentHueShift = 30 * Math.sin(2 * Math.PI * progress);
|
|
const currentColor = (currentHue + currentHueShift + 360) % 360;
|
|
background.style.backgroundImage = `radial-gradient(at 40% 25%, hsl(${currentColor}, 100%, 60%), hsl(${(currentColor + 180) % 360}, 100%, 50%) 50%)`;
|
|
|
|
animationRequestId = requestAnimationFrame(updateColor);
|
|
}
|
|
|
|
requestAnimationFrame(updateColor);
|
|
}
|
|
|
|
// Call the function when the page loads
|
|
window.addEventListener('load', () => {
|
|
animateColorChange();
|
|
});
|
|
|
|
|
|
|
|
(function() {
|
|
const INDETERMINATE_STATUS_STEP_MS = 100;
|
|
var statusProgress = document.getElementById('status-progress');
|
|
var statusProgressInner = document.getElementById('status-progress-inner');
|
|
var statusIndeterminate = document.getElementById('status-indeterminate');
|
|
var statusNotice = document.getElementById('status-notice');
|
|
|
|
var initializing = true;
|
|
var statusMode = 'hidden';
|
|
|
|
var animationCallbacks = [];
|
|
function animate(time) {
|
|
animationCallbacks.forEach(callback => callback(time));
|
|
requestAnimationFrame(animate);
|
|
}
|
|
requestAnimationFrame(animate);
|
|
|
|
function setStatusMode(mode) {
|
|
|
|
if (statusMode === mode || !initializing)
|
|
return;
|
|
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
|
|
elem.style.display = 'none';
|
|
});
|
|
animationCallbacks = animationCallbacks.filter(function(value) {
|
|
return (value != animateStatusIndeterminate);
|
|
});
|
|
switch (mode) {
|
|
case 'progress':
|
|
statusProgress.style.display = 'block';
|
|
break;
|
|
case 'indeterminate':
|
|
statusIndeterminate.style.display = 'block';
|
|
animationCallbacks.push(animateStatusIndeterminate);
|
|
break;
|
|
case 'notice':
|
|
statusNotice.style.display = 'block';
|
|
break;
|
|
case 'hidden':
|
|
break;
|
|
default:
|
|
throw new Error('Invalid status mode');
|
|
|
|
}
|
|
statusMode = mode;
|
|
}
|
|
|
|
function animateStatusIndeterminate(ms) {
|
|
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
|
|
if (statusIndeterminate.children[i].style.borderTopColor == '') {
|
|
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
|
|
child.style.borderTopColor = '';
|
|
});
|
|
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
|
|
}
|
|
}
|
|
|
|
function setStatusNotice(text) {
|
|
while (statusNotice.lastChild) {
|
|
statusNotice.removeChild(statusNotice.lastChild);
|
|
}
|
|
var lines = text.split('\n');
|
|
lines.forEach((line) => {
|
|
statusNotice.appendChild(document.createTextNode(line));
|
|
statusNotice.appendChild(document.createElement('br'));
|
|
});
|
|
};
|
|
|
|
function displayFailureNotice(err) {
|
|
var msg = err.message || err;
|
|
console.error(msg);
|
|
setStatusNotice(msg);
|
|
setStatusMode('notice');
|
|
initializing = false;
|
|
// Step 1: Get a reference to the div element
|
|
const divElement = document.getElementById('loading-footer');
|
|
|
|
// Step 2: Create a new anchor element
|
|
const linkElement = document.createElement('a');
|
|
|
|
// Step 3: Set the 'href' attribute of the anchor element
|
|
const linkURL = 'https://alimad.itch.io/theminions'; // Replace with your desired link URL
|
|
linkElement.setAttribute('href', linkURL);
|
|
|
|
// Step 4: Set the inner text or HTML content of the anchor element
|
|
const linkText = 'Retry'; // Replace with your desired link text
|
|
linkElement.innerText = linkText; // If you want to set plain text
|
|
// Alternatively, you can set HTML content like this:
|
|
// linkElement.innerHTML = '<strong>Click here to visit the link</strong>';
|
|
linkElement.style.textDecoration = 'none'; // Disable underline
|
|
linkElement.style.color = 'white'; // Make the text white
|
|
// Step 5: Replace the content of the div element with the anchor element
|
|
divElement.innerHTML = ''; // Clear existing content of the div
|
|
divElement.appendChild(linkElement); // Add the anchor element to the div
|
|
|
|
};
|
|
|
|
if (!Engine.isWebGLAvailable()) {
|
|
displayFailureNotice('WebGL not available');
|
|
} else {
|
|
setStatusMode('indeterminate');
|
|
engine.startGame({
|
|
'onProgress': function (current, total) {
|
|
if (total > 0) {
|
|
statusProgressInner.style.width = ((current/total)/1.345918239972628) * 100 + '%';
|
|
setStatusMode('progress');
|
|
if (current/total > 0.01 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Starting Download...';
|
|
}
|
|
if (current/total > 0.03 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Creating Temporary Directory...';
|
|
}
|
|
if (current/total > 0.07 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Reserving VRAM...';
|
|
}
|
|
if (current/total > 0.15 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Downoading Game Assets...';
|
|
}
|
|
if (current/total > 0.29 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Downoading Godot Engine 3 HTML Packages...';
|
|
}
|
|
if (current/total > 0.37 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Downoading Game Engine Runtime...';
|
|
}
|
|
if (current/total > 0.5 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Creating User Data Folder...';
|
|
}
|
|
if (current/total > 0.51 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Extracting index.wasm';
|
|
}
|
|
if (current/total > 0.52 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Extracting index.pck';
|
|
}
|
|
if (current/total > 0.53 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Praparing Execution index.js';
|
|
}
|
|
if (current/total > 0.54 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Praparing Execution godotlib3.js';
|
|
}
|
|
if (current/total > 0.55 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Praparing Execution gameengineruntime3.js';
|
|
}
|
|
if (current/total > 0.56 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Generating Patches...';
|
|
}
|
|
if (current/total > 0.58 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Generating Logic Instance...';
|
|
}
|
|
if (current/total > 0.6 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Generating Scene instances...';
|
|
}
|
|
if (current/total > 0.62 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Reading User Data Folder...';
|
|
}
|
|
if (current/total > 0.63 * 1.334918239972628){
|
|
document.getElementById('loading-footer').innerHTML = 'Loading...';
|
|
}
|
|
if (current/total > 0.65 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Applying Shaders...';
|
|
}
|
|
|
|
if (current/total > 0.67 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Creating 2D Models...';
|
|
}
|
|
|
|
if (current/total > 0.68 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Generating Textures...';
|
|
}
|
|
|
|
if (current/total > 0.69 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Setting Up Audio...';
|
|
}
|
|
|
|
if (current/total > 0.7 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Initializing Game Logic...';
|
|
}
|
|
|
|
if (current/total > 0.74 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Loading Game Levels...';
|
|
}
|
|
|
|
if (current/total > 0.79 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Indexing Scenes and Functions...';
|
|
}
|
|
|
|
if (current/total > 0.83 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Indexing Nodes and Scripts...';
|
|
}
|
|
if (current/total > 0.85 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Compiling GDScript ByteCode...';
|
|
}
|
|
if (current/total > 0.87 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Configuring Game Settings...';
|
|
}
|
|
|
|
if (current/total > 0.91 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Optimizing Performance...';
|
|
}
|
|
|
|
if (current/total > 0.95 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Finalizing Initialization...';
|
|
}
|
|
|
|
if (current/total > 0.99 * 1.334918239972628) {
|
|
document.getElementById('loading-footer').innerHTML = 'Launching Game Engine...';
|
|
}
|
|
if (current === total) {
|
|
// wait for progress bar animation
|
|
setTimeout(() => {
|
|
setStatusMode('indeterminate');
|
|
}, 200);
|
|
}
|
|
} else {
|
|
setStatusMode('indeterminate');
|
|
}
|
|
},
|
|
}).then(() => {
|
|
setStatusMode('hidden');
|
|
initializing = false;
|
|
}, displayFailureNotice);
|
|
}
|
|
})();
|
|
//]]></script>
|
|
</body>
|
|
</html>
|
|
|