//
//本コードは個人の学習目的で作成されたものであり、いかなる保証も行いません。
//利用はすべて自己責任でお願いします。
//
↓ここまでのファイル構成と内容。
//ファイル構成
D:\xampp8\htdocs\shv-reminder
├index.html
├main.js
├package.json
├package-lock.json //自動生成ファイル
├node_modules/ //自動生成フォルダ
└data/ //自動生成フォルダ
/* -------------------------------------------------------------- */
// index.html
シンプルカレンダー
/* ---------------------------------------------------------------- */
//main.js
const { app, BrowserWindow, Notification } = require('electron');
function createWindow() {
const win = new BrowserWindow({
width: 1000,
height: 800,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
}
});
win.loadFile('index.html'); // ←これまで作ったカレンダーがそのまま使える!
}
app.whenReady().then(createWindow);
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit();
});
/* ---------------------------------------------------------------- */
//package.json
{
"name": "shv-reminder",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "electron ."
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"electron": "^38.1.2"
}
}