Compare commits
27 Commits
0e0676917a
...
2.1.2
Author | SHA1 | Date | |
---|---|---|---|
c3f0882951 | |||
c17cbc48d8 | |||
513692c2d5 | |||
90717ed960 | |||
6bcce04b72 | |||
8d2024aa0a | |||
22815e74b6 | |||
c4d9862860 | |||
d56d4875e0 | |||
4c33323e9e | |||
da8e237679 | |||
eb166c0165 | |||
c4cd8fed12 | |||
6bca0b32a9 | |||
72d466b1ec | |||
401be3c977 | |||
0b679d320f | |||
5b1407638a | |||
d2d2a618c5 | |||
b85a3a8795 | |||
fc6ec3bd69 | |||
4c26689f4e | |||
3d2ebdb640 | |||
9f3c4d4fa4 | |||
0567d57cb5 | |||
d907553f3e | |||
8b4fb07f21 |
@@ -1,4 +1,4 @@
|
||||
const appName = "EZPPLauncher";
|
||||
const appVersion = "2.0.0";
|
||||
const appVersion = "2.1.1";
|
||||
|
||||
module.exports = { appName, appVersion };
|
||||
module.exports = { appName, appVersion };
|
||||
|
15
electron/imageUtil.js
Normal file
15
electron/imageUtil.js
Normal file
@@ -0,0 +1,15 @@
|
||||
async function checkImageExists(url) {
|
||||
try {
|
||||
const response = await fetch(url, { method: "HEAD" });
|
||||
if (!response.ok) {
|
||||
return false;
|
||||
}
|
||||
const contentType = response.headers.get("content-type");
|
||||
if (!contentType) return false;
|
||||
return contentType.startsWith("image/");
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { checkImageExists };
|
@@ -2,7 +2,10 @@ const DiscordRPC = require("discord-auto-rpc");
|
||||
const { appName, appVersion } = require("./appInfo.js");
|
||||
|
||||
const clientId = "1032772293220384808";
|
||||
|
||||
/** @type {DiscordRPC.AutoClient} */
|
||||
let richPresence;
|
||||
|
||||
let intervalId;
|
||||
|
||||
let currentStatus = {
|
||||
@@ -32,6 +35,7 @@ module.exports = {
|
||||
richPresence = new DiscordRPC.AutoClient({ transport: "ipc" });
|
||||
richPresence.endlessLogin({ clientId });
|
||||
richPresence.once("ready", () => {
|
||||
console.log("connected presence with user " + richPresence.user.username);
|
||||
richPresence.setActivity(currentStatus);
|
||||
intervalId = setInterval(() => {
|
||||
richPresence.setActivity(currentStatus);
|
||||
@@ -47,16 +51,17 @@ module.exports = {
|
||||
richPresence = null;
|
||||
}
|
||||
},
|
||||
updateStatus: ({ state, details }) => {
|
||||
updateStatus: ({ state, details, largeImageKey }) => {
|
||||
currentStatus.state = state ?? " ";
|
||||
currentStatus.details = details ?? " ";
|
||||
currentStatus.largeImageKey = largeImageKey ?? "ezppfarm";
|
||||
},
|
||||
updateVersion: (osuVersion) => {
|
||||
currentStatus.smallImageKey = osuVersion ? "osu" : " ";
|
||||
currentStatus.smallImageText = osuVersion ? `osu! ${osuVersion}` : " ";
|
||||
updateUser: ({ username, id }) => {
|
||||
currentStatus.smallImageKey = id ? `https://a.ez-pp.farm/${id}` : " ";
|
||||
currentStatus.smallImageText = username ?? " ";
|
||||
},
|
||||
update: () => {
|
||||
if (richPresence) {
|
||||
if (richPresence && richPresence.user) {
|
||||
richPresence.setActivity(currentStatus);
|
||||
}
|
||||
},
|
||||
|
123
main.js
123
main.js
@@ -2,6 +2,16 @@
|
||||
const { app, BrowserWindow, Menu, ipcMain, dialog, shell } = require(
|
||||
"electron",
|
||||
);
|
||||
|
||||
/* const unhandled = require("electron-unhandled");
|
||||
unhandled({
|
||||
logger: console.error,
|
||||
showDialog: true,
|
||||
reportButton: () => {
|
||||
shell.openExternal("https://ez-pp.farm/discord");
|
||||
},
|
||||
}); */
|
||||
|
||||
const path = require("path");
|
||||
const serve = require("electron-serve");
|
||||
const loadURL = serve({ directory: "public" });
|
||||
@@ -36,6 +46,7 @@ const { getHwId } = require("./electron/hwidUtil");
|
||||
const { appName, appVersion } = require("./electron/appInfo");
|
||||
const { updateAvailable, releasesUrl } = require("./electron/updateCheck");
|
||||
const fkill = require("fkill");
|
||||
const { checkImageExists } = require("./electron/imageUtil");
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
@@ -62,6 +73,25 @@ function startOsuStatus() {
|
||||
if (firstInstance) {
|
||||
if (!osuLoaded) {
|
||||
osuLoaded = true;
|
||||
|
||||
try {
|
||||
const currentUserInfo = await fetch(`https://api.ez-pp.farm/get_player_info?name=${currentUser.username}&scope=info`);
|
||||
const currentUserInfoJson = await currentUserInfo.json();
|
||||
if ("player" in currentUserInfoJson && currentUserInfoJson.player != null) {
|
||||
if ("info" in currentUserInfoJson.player && currentUserInfoJson.player.info != null) {
|
||||
const id = currentUserInfoJson.player.info.id;
|
||||
const username = currentUserInfoJson.player.info.name;
|
||||
richPresence.updateUser({
|
||||
id,
|
||||
username,
|
||||
});
|
||||
richPresence.update();
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
if (patch) {
|
||||
const patcherExecuteable = path.join(
|
||||
@@ -86,15 +116,32 @@ function startOsuStatus() {
|
||||
if (!("player_status" in currentStatus)) return;
|
||||
if (!("status" in currentStatus.player_status)) return;
|
||||
|
||||
let largeImageKey = "ezppfarm";
|
||||
let details = "Idle...";
|
||||
let infoText = currentStatus.player_status.status.info_text.length > 0
|
||||
? currentStatus.player_status.status.info_text
|
||||
: " ";
|
||||
if (
|
||||
"beatmap" in currentStatus.player_status.status &&
|
||||
currentStatus.player_status.status.beatmap !== null
|
||||
) {
|
||||
const setId = currentStatus.player_status.status.beatmap.set_id;
|
||||
if (setId) {
|
||||
const coverImage =
|
||||
`https://assets.ppy.sh/beatmaps/${setId}/covers/list@2x.jpg`;
|
||||
if (
|
||||
checkImageExists(coverImage)
|
||||
) {
|
||||
largeImageKey = coverImage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (currentStatus.player_status.status.action) {
|
||||
case 1:
|
||||
details = "AFK...";
|
||||
infoText = " ";
|
||||
largeImageKey = "ezppfarm";
|
||||
break;
|
||||
case 2:
|
||||
details = "Playing...";
|
||||
@@ -108,6 +155,7 @@ function startOsuStatus() {
|
||||
case 5:
|
||||
details = "Multiplayer: Selecting a Beatmap...";
|
||||
infoText = " ";
|
||||
largeImageKey = "ezppfarm";
|
||||
break;
|
||||
case 6:
|
||||
details = "Watching...";
|
||||
@@ -117,10 +165,12 @@ function startOsuStatus() {
|
||||
break;
|
||||
case 9:
|
||||
details = "Submitting...";
|
||||
largeImageKey = "ezppfarm";
|
||||
break;
|
||||
case 11:
|
||||
details = "Multiplayer: Idle...";
|
||||
infoText = " ";
|
||||
largeImageKey = "ezppfarm";
|
||||
break;
|
||||
case 12:
|
||||
details = "Multiplayer: Playing...";
|
||||
@@ -128,12 +178,14 @@ function startOsuStatus() {
|
||||
case 13:
|
||||
details = "Browsing osu!direct...";
|
||||
infoText = " ";
|
||||
largeImageKey = "ezppfarm";
|
||||
break;
|
||||
}
|
||||
|
||||
richPresence.updateStatus({
|
||||
details,
|
||||
state: infoText,
|
||||
largeImageKey,
|
||||
});
|
||||
|
||||
richPresence.update();
|
||||
@@ -376,9 +428,8 @@ function registerIPCPipes() {
|
||||
progress: Math.ceil(data.progress),
|
||||
});
|
||||
mainWindow.webContents.send("ezpplauncher:launchstatus", {
|
||||
status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${
|
||||
formatBytes(data.total)
|
||||
})...`,
|
||||
status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${formatBytes(data.total)
|
||||
})...`,
|
||||
});
|
||||
});
|
||||
await uiDownloader.startDownload();
|
||||
@@ -407,9 +458,8 @@ function registerIPCPipes() {
|
||||
progress: Math.ceil(data.progress),
|
||||
});
|
||||
mainWindow.webContents.send("ezpplauncher:launchstatus", {
|
||||
status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${
|
||||
formatBytes(data.total)
|
||||
})...`,
|
||||
status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${formatBytes(data.total)
|
||||
})...`,
|
||||
});
|
||||
});
|
||||
await updateDownloader.startDownload();
|
||||
@@ -454,9 +504,8 @@ function registerIPCPipes() {
|
||||
progress: Math.ceil(data.progress),
|
||||
});
|
||||
mainWindow.webContents.send("ezpplauncher:launchstatus", {
|
||||
status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${
|
||||
formatBytes(data.total)
|
||||
})...`,
|
||||
status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${formatBytes(data.total)
|
||||
})...`,
|
||||
});
|
||||
});
|
||||
await patcherDownloader.startDownload();
|
||||
@@ -477,30 +526,31 @@ function registerIPCPipes() {
|
||||
}
|
||||
await new Promise((res) => setTimeout(res, 1000));
|
||||
}
|
||||
|
||||
mainWindow.webContents.send("ezpplauncher:launchstatus", {
|
||||
status: "Launching osu! updater to verify...",
|
||||
});
|
||||
await new Promise((res) => setTimeout(res, 1000));
|
||||
|
||||
await new Promise((res) => {
|
||||
runOsuUpdater(osuPath, async () => {
|
||||
await new Promise((res) => setTimeout(res, 500));
|
||||
const terminationThread = setInterval(async () => {
|
||||
const osuWindowTitle = windowName.getWindowText("osu!.exe");
|
||||
if (osuWindowTitle.length < 0) {
|
||||
return;
|
||||
}
|
||||
const firstInstance = osuWindowTitle[0];
|
||||
if (firstInstance) {
|
||||
const processId = firstInstance.processId;
|
||||
await fkill(processId, { force: true, silent: true });
|
||||
clearInterval(terminationThread);
|
||||
res();
|
||||
}
|
||||
}, 500);
|
||||
if (updateFiles.length > 0) {
|
||||
mainWindow.webContents.send("ezpplauncher:launchstatus", {
|
||||
status: "Launching osu! updater to verify updates...",
|
||||
});
|
||||
});
|
||||
await new Promise((res) => setTimeout(res, 1000));
|
||||
|
||||
await new Promise((res) => {
|
||||
runOsuUpdater(osuPath, async () => {
|
||||
await new Promise((res) => setTimeout(res, 500));
|
||||
const terminationThread = setInterval(async () => {
|
||||
const osuWindowTitle = windowName.getWindowText("osu!.exe");
|
||||
if (osuWindowTitle.length < 0) {
|
||||
return;
|
||||
}
|
||||
const firstInstance = osuWindowTitle[0];
|
||||
if (firstInstance) {
|
||||
const processId = firstInstance.processId;
|
||||
await fkill(processId, { force: true, silent: true });
|
||||
clearInterval(terminationThread);
|
||||
res();
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
await new Promise((res) => setTimeout(res, 1000));
|
||||
|
||||
@@ -527,11 +577,9 @@ function registerIPCPipes() {
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
} catch { }
|
||||
|
||||
const userConfig = getUserConfig(osuPath);
|
||||
richPresence.updateVersion(await userConfig.get("LastVersion"));
|
||||
richPresence.update();
|
||||
if (richPresence.hasPresence) {
|
||||
await userConfig.set("DiscordRichPresence", "0");
|
||||
}
|
||||
@@ -552,7 +600,10 @@ function registerIPCPipes() {
|
||||
mainWindow.show();
|
||||
mainWindow.focus();
|
||||
stopOsuStatus();
|
||||
richPresence.updateVersion();
|
||||
richPresence.updateUser({
|
||||
username: " ",
|
||||
id: undefined
|
||||
});
|
||||
richPresence.updateStatus({
|
||||
state: "Idle in Launcher...",
|
||||
details: undefined,
|
||||
|
66
package-lock.json
generated
66
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ezpplauncher-next",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ezpplauncher-next",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -18,6 +18,7 @@
|
||||
"custom-electron-titlebar": "^4.2.7",
|
||||
"discord-auto-rpc": "^1.0.17",
|
||||
"electron-serve": "^1.1.0",
|
||||
"electron-unhandled": "^4.0.1",
|
||||
"fkill": "^7.2.1",
|
||||
"get-window-by-name": "^2.0.0",
|
||||
"regedit-rs": "^1.0.2",
|
||||
@@ -3720,6 +3721,14 @@
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-is-dev": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-2.0.0.tgz",
|
||||
"integrity": "sha512-3X99K852Yoqu9AcW50qz3ibYBWY79/pBhlMCab8ToEWS48R0T9tyxRiQhwylE7zQdXrMnx2JKqUJyMPmt5FBqA==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-publish": {
|
||||
"version": "24.8.1",
|
||||
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-24.8.1.tgz",
|
||||
@@ -3787,6 +3796,46 @@
|
||||
"integrity": "sha512-f7/be56VjRRQk+Ric6PmIrEtPcIqsn3tElyAu9Sh6egha2VLJ82qwkcOdcnT06W+Pb6RUulV1ckzrGbKzVcTHg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/electron-unhandled": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/electron-unhandled/-/electron-unhandled-4.0.1.tgz",
|
||||
"integrity": "sha512-6BsLnBg+i96eUnbaIFZyYdyfNX3f80/Nlfqy34YEMxXT9JP3ddNsNnUeiOF8ezN4+et4t4D37gjghKTP0V3jyw==",
|
||||
"dependencies": {
|
||||
"clean-stack": "^2.1.0",
|
||||
"electron-is-dev": "^2.0.0",
|
||||
"ensure-error": "^2.0.0",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"serialize-error": "^8.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-unhandled/node_modules/serialize-error": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-8.1.0.tgz",
|
||||
"integrity": "sha512-3NnuWfM6vBYoy5gZFvHiYsVbafvI9vZv/+jlIigFn4oP4zjNPK3LhcY0xSCgeb1a5L8jO71Mit9LlNoi2UfDDQ==",
|
||||
"dependencies": {
|
||||
"type-fest": "^0.20.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-unhandled/node_modules/type-fest": {
|
||||
"version": "0.20.2",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
|
||||
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/electron/node_modules/@types/node": {
|
||||
"version": "18.19.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.6.tgz",
|
||||
@@ -3818,6 +3867,14 @@
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ensure-error": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ensure-error/-/ensure-error-2.1.0.tgz",
|
||||
"integrity": "sha512-+BMSJHw9gxiJAAp2ZR1E0TNcL09dD3lOvkl7WVm4+Y6xnes/pMetP/TzCHiDduh8ihNDjbGfuYxl7l4PA1xZ8A==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
|
||||
@@ -5266,6 +5323,11 @@
|
||||
"integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/lodash.debounce": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
|
||||
"integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow=="
|
||||
},
|
||||
"node_modules/lodash.memoize": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ezpplauncher-next",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.1",
|
||||
"description": "EZPPLauncher rewritten with Svelte.",
|
||||
"private": false,
|
||||
"license": "MIT",
|
||||
@@ -45,6 +45,7 @@
|
||||
"custom-electron-titlebar": "^4.2.7",
|
||||
"discord-auto-rpc": "^1.0.17",
|
||||
"electron-serve": "^1.1.0",
|
||||
"electron-unhandled": "^4.0.1",
|
||||
"fkill": "^7.2.1",
|
||||
"get-window-by-name": "^2.0.0",
|
||||
"regedit-rs": "^1.0.2",
|
||||
|
@@ -1,63 +1,15 @@
|
||||
html, body {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
html,
|
||||
body {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
color: #333;
|
||||
margin: 0;
|
||||
padding: 8px;
|
||||
box-sizing: border-box;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgb(0,100,200);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: rgb(0,80,160);
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
input, button, select, textarea {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
-webkit-padding: 0.4em 0;
|
||||
padding: 0.4em;
|
||||
margin: 0 0 0.5em 0;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
input:disabled {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
button {
|
||||
color: #333;
|
||||
background-color: #f4f4f4;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
button:not(:disabled):active {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
button:focus {
|
||||
border-color: #666;
|
||||
color: #333;
|
||||
margin: 0;
|
||||
padding: 8px;
|
||||
box-sizing: border-box;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||
Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
@@ -83,7 +83,6 @@
|
||||
});
|
||||
|
||||
window.addEventListener("alert", (e) => {
|
||||
console.log((e as CustomEvent).detail);
|
||||
const toastMessage = (e as CustomEvent).detail;
|
||||
switch (toastMessage.type) {
|
||||
case "success": {
|
||||
@@ -124,7 +123,7 @@
|
||||
<div class="flex flex-row items-center animate-fadeIn opacity-0">
|
||||
{#if $currentPage == Page.Settings}
|
||||
<Button
|
||||
class="dark:active:!bg-gray-900 !ring-0 w-10 h-10 mr-1 rounded-lg animate-sideIn opacity-0 active:scale-95 transition-transform duration-75"
|
||||
class="!ring-0 w-10 h-10 mr-1 rounded-lg animate-sideIn opacity-0 active:scale-95 transition-transform duration-75"
|
||||
color="light"
|
||||
on:click={() => {
|
||||
currentPage.set(Page.Launch);
|
||||
@@ -174,7 +173,7 @@
|
||||
</span>
|
||||
</DropdownHeader>
|
||||
<DropdownItem
|
||||
class="flex flex-row gap-2 border-0 dark:!bg-gray-700 dark:active:!bg-gray-900 dark:hover:!bg-gray-800 transition-colors"
|
||||
class="flex flex-row gap-2 border-0 transition-colors"
|
||||
on:click={() => {
|
||||
if (!$launching) currentPage.set(Page.Settings);
|
||||
}}
|
||||
@@ -185,7 +184,7 @@
|
||||
<DropdownDivider />
|
||||
{#if loggedIn}
|
||||
<DropdownItem
|
||||
class="flex flex-row gap-2 border-0 dark:!bg-gray-700 dark:active:!bg-gray-900 dark:hover:!bg-gray-800 transition-colors"
|
||||
class="flex flex-row gap-2 border-0 transition-colors"
|
||||
on:click={() => {
|
||||
if (!$launching) logout();
|
||||
}}
|
||||
@@ -197,7 +196,7 @@
|
||||
</DropdownItem>
|
||||
{:else}
|
||||
<DropdownItem
|
||||
class="flex flex-row gap-2 border-0 dark:!bg-gray-700 dark:active:!bg-gray-900 dark:hover:!bg-gray-800 transition-colors"
|
||||
class="flex flex-row gap-2 border-0 transition-colors"
|
||||
on:click={() => {
|
||||
if (!$launching) currentPage.set(Page.Login);
|
||||
}}
|
||||
|
@@ -6,7 +6,15 @@
|
||||
* {
|
||||
font-family: "Prompt";
|
||||
-webkit-user-select: none !important;
|
||||
-khtml-user-select: none !important;
|
||||
-moz-user-select: none !important;
|
||||
-o-user-select: none !important;
|
||||
user-select: none !important;
|
||||
-webkit-user-drag: none !important;
|
||||
-khtml-user-drag: none !important;
|
||||
-moz-user-drag: none !important;
|
||||
-o-user-drag: none !important;
|
||||
user-drag: none !important;
|
||||
}
|
||||
|
||||
html .cet-titlebar {
|
||||
|
@@ -16,7 +16,9 @@
|
||||
const launch = () => {
|
||||
launching.set(true);
|
||||
const patching = $patch;
|
||||
window.dispatchEvent(new CustomEvent("launch", { detail: { patch: patching } }));;
|
||||
window.dispatchEvent(
|
||||
new CustomEvent("launch", { detail: { patch: patching } })
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -29,7 +31,7 @@
|
||||
<Button
|
||||
color="light"
|
||||
size="xl"
|
||||
class="dark:active:!bg-gray-900 {$launching
|
||||
class="{$launching
|
||||
? ''
|
||||
: 'active:scale-95 '}transition-transform duration-75"
|
||||
disabled={$launching}
|
||||
|
@@ -59,7 +59,7 @@
|
||||
{
|
||||
loading: "Logging in...",
|
||||
success: "Successfully logged in!",
|
||||
error: "Failed to login.",
|
||||
error: "Invalid Username or Password!",
|
||||
},
|
||||
{
|
||||
position: "bottom-center",
|
||||
@@ -80,7 +80,6 @@
|
||||
const resultData = customEvent.detail;
|
||||
const isGuest = "guest" in resultData;
|
||||
const wasSuccessful = "user" in resultData;
|
||||
console.log(resultData);
|
||||
if (isGuest) {
|
||||
currentPage.set(Page.Launch);
|
||||
res();
|
||||
@@ -170,6 +169,7 @@
|
||||
type="text"
|
||||
placeholder="Username"
|
||||
size="md"
|
||||
class="animate-sideIn"
|
||||
disabled={loading}
|
||||
bind:value={username}
|
||||
/>
|
||||
@@ -177,6 +177,7 @@
|
||||
type={showPassword ? "text" : "password"}
|
||||
placeholder="Password"
|
||||
size="md"
|
||||
class="animate-lsideIn"
|
||||
disabled={loading}
|
||||
bind:value={password}
|
||||
>
|
||||
@@ -198,7 +199,7 @@
|
||||
>
|
||||
<div class="flex flex-col justify-center items-center gap-2 mt-1">
|
||||
<Button
|
||||
class="dark:active:!bg-gray-900 active:scale-95 transition-transform duration-75"
|
||||
class="active:scale-95 transition-transform duration-75"
|
||||
color="light"
|
||||
disabled={loading}
|
||||
on:click={processLogin}
|
||||
|
@@ -63,21 +63,13 @@
|
||||
value={folderPath}
|
||||
readonly
|
||||
/>
|
||||
<Button
|
||||
color="light"
|
||||
class="dark:active:!bg-gray-900"
|
||||
on:click={detectFolderPath}
|
||||
>
|
||||
<Button color="light" on:click={detectFolderPath}>
|
||||
<FileSearchSolid
|
||||
size="sm"
|
||||
class="dark:text-gray-300 text-gray-500 outline-none border-none select-none pointer-events-none"
|
||||
/>
|
||||
</Button>
|
||||
<Button
|
||||
color="light"
|
||||
class="dark:active:!bg-gray-900 active:!rounded-lg"
|
||||
on:click={setFolderPath}
|
||||
>
|
||||
<Button color="light" class="active:!rounded-lg" on:click={setFolderPath}>
|
||||
<FolderSolid
|
||||
size="sm"
|
||||
class="dark:text-gray-300 text-gray-500 outline-none border-none select-none pointer-events-none"
|
||||
|
Reference in New Issue
Block a user