Skip to content

Commit

Permalink
Added splashscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
el3um4s committed Sep 16, 2022
1 parent 09595d8 commit 3063b02
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 20 deletions.
40 changes: 20 additions & 20 deletions electron/mainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ class Main {
this.configDev = new ConfigureDev(this.settingsDev);

app.on("ready", async () => {
// let loading = new BrowserWindow({
// show: false,
// frame: false,
// width: 300,
// height: 300,
// transparent: true,
// });

this.window = await this.createWindow();
this.onEvent.emit("window-created");

// loading.once("show", async () => {
// this.window = await this.createWindow();
// this.onEvent.emit("window-created");
// loading.hide();
// loading.close();
// });
// loading.loadURL(path.join(__dirname, "www", "loading.html"));
// loading.show();
let loading = new BrowserWindow({
show: false,
frame: false,
width: 300,
height: 300,
transparent: true,
});

// this.window = await this.createWindow();
// this.onEvent.emit("window-created");

loading.once("show", async () => {
this.window = await this.createWindow();
this.onEvent.emit("window-created");
loading.hide();
loading.close();
});
loading.loadURL(path.join(__dirname, "www", "loading.html"));
loading.show();
});

app.on("window-all-closed", this.onWindowAllClosed);
Expand All @@ -81,7 +81,7 @@ class Main {
try {
await window.loadURL("http://localhost:5173/");
} catch (error) {
console.log(`ERROR: window.loadURL("http://localhost:3000/");`);
console.log(`ERROR: window.loadURL("http://localhost:5173/");`);
console.log(error);
}
} else if (this.configDev.isElectronServe()) {
Expand Down
18 changes: 18 additions & 0 deletions svelte/static/loading.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<title>Loading</title>
</head>
<body>
<div style="width:100%; text-align: center;">
<div style="width: 256px; height: 256px; border-radius: 100%; background-color: rgb(240,240,240);">
<img width="256px" src="loading.png"/>
</div>
</div>
</body>
</html>
Binary file added svelte/static/loading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3063b02

Please sign in to comment.