mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
254ba93433
* Update Window state * Add x/y state saving
96 lines
4 KiB
HTML
96 lines
4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/ico" href="./favicon.ico" />
|
|
<title>ArmCord</title>
|
|
<style>
|
|
@import url("css/splash.css");
|
|
</style>
|
|
<script>
|
|
window.onbeforeunload = function () {
|
|
const style = document.createElement("style");
|
|
style.textContent = "body { display: none; }";
|
|
document.head.append(style);
|
|
};
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="container">
|
|
<video autoplay loop class="logo" id="splashscreen-armcord">
|
|
<source src="https://armcord.xyz/discord_loading.webm" type="video/webm" />
|
|
</video>
|
|
<p id="text-splashscreen"></p>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
async function loadLang() {
|
|
const text = document.getElementById("text-splashscreen");
|
|
if (window.navigator.onLine === false) {
|
|
text.innerHTML = await armcord.getLang("loading_screen_offline");
|
|
} else {
|
|
text.innerHTML = await armcord.getLang("loading_screen_start");
|
|
if (window.armcord.version === "3.1.0") {
|
|
console.log("Running a development build of ArmCord. Skipping updater.");
|
|
} else {
|
|
const response = await fetch("https://armcord.xyz/latest.json");
|
|
const data = await response.json();
|
|
if (data.version !== window.armcord.version) {
|
|
var elem = document.createElement("img");
|
|
elem.classList.add("logo");
|
|
elem.src = "https://armcord.xyz/update.webp";
|
|
document.body.prepend(elem);
|
|
document.getElementById("splashscreen-armcord").remove();
|
|
text.innerHTML = await armcord.getLang("loading_screen_update");
|
|
} else {
|
|
console.log("ArmCord is up to date.");
|
|
}
|
|
}
|
|
|
|
function check() {
|
|
if (armcordinternal.installState === "installing") {
|
|
text.innerHTML = "Installing mods";
|
|
} else if (armcordinternal.installState === "done") {
|
|
return true;
|
|
} else if (armcordinternal.installState === "modDownload") {
|
|
text.innerHTML = "Updating " + armcord.mods;
|
|
} else if (armcordinternal.installState === "none") {
|
|
text.innerHTML = "Nothing to install.";
|
|
return true;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
while (check() == false) {
|
|
console.log("Installing");
|
|
}
|
|
setTimeout(() => {
|
|
window.armcord.splashEnd();
|
|
switch (window.armcord.channel) {
|
|
case "stable":
|
|
window.location.replace("https://discord.com/app");
|
|
break;
|
|
case "canary":
|
|
window.location.replace("https://canary.discord.com/app");
|
|
break;
|
|
case "ptb":
|
|
window.location.replace("https://ptb.discord.com/app");
|
|
break;
|
|
case "hummus":
|
|
window.location.replace("https://hummus.sys42.net/");
|
|
break;
|
|
case undefined:
|
|
window.location.replace("https://discord.com/app");
|
|
break;
|
|
default:
|
|
window.location.replace("https://discord.com/app");
|
|
}
|
|
}, 3000);
|
|
}
|
|
}
|
|
|
|
loadLang();
|
|
</script>
|
|
</html>
|