Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #6

Merged
merged 4 commits into from
Jul 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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