armcord/src/content/splash.html

69 lines
2.1 KiB
HTML
Raw Normal View History

2021-12-24 21:56:49 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>ArmCord</title>
<style>
@import url("css/splash.css");
</style>
</head>
<body>
<div class="container">
<video autoplay loop class="logo" id="splashscreen-armcord">
2021-12-24 21:56:49 +00:00
<source
src="https://armcord.smartfridge.space/discord_loading.webm"
type="video/webm"
/>
</video>
<p id="text-splashscreen"></p>
2021-12-24 21:56:49 +00:00
</div>
</body>
<script>
const text = document.getElementById("text-splashscreen");
2021-12-24 21:56:49 +00:00
if (window.navigator.onLine === false) {
text.innerHTML =
"You appear to be offline. Please connect to the internet and try again.";
} else {
text.innerHTML = "Starting ArmCord...";
fetch("https://armcord.smartfridge.space/latest.json")
.then((response) => response.json())
.then((data) => {
if (data.version !== window.armcord.version) {
var elem = document.createElement("img");
elem.classList.add("logo");
elem.src = "https://armcord.smartfridge.space/update.webp";
document.body.prepend(elem);
document.getElementById("splashscreen-armcord").remove();
text.innerHTML =
"A new version of ArmCord is available. Please update to the latest version.";
} else {
console.log("ArmCord is up to date.")
}
});
2021-12-24 21:56:49 +00:00
setTimeout(() => {
2022-01-30 19:48:32 +00:00
window.armcordinternal.splashEnd();
switch (window.armcord.channel) {
2021-12-24 21:56:49 +00:00
case "stable":
window.location.replace("https://discord.com/app");
2021-12-24 21:56:49 +00:00
break;
case "canary":
window.location.replace("https://canary.discord.com/app");
2021-12-24 21:56:49 +00:00
break;
case "ptb":
window.location.replace("https://ptb.discord.com/app");
2021-12-24 21:56:49 +00:00
break;
case "foss":
window.location.replace("https://dev.fosscord.com/app");
break;
case undefined:
window.location.replace("https://discord.com/app");
2021-12-24 21:56:49 +00:00
break;
default:
window.location.replace("https://discord.com/app");
}
}, 5000);
2021-12-24 21:56:49 +00:00
}
</script>
</html>