Created
October 9, 2018 01:28
-
-
Save converge/db9f9e0bf4c85b13cd2dbd8a9f0cf1ea to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# | |
# MAIN.JS | |
# | |
const { app, BrowserWindow } = require('electron') | |
require('electron-reload') | |
let win | |
function createWindow() { | |
win = new BrowserWindow( {width: 800, height: 600}) | |
win.loadFile('index.html') | |
win.webContents.openDevTools() | |
win.on('closed', () => { | |
win = null | |
}) | |
} | |
app.on('ready', createWindow) | |
app.on('window-all-closed', () => { | |
if (process.platform != 'Darwin') { | |
app.quit() | |
} | |
}) | |
app.on('active', () => { | |
if (win == null) { | |
createWindow() | |
} | |
}) | |
# | |
# HTML | |
# | |
<button class="nav-link active" id="login_window" role="tab" data-toggle="tab"> | |
<i class="material-icons">account_circle</i> | |
Login | |
</button> | |
# | |
# actions.js | |
# | |
const login_window = document.getElementById('login_window') | |
login_window.addEventListener('click', function(event) { | |
console.log('okkk1') | |
win.loadFile('index2.html') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment