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
const { Notification } = require( 'electron' ); | |
// display files added notification | |
exports.filesAdded = ( size ) => { | |
const notif = new Notification( { | |
title: 'Files added', | |
body: `${ size } file(s) has been successfully added.` | |
} ); | |
notif.show(); |
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
const { ipcMain } = require( 'electron' ); | |
const path = require( 'path' ); | |
const fs = require( 'fs-extra' ); | |
const os = require( 'os' ); | |
const open = require( 'open' ); | |
const chokidar = require( 'chokidar' ); | |
// local dependencies | |
const notification = require( './notification' ); |
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
const { app, BrowserWindow, ipcMain, dialog } = require( 'electron' ); | |
const path = require( 'path' ); | |
// local dependencies | |
const io = require( './main/io' ); | |
`` | |
// open a window | |
const openWindow = () => { | |
const win = new BrowserWindow( { | |
width: 800, |
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
{ | |
"name": "electron-lessons", | |
"version": "1.0.0", | |
"main": "app/index.js", | |
"scripts": { | |
"start": "electron ." | |
}, | |
"devDependencies": { | |
"electron": "^11.1.1" | |
}, |
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
<!DOCTYPE html> | |
<html lang='en'> | |
<head> | |
<meta charset='UTF-8'> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0'> | |
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" /> | |
<title>Image Window</title> | |
<style> | |
body { |
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
<!DOCTYPE html> | |
<html lang='en'> | |
<head> | |
<meta charset='UTF-8'> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0'> | |
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" /> | |
<title>My Electron App</title> | |
<style> | |
body { |
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
const { app, BrowserWindow, ipcMain } = require( 'electron' ); | |
// open a window | |
const openWindow = ( type ) => { | |
const win = new BrowserWindow( { | |
width: 600, | |
height: 300, | |
} ); | |
if( type === 'image' ) { |
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 Process | Renderer Process | Common | |
---|---|---|---|
app | desktopCapturer | clipboard | |
autoUpdater | ipcRenderer | crashReporter | |
BrowserView | remote | nativeImage | |
BrowserWindow | webFrame | shell | |
contentTracing | |||
dialog | |||
globalShortcut | |||
inAppPurchase | |||
ipcMain |
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
$ git add -A | |
$ git commit -m "Initial release" | |
[main 3e5eee6] Initial release | |
9 files changed, 1172 insertions(+) | |
create mode 100644 Procfile | |
create mode 100644 lenna.png | |
create mode 100644 package-lock.json | |
create mode 100644 package.json | |
create mode 100644 server.js |
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
<html lang='en'> | |
<head> | |
<meta charset='UTF-8'> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0'> | |
<title>Image Resizer</title> | |
<!-- external resources --> | |
<link rel='preconnect' href='https://fonts.gstatic.com'> | |
<link href='https://fonts.googleapis.com/css2?family=Poppins:wght@300;400&family=Teko:wght@700&display=swap' | |
rel='stylesheet'> |