Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion neutralino.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/neutralinojs/neutralinojs/main/schemas/neutralino.config.schema.json",
"applicationId": "neu.js.nikkepwned",
"version": "2.3.2-indev",
"version": "2.3.3-indev",
"applicationName": "NIKKEPwned",
"author": "ScathachGrip",
"description": "NIKKEPwned",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nikkepwned",
"description": "Password Manager for NIKKE",
"funding": "https://github.com/sponsors/sinkaroid",
"version": "2.3.2-indev",
"version": "2.3.3-indev",
"scripts": {
"prebuild": "ts-node src/frontend.ts",
"build": "tsc",
Expand Down
Binary file added resources/static/loading/ext_load_1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/static/loading/ext_load_2.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/static/loading/ext_load_3.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/static/loading/ext_load_4.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/static/loading/ext_load_5.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 56 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const staging = true;
const externalLoading = true;
let ws: WebSocket | null = null;
let globalUser: string;

Expand Down Expand Up @@ -457,7 +458,6 @@ class PwnedManager {
}, 3000);
}


/**
* Converts a timestamp to a readable date and "time ago" format.
* @param {number} timestamp - The timestamp stored with Date.now().
Expand Down Expand Up @@ -553,6 +553,47 @@ class PwnedManager {
}
}

private loadingImgs: string[] = [
"ext_load_1",
"ext_load_2",
"ext_load_3",
"ext_load_4",
"ext_load_5",
];

private getRandomLoader(): string {
return this.loadingImgs[Math.floor(Math.random() * this.loadingImgs.length)];
}

/**
* Starts the loading animation and changes the cursor to "wait".
* This function updates the loading image to a random loader
*
* @returns {void} No return value; only updates the windows UI.
*/
public startLoading(): void {
document.body.style.cursor = "wait";
const img = document.getElementById("loadingImg") as HTMLImageElement | null;
if (img) {
img.src = `/static/loading/${this.getRandomLoader()}.webp`;
}

const el = document.getElementById("loading");
if (el) el.style.display = "flex";
}

/**
* Finishes the loading animation and resets the cursor to "default".
* This function hides the loading element and resets the cursor style.
*
* @returns {void} No return value; only updates the windows UI.
*/
public finishLoading(): void {
document.body.style.cursor = "default";
const el = document.getElementById("loading");
if (el) el.style.display = "none";
}

}

const accountManager = new PwnedManager();
Expand Down Expand Up @@ -820,6 +861,19 @@ Neutralino.events.on("ready", async () => {
return;
}

await new Promise(r => setTimeout(r, 0));

if (externalLoading) {
try {
accountManager.startLoading();
setTimeout(() => accountManager.finishLoading(), Number(getDelay) * 1000 || 3000);
console.log("loading jalan");
} catch (err: unknown) {
setTimeout(() => accountManager.finishLoading(), 3000);
console.log("loading gagal: " + (err as Error).message);
}
}

console.log(`Opening NIKKE Launcher... (${launcherPath})`);
await Neutralino.os.execCommand(
`powershell -ExecutionPolicy Bypass -Command "Start-Process '${launcherPath}' -Verb RunAs"`,
Expand Down Expand Up @@ -1003,6 +1057,7 @@ Neutralino.events.on("ready", async () => {
);
});


// Browser.events: DOMContentLoaded
document.addEventListener("DOMContentLoaded", async () => {
// Handling account selection
Expand All @@ -1028,7 +1083,6 @@ document.addEventListener("DOMContentLoaded", async () => {
const btnWortel = document.getElementById("myBtnWortel") as HTMLButtonElement;
const spanWortel = myModalWortel.querySelector(".close") as HTMLElement;


if (!modal || !btn || !span || !tbody || !myModalWortel || !btnWortel || !spanWortel) {
console.error("❌ Modal elements not found.");
return;
Expand Down
30 changes: 30 additions & 0 deletions src/frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1170,16 +1170,46 @@ const htmlContent = `
#accountSelect {
transition: all 0.3s ease;
}

#loading {
position: fixed;
inset: 0;
background: var(--bg);
display: none;
align-items: center;
justify-content: center;
z-index: 9999;
}

#loading img {
width: 130px;
height: 130px;
animation: bounceLoader 0.6s infinite alternate ease-out;
}

@keyframes bounceLoader {
0% {
transform: translateY(0) scale(1);
}
100% {
transform: translateY(-40px) scale(1.1);
}
}
</style>
</head>


<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>NikkePwned</title>
</head>

<div id="loading">
<img id="loadingImg" src="" />
</div>

<body>
<div id="titlebar" class="titlebar">
<div class="title-left">
Expand Down