Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bkniffler/electron-splashscreen
https://github.com/bkniffler/electron-splashscreen
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/bkniffler/electron-splashscreen
- Owner: bkniffler
- License: mit
- Created: 2018-09-28T11:06:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-29T12:19:58.000Z (over 1 year ago)
- Last Synced: 2023-08-05T15:09:41.737Z (over 1 year ago)
- Language: TypeScript
- Size: 525 KB
- Stars: 16
- Watchers: 1
- Forks: 13
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Install
### Yarn
```
yarn add electron-splashscreen
```### NPM
```
npm i electron-splashscreen
```## Example
```jsx
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();
}
});
})
```