armcord/src/content/setup.html

135 lines
6.1 KiB
HTML
Raw Normal View History

2022-02-26 21:26:16 +00:00
<!--- This is awful and should be replaced in later versions. Possibly based of current settings as of 3.1.0 version. If you have time please PR a better setup screen. --->
2021-12-24 21:56:49 +00:00
<!DOCTYPE html>
<html lang="en">
2022-03-04 17:53:18 +00:00
<head>
<link rel="stylesheet" href="https://cdn.metroui.org.ua/v4/css/metro-all.min.css" />
<meta charset="UTF-8" />
<title>ArmCord Setup</title>
<style>
@import url("css/setup.css");
</style>
</head>
2021-12-24 21:56:49 +00:00
2022-03-04 17:53:18 +00:00
<body>
<div class="container">
<h1 class="logo"></h1>
<div id="setup">
<p>Select what kind of setup you want to perform:</p>
<button id="express" class="center">Express setup</button>
<button id="full" class="center">Full setup</button>
</div>
</div>
<script>
function fade(element) {
var op = 1; // initial opacity
var timer = setInterval(function () {
if (op <= 0.1) {
clearInterval(timer);
element.style.display = "none";
}
element.style.opacity = op;
element.style.filter = "alpha(opacity=" + op * 100 + ")";
op -= op * 0.1;
}, 50);
}
2021-12-24 21:56:49 +00:00
2022-03-04 17:53:18 +00:00
if (window.navigator.onLine === false) {
document.getElementById("setup").innerHTML =
"You appear to be offline. Please connect to the internet and restart ArmCord Setup.";
} else {
console.log("Starting ArmCord Setup...");
document.getElementById("express").addEventListener("click", function () {
window.armcordinternal.saveSettings({
windowStyle: "default",
channel: "stable",
armcordCSP: true,
minimizeToTray: true,
automaticPatches: false,
mods: "cumcord",
2022-04-19 17:59:52 +00:00
blurType: "acrylic",
inviteWebsocket: true,
doneSetup: true
2022-03-04 17:53:18 +00:00
});
fade(document.getElementById("setup"));
setTimeout(function () {
window.armcordinternal.restart();
}, 5000);
});
document.getElementById("full").addEventListener("click", function () {
document.getElementById("setup").innerHTML = `
<p class="text-center setup-ask">Choose your Discord channel/instance:</p>
<div class="center">
<select name="channel" id="channel" class="dropdown-button">
<option value="stable">Stable</option>
<option value="canary">Canary</option>
<option value="ptb">PTB</option>
<option value="foss">Fosscord</option>
</select>
</div>
<p class="text-center setup-ask">Should ArmCord handle client mods installation?</p>
<div class="center">
<select name="csp" id="csp" class="dropdown-button">
<option value="true">Yes</option>
<option value="false">No</option>
</select>
</div>
<button id="next" class="center">Next</button>
`;
2022-03-04 17:53:18 +00:00
document.getElementById("next").addEventListener("click", function () {
var branch = document.getElementById("channel").value;
var csp = document.getElementById("csp").value;
if (csp === "true") {
document.getElementById("setup").innerHTML = `
<p class="text-center setup-ask">Select a client mod you want to install:</p>
<div class="center">
<select name="mod" id="mod" class="dropdown-button">
<option value="cumcord">Cumcord</option>
<option value="goosemod">GooseMod</option>
<option value="flicker">Flicker (Heavily WIP)</option>
</select>
</div>
<p>Why not all of them? Having many client mods at the same time can cause issues. If you really want to do it though, check our documentation ;)</p>
<button id="next" class="center">Next</button>
`;
2022-03-04 17:53:18 +00:00
document.getElementById("next").addEventListener("click", function () {
var mod = document.getElementById("mod").value;
window.armcordinternal.saveSettings({
windowStyle: "default",
channel: branch,
armcordCSP: true,
minimizeToTray: true,
automaticPatches: false,
mods: mod,
2022-04-19 17:59:52 +00:00
blurType: "acrylic",
inviteWebsocket: true,
doneSetup: true
2022-03-04 17:53:18 +00:00
});
fade(document.getElementById("setup"));
setTimeout(function () {
window.armcordinternal.restart();
}, 5000);
});
} else {
window.armcordinternal.saveSettings({
windowStyle: "default",
channel: branch,
armcordCSP: true,
minimizeToTray: true,
automaticPatches: false,
mods: "none",
2022-04-19 17:59:52 +00:00
blurType: "acrylic",
inviteWebsocket: true,
doneSetup: true
2022-03-04 17:53:18 +00:00
});
fade(document.getElementById("setup"));
setTimeout(function () {
window.armcordinternal.restart();
}, 5000);
}
});
});
}
</script>
</body>
</html>