@drdgvhbh/electron-splashscreen
v0.1.7
Published
<div align="center"> <h2>electron-splashscreen</h2> <img alt="electron-splashscreen" src="https://raw.githubusercontent.com/bkniffler/electron-splashscreen/master/assets/preview.png" height="300px" /> <br /> <strong>Nice splashscreens for your ele
Downloads
1
Readme
Install
Yarn
yarn add electron-splashscreen
NPM
npm i electron-splashscreen
Example
import { initSplashScreen, Office } from 'electron-splashscreen';
import isDev from 'electron-is-dev';
import { resolve } from 'app-root-path';
app.on('ready', async () => {
const mainWindow = new BrowserWindow({
...
});
const hideSplashscreen = initSplashScreen({
mainWindow,
icon: isDev ? resolve('assets/icon.ico') : undefined,
url: Office,
width: 500,
height: 300,
brand: 'My Brand',
productName: 'My App',
logo: resolve('assets/logo.svg'),
website: 'www.my-brand.com',
text: 'Initializing ...'
});
// send an ipcRenderer.send('ready') from your browser as soon as the app is ready
ipcMain.on('ready', hideSplashscreen);
mainWindow.once('ready-to-show', () => {
// Electron-splash will automatically show the mainwindow as soon, but you can show it earlier in dev
if (isDev) {
mainWindow.show();
}
});
})