Skip to content

Commit

Permalink
Refactor (#6)
Browse files Browse the repository at this point in the history
* Refactoring, to prepare for touchscreen input

* Almost done

* Everything should work

* Last fixes and adjustments
  • Loading branch information
UnchartedBull authored Jul 11, 2019
1 parent c261af6 commit 75aab63
Show file tree
Hide file tree
Showing 38 changed files with 1,558 additions and 371 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ testem.log

# System Files
.DS_Store
Thumbs.db
Thumbs.db

.vscode
2 changes: 1 addition & 1 deletion e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"target": "es6",
"types": [
"jasmine",
"jasminewd2",
Expand Down
60 changes: 60 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const {
app,
BrowserWindow
} = require("electron");

const args = process.argv.slice(1);
const serve = args.some(val => val === '--serve');
const big = args.some(val => val === '--big-screen')

let window;

function createWindow() {

if(!big) {
window = new BrowserWindow({
width: serve ? 1000 : 480,
height: 320,
frame: false,
fullscreen: false
})
} else {
window = new BrowserWindow({
width: serve ? 1400 : 800,
height: 480,
frame: false,
fullscreen: false
})
}

if (serve) {
require('electron-reload')(__dirname, {
electron: require(`${__dirname}/node_modules/electron`)
});
window.loadURL('http://localhost:4200');
} else {
window.loadFile('index.html')
}

if (serve) window.webContents.openDevTools();
// window.webContents.openDevTools();

window.on('closed', () => {
window = null;
});

}

app.on('ready', createWindow)

app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
}
});

app.on("activate", () => {
if (window === null) {
createWindow();
}
});
Loading

0 comments on commit 75aab63

Please sign in to comment.