-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from jsmolina/feat/vite-electron
migrate to vite and add electron
- Loading branch information
Showing
46 changed files
with
9,601 additions
and
10,901 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
dist | ||
exe/ | ||
.DS_Store | ||
.idea | ||
# Logs | ||
|
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"><link rel="stylesheet" href="b88d04fba731603756b1.css"/><title>Hero and Princess</title><script defer="defer" src="main.js"></script><link href="main.css" rel="stylesheet"></head><body><div class="fontPreload">main</div><div class="game-area"><div class="tablier"><canvas id="game-canvas">You need JS.</canvas></div></div></body></html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> | ||
<link rel="stylesheet" href="./main.css"/> | ||
<title>Hero and Princess</title> | ||
<script type="module" crossorigin src="./assets/index-yFHXXoxu.js"></script> | ||
<link rel="modulepreload" crossorigin href="./assets/phaser-DqFVsdsa.js"> | ||
</head> | ||
<body> | ||
<div class="fontPreload">main</div> | ||
<div class="game-area"> | ||
<div class="tablier"> | ||
<canvas id="game-canvas">You need JS.</canvas> | ||
</div> | ||
<div class="help">Use keys+space. Shift to reset it.</div> | ||
</div> | ||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
const { app, BrowserWindow, ipcMain } = require("electron"); | ||
const path = require("path"); | ||
|
||
// Let electron reloads by itself | ||
if ( | ||
process.env.ELECTRON_DEBUG === "true" || | ||
process.env.ELECTRON_DEBUG === "vscode" | ||
) { | ||
require("electron-reload")(__dirname, {}); | ||
} | ||
|
||
function createWindow() { | ||
// Create the browser window. | ||
const mainWindow = new BrowserWindow({ | ||
autoHideMenuBar: true, | ||
title: "Hero and Princess2", | ||
center: true, | ||
// useContentSize: true, | ||
frame: false, | ||
width: 500, | ||
height: 780, | ||
webPreferences: { | ||
nodeIntegration: true, | ||
}, | ||
}); | ||
mainWindow.setMenuBarVisibility(false) | ||
|
||
// Hot reload | ||
if (process.env.ELECTRON_HOT === "true") { | ||
mainWindow.loadURL("http://localhost:8080"); | ||
} else { | ||
// and load the index.html of the app. | ||
mainWindow.loadFile(path.join(__dirname, "dist/index.html")); | ||
} | ||
|
||
if (process.env.ELECTRON_DEBUG === "true") { | ||
// Open the DevTools. | ||
mainWindow.webContents.openDevTools(); | ||
} | ||
|
||
// keep ratio when scaling | ||
mainWindow.setAspectRatio(0.58); | ||
} | ||
|
||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
app.on("ready", createWindow); | ||
|
||
// Quit when all windows are closed. | ||
app.on("window-all-closed", () => { | ||
// On OS X it is common for applications and their menu bar | ||
// to stay active until the user quits explicitly with Cmd + Q | ||
//if (process.platform !== "darwin") { | ||
app.quit(); | ||
//} | ||
}); | ||
|
||
app.on("activate", () => { | ||
// On OS X it"s common to re-create a window in the app when the | ||
// dock icon is clicked and there are no other windows open. | ||
if (BrowserWindow.getAllWindows().length === 0) createWindow(); | ||
}); | ||
|
||
// In this file you can include the rest of your app"s specific main process | ||
// code. You can also put them in separate files and require them here. |
Oops, something went wrong.