Skip to content

Added a splash screen for the app #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
const path = require('path');
//import for spalsh screen dependency
const { initSplashScreen, OfficeTemplate } = require('electron-splashscreen');
//path resolver dependency for splash screen
const { resolve } = require('app-root-path');


const {
app,
Expand Down Expand Up @@ -82,7 +87,7 @@ ipcMain.on('update-file', () => {
const createWindow = () => {
// Create the browser window.
// eslint-disable-next-line
const { width, height } = require('electron').screen.getPrimaryDisplay().size;
// const { width, height } = require('electron').screen.getPrimaryDisplay().size;
mainWindow = new BrowserWindow({
width: 1920,
height: 1080,
Expand All @@ -98,11 +103,27 @@ const createWindow = () => {
}
});

//splash screen deets
const hideSplashscreen = initSplashScreen({
mainWindow,
icon: resolve('/src/public/icons/png/64x64.png'),
url: OfficeTemplate,
width: 500,
height: 300,
brand: 'OS Labs',
productName: 'ReacType',
logo: resolve('/src/public/icons/png/64x64.png'),
color: '#3BBCAF',
website: 'www.reactype.io',
text: 'Initializing ...'
});

// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/build/index.html`);
// load page once window is loaded
mainWindow.once('ready-to-show', () => {
mainWindow.show();
hideSplashscreen();
});

const template = [
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"@types/react-redux": "^7.0.8",
"@types/react-syntax-highlighter": "^11.0.4",
"ace-builds": "^1.4.8",
"app-root-path": "^3.0.0",
"autoprefixer": "^9.0.1",
"babel-polyfill": "^6.26.0",
"classnames": "^2.2.6",
Expand All @@ -128,6 +129,7 @@
"csstype": "^2.6.9",
"d3": "^5.9.2",
"electron-reload": "^1.4.0",
"electron-splashscreen": "^1.0.0",
"enzyme": "^3.4.1",
"enzyme-adapter-react-16": "^1.2.0",
"konva": "^4.2.0",
Expand Down