Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. const url = require('url');
  2. const path = require('path');
  3.  
  4.  
  5. const { app, BrowserWindow, Menu } = electron;
  6.  
  7. let mainWindow;
  8. let { ipcMain } = electron;
  9. let runAnalysisWindow
  10.  
  11. //Listen for an app to be ready.
  12. app.on('ready', function() {
  13. //Create a new Window.
  14. mainWindow = new BrowserWindow({});
  15. //Load html into Window.
  16. mainWindow.loadURL(url.format({
  17. pathname: path.join(__dirname, 'mainWindow.html'),
  18. protocol: 'file:',
  19. slashes: true
  20. }));
  21. //Build menu from template.
  22. const mainMenu = Menu.buildFromTemplate(mainMenuTemplate);
  23. //Insert the menu.
  24. Menu.setApplicationMenu(mainMenu);
  25.  
  26. });
  27.  
  28.  
  29. app.on('closed', function() {
  30. mainWindow = null;
  31. });
  32.  
  33. // Quit when all windows are closed.
  34. app.on('window-all-closed', function() {
  35. // On OS X it is common for applications and their menu bar
  36. // to stay active until the user quits explicitly with Cmd + Q
  37. if (process.platform !== 'darwin') {
  38. app.quit()
  39. }
  40. })
  41.  
  42. app.on('activate', function() {
  43. // On OS X it's common to re-create a window in the app when the
  44. // dock icon is clicked and there are no other windows open.
  45. if (mainWindow === null) {
  46. createWindow()
  47. }
  48. })
  49.  
  50.  
  51.  
  52. //Create menu template.
  53.  
  54. const mainMenuTemplate = [{
  55. label: 'File',
  56. submenu: [{
  57. label: 'Run Analysis'
  58. },
  59. {
  60. label: 'Stop Analysis'
  61. },
  62. {
  63. label: 'Generate Report'
  64.  
  65. },
  66. {
  67. label: 'Previous Reports'
  68. },
  69. {
  70. label: 'Help'
  71. },
  72. {
  73. label: 'Quit',
  74. accelerator: process.platform == 'darwin' ? 'Command+Q' : 'Ctrl+Q', //Use the shortcut to quit the app in windows and mac.
  75. click() {
  76. app.quit();
  77. }
  78. }
  79. ]
  80.  
  81. }];
  82.  
  83. <!DOCTYPE html>
  84. <html lang="en">
  85. <head>
  86. <title>SparrowAI</title>
  87. <style>
  88. .button {
  89. background-color: #4CAF50; /* Green */
  90. border: none;
  91. color: white;
  92. padding: 16px 32px;
  93. text-align: center;
  94. text-decoration: none;
  95. display: inline-block;
  96. font-size: 16px;
  97. margin: 4px 2px;
  98. -webkit-transition-duration: 0.4s; /* Safari */
  99. transition-duration: 0.4s;
  100. cursor: pointer;
  101. }
  102.  
  103. .button1 {
  104. background-color: Transparent;
  105. color: white;
  106. border: 2px solid #ffffff;
  107. }
  108. .button1:hover {
  109. background-color: #555555;
  110. color: white;
  111. }
  112. </style>
  113. </head>
  114. <body background = "log_page.jpg">
  115.  
  116. <button type="button" class="button button1"> Login</button>
  117.  
  118.  
  119.  
  120. </body>
  121. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement