mekasu0124

Untitled

Jul 31st, 2024
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { app, BrowserWindow } = require('electron');
  2. const path = require('node:path');
  3.  
  4. require('@electron/remote/main').initialize();
  5.  
  6. let mainWindow;
  7. let loadingWindow;
  8.  
  9. function createLoadingScreen() {
  10.   loadingWindow = new BrowserWindow({
  11.     width: 600,
  12.     height: 400,
  13.     transparent: true,
  14.     alwaysOnTop: false,
  15.     webPreferences: {
  16.       enableRemoteModule: true,
  17.     },
  18.     icon: path.join(__dirname, "/favicon.ico")
  19.   });
  20.  
  21.   loadingWindow.loadURL(path.join(__dirname, 'loading.html'));
  22. }
  23.  
  24. function createMainWindow() {
  25.   mainWindow = new BrowserWindow({
  26.     width: 1400,
  27.     height: 900,
  28.     webPreferences: {
  29.       enableRemoteModule: true
  30.     },
  31.     icon: path.join(__dirname, "/favicon.ico")
  32.   });
  33.  
  34.   mainWindow.loadURL('http://localhost:3000');
  35. };
  36.  
  37. app.on('ready', () => {
  38.   createLoadingScreen();
  39.  
  40.   setTimeout(() => {
  41.     createMainWindow();
  42.     loadingWindow.close();
  43.   }, 6000);
  44. });
  45.  
Advertisement
Add Comment
Please, Sign In to add comment