add alerts, darkmode wip

This commit is contained in:
HorizonCode 2022-10-16 21:31:05 +02:00
parent 5565892155
commit 1b8dfbad03
5 changed files with 1470 additions and 5 deletions

2
app.js
View File

@ -67,7 +67,7 @@ const run = () => {
function createWindow() {
// Create the browser window.
const win = windowManager.createWindow(480, 350);
const win = windowManager.createWindow(520, 420);
win.loadFile('./html/index.html');

1453
assets/sweetalert2.dark.css Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/png" href="../assets/logo.png" />
<link href="../assets/mdb.min.css" rel="stylesheet" />
<link href="../assets/sweetalert2.dark.css" rel="stylesheet" />
<style>
* {
user-select: none;

View File

@ -47,6 +47,7 @@
"axios": "^0.27.2",
"custom-electron-titlebar": "^4.1.1",
"jquery": "^3.6.0",
"node-downloader-helper": "^2.1.4"
"node-downloader-helper": "^2.1.4",
"sweetalert2": "^11.5.2"
}
}

View File

@ -13,15 +13,26 @@ window.addEventListener('DOMContentLoaded', () => {
titlebar.updateTitle("EZPPLauncher");
const $ = require('jquery');
const Swal = require('sweetalert2');
$("#folder-btn").on('click', async () => {
const success = await ipcRenderer.invoke('set-osu-dir');
if (success == undefined)
return;
if (success) {
//TODO: Alert User, folder set.
Swal.fire({
title: 'Success!',
text: 'osu! folder set!',
icon: 'success',
confirmButtonText: 'Cool'
})
} else {
//TODO: Alert User, invalid osu folder selected
Swal.fire({
title: 'Uh oh!',
text: 'failed to set osu! folder.',
icon: 'error',
confirmButtonText: 'Cool'
})
}
});