new design rollout, function still not given

This commit is contained in:
2022-10-17 12:47:47 +02:00
parent 2b12654825
commit 3edf2ce8a3
6 changed files with 311 additions and 28 deletions

View File

@@ -14,10 +14,24 @@ window.addEventListener('DOMContentLoaded', () => {
titlebar.updateTitle(`${appInfo.appName} ${appInfo.appVersion}`);
const $ = require('jquery');
const axios = require('axios').default;
const Swal = require('sweetalert2');
let currentState;
const loggedIn = false;
$('#account-action').on('click', () => {
if (!loggedIn) {
changePage('login');
}
});
$('#action-cancel').on('click', () => {
if (!loggedIn) {
changePage('launch');
}
});
let currentState;
$("#launch-btn").on('click', async () => {
switch (currentState) {
case "up-to-date":
@@ -103,6 +117,19 @@ window.addEventListener('DOMContentLoaded', () => {
}
})
function changePage(page) {
switch (page) {
case "login":
$("#launch-page").hide();
$("#login-page").fadeIn(350);
break;
case "launch":
$("#login-page").hide();
$("#launch-page").fadeIn(350);
break;
}
}
// workaround for the dark theme
$('head').append($('<link href="../assets/sweetalert2.dark.css" rel="stylesheet" />'));
})