Skip to content

Instantly share code, notes, and snippets.

@raphaelpor
Created August 28, 2015 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raphaelpor/80d8503d040ddf865803 to your computer and use it in GitHub Desktop.
Save raphaelpor/80d8503d040ddf865803 to your computer and use it in GitHub Desktop.
Electron CS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Olá Mundo!</title>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
background-color: #222;
color:#fff;
}
.container-full {
padding-top: 10%;
background-color: transparent;
}
</style>
</head>
<body>
<main class="container-full jumbotron">
<div>
<div class="col-lg-12 text-center">
<h1 class="">Olá mundo!</h1>
<p><img src="http://www.concretesolutions.com.br/img/logo.png"></p>
<small>
io.js <script>document.write(process.version)</script><br>
Electron v<script>document.write(process.versions['electron'])</script><br>
<script>document.write(process.platform)</script>
</small>
</div>
</div>
</main>
</body>
</html>
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
// Report crashes to our server.
require('crash-reporter').start();
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is GCed.
var mainWindow = null;
// Quit when all windows are closed.
app.on('window-all-closed', function() {
// 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();
}
});
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', function() {
// Create the browser window.
mainWindow = new BrowserWindow({width: 800, height: 600});
// and load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/index.html');
// Open the devtools.
// mainWindow.openDevTools();
// Emitted when the window is closed.
mainWindow.on('closed', function() {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
});
{
"name" : "electron-testapp",
"version" : "0.1.0",
"main" : "main.js"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment