创建项目
git clone https://github.com/electron/electron-quick-start
cd electron-quick-start
npm install
npm start
高斯模糊
npm install DrunkWinter/electron-vibrancy-windows
使用
const vibrancy = require('electron-vibrancy-windows');
function createWindow() {
// Create the browser window.
const mainWindow = new BrowserWindow({
title: 'My App',
width: 1200,
height: 760,
frame: false,
backgroundColor: '#00000000',
webPreferences: {
nodeIntegration: true
}
});
vibrancy.EnableVibrancy(mainWindow);
mainWindow.loadFile(path.join(__dirname, 'index.html'));
};
app.on('ready', createWindow);
网友评论