This commit is contained in:
BhagwanSingh 2025-11-27 16:34:42 +05:30
parent 0ae8f6185a
commit 345822885f
2 changed files with 57 additions and 28 deletions

View File

@ -4,26 +4,59 @@
<style> <style>
body { body {
margin: 0; margin: 0;
height: 100vh;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background: #ffffff; background: #ffffff;
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
} }
.loader {
width: 50px; .loader-container {
height: 50px; position: relative;
border: 5px solid #e0e0e0; width: 100px;
height: 100px;
}
/* Circular spinner */
.loader-ring {
width: 100%;
height: 100%;
border: 6px solid #e0e0e0;
border-top-color: #6a5acd; border-top-color: #6a5acd;
border-radius: 50%; border-radius: 50%;
animation: spin 1s linear infinite; animation: spin 1s linear infinite;
} }
/* Logo in center */
.loader-logo {
position: absolute;
inset: 0;
display: flex;
justify-content: center;
align-items: center;
}
.loader-logo img {
width: 45px;
height: 45px;
object-fit: contain;
}
@keyframes spin { @keyframes spin {
to { transform: rotate(360deg); } to { transform: rotate(360deg); }
} }
</style> </style>
</head> </head>
<body> <body>
<div class="loader"></div> <div class="loader-container">
<div class="loader-ring"></div>
<!-- Place your logo here -->
<div class="loader-logo">
<img src="your-logo.png" alt="App Logo">
</div>
</div>
</body> </body>
</html> </html>

View File

@ -78,10 +78,6 @@ app.on("ready", async () => {
); );
// Create the main window // Create the main window
const win = new BrowserWindow({ const win = new BrowserWindow({
width: 500, width: 500,
@ -92,7 +88,7 @@ app.on("ready", async () => {
maximizable: false, maximizable: false,
closable: true, closable: true,
alwaysOnTop: true, alwaysOnTop: true,
skipTaskbar: true, // skipTaskbar: true,
autoHideMenuBar: true, autoHideMenuBar: true,
frame: true, frame: true,
show: false, show: false,
@ -149,7 +145,7 @@ app.on("ready", async () => {
// ------------------------------------ // ------------------------------------
// HANDLE CLOSE EVENTS // HANDLE CLOSE EVENTS
// ------------------------------------ // ------------------------------------
handleCloseEvents(win); // handleCloseEvents(win);
}); });
@ -173,28 +169,28 @@ app.on("ready", async () => {
// --------------------------- // ---------------------------
// CUSTOM CLOSE BEHAVIOR // CUSTOM CLOSE BEHAVIOR
// --------------------------- // ---------------------------
function handleCloseEvents(window: BrowserWindow) { // function handleCloseEvents(window: BrowserWindow) {
let willClose = false; // let willClose = false;
window.on("close", (e) => { // window.on("close", (e) => {
if (willClose) return; // if (willClose) return;
e.preventDefault(); // e.preventDefault();
window.hide(); // window.hide();
if (app.dock) { // if (app.dock) {
app.dock.hide(); // app.dock.hide();
} // }
}); // });
app.on("before-quit", () => { // app.on("before-quit", () => {
willClose = true; // willClose = true;
}); // });
window.on("show", () => { // window.on("show", () => {
willClose = false; // willClose = false;
}); // });
} // }
// --------------------------- // ---------------------------
// GET MAIN WINDOW EXPORT // GET MAIN WINDOW EXPORT