electron-splashscreen
v1.0.0
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
217
Readme
Install
Yarn
yarn add electron-splashscreen
NPM
npm i electron-splashscreen
Example
import { initSplashScreen, OfficeTemplate } from 'electron-splashscreen';
import isDev from 'electron-is-dev';
import { resolve } from 'app-root-path';
const mainWindow = new BrowserWindow({
...
});
const hideSplashscreen = initSplashScreen({
mainWindow,
icon: isDev ? resolve('assets/icon.ico') : undefined,
url: OfficeTemplate,
width: 500,
height: 300,
brand: 'My Brand',
productName: 'My App',
logo: resolve('assets/logo.svg'),
website: 'www.my-brand.com',
text: 'Initializing ...'
});
You can now either within main:
mainWindow.once('ready-to-show', () => {
mainWindow.show();
hideSplashscreen();
});
or within renderer
// within renderer
import { reportReady } from 'electron-splashscreen';
// call this whenever your app is ready, for example after all data is loaded
reportReady();