Skip to content

Commit

Permalink
ar(feat) [DPCP-69]: Load Screen (#3)
Browse files Browse the repository at this point in the history
* ar(feat) DPCP-69: Load Screen

* ar(feat) DPCP-69: Load Screen

* ar(feat) DPCP-69: Load Screen
  • Loading branch information
angeloreale authored Aug 7, 2024
1 parent 9038deb commit 5f44f26
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 12 deletions.
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ dist
.pnp.*

.vite/

.DS_Store
Binary file removed icons/.DS_Store
Binary file not shown.
71 changes: 71 additions & 0 deletions icons/icon-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 32 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,39 @@
<html>
<head>
<meta charset="UTF-8" />
<title>Hello World!</title>
<title>DreamPip</title>
<script>
const home = 'https://alpha.dreampip.com';
const getHome = async () => {
try {
return await fetch(home);
} catch (e) {
return { ok: false, status: 500, message: JSON.stringify(e) };
}
};
const init = async () => {
const response = await getHome();
if (response.ok && response.status === 200) {
window.location.href = home;
} else {
setTimeout(() => init(), 2000);
}
};

init();
</script>
</head>
<body>
<h1>💖 Hello World!</h1>
<p>Welcome to your Electron application.</p>
<body
style="
height: 100vh;
width: 100vw;
background-color: #353535;
display: flex;
align-items: center;
justify-content: center;
"
>
<img style="max-width: 320px" src="./icons/icon-white.svg" alt="DreamPip Logo" />
<script type="module" src="/src/renderer.ts"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "DreamPip",
"productName": "DreamPip",
"version": "0.0.1",
"version": "0.0.2",
"description": "DreamPip's Desktop App",
"main": ".vite/build/main.js",
"build": {
Expand Down
12 changes: 5 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ if (process.defaultApp) {
app.setAsDefaultProtocolClient('web+dreampip');
}

const MAIN_WINDOW_VITE_DEV_SERVER_URL = 'https://alpha.dreampip.com';

const createWindow = () => {
// Create the browser window.
const mainWindow = new BrowserWindow({
Expand All @@ -28,11 +26,11 @@ const createWindow = () => {
});

// and load the index.html of the app.
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL);
} else {
mainWindow.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`));
}
// if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
// mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL);
// } else {
mainWindow.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`));
// }

return mainWindow;
// Open the DevTools.
Expand Down

0 comments on commit 5f44f26

Please sign in to comment.