1
0
mirror of https://github.com/TheGreyDiamond/Enlight.git synced 2025-07-18 04:33:50 +02:00

Added font awesome and more

This commit is contained in:
TheGreyDiamond
2020-11-22 20:38:10 +01:00
parent 11145b6fba
commit e0e504fa0c
1709 changed files with 135182 additions and 50 deletions

103
index.js
View File

@ -1,50 +1,85 @@
const { app, BrowserWindow } = require('electron')
const ejs = require("eja");
const { app, BrowserWindow, screen } = require("electron");
const fs = require('fs');
const { win32 } = require("path");
const sysInf = require('systeminformation');
function createWindow () {
var aWin2 = undefined;
function createWindow() {
const win = new BrowserWindow({
width: 800,
height: 600,
width: screen.getPrimaryDisplay().size.width,
height: screen.getPrimaryDisplay().size.height,
webPreferences: {
nodeIntegration: true
}
})
nodeIntegration: true,
},
});
win.setFullScreen(true);
win.loadFile('ui_templates/index.html')
win.setMenuBarVisibility(false)
win.setAutoHideMenuBar(true)
win.loadFile("ui_templates/index.html");
setInterval(function(){
// Updating battery
}, 500)
}
function createStartupInfo(){
const win2 = new BrowserWindow({
width: 400,
height: 200,
frame: false,
webPreferences: {
nodeIntegration: true
}
})
win2.setFullScreen(false);
win2.setAlwaysOnTop(true);
function createStartupInfo() {
const win2 = new BrowserWindow({
width: 400,
height: 200,
frame: false,
webPreferences: {
nodeIntegration: true,
},
});
win2.setFullScreen(false);
win2.setAlwaysOnTop(true);
win2.loadFile("ui_templates/startUp.html");
win2.show();
return(win2)
}
function doneLoading(){
var fadeOutI = 1;
aWin2.webContents.executeJavaScript("document.getElementById('current').innerHTML = 'Done';")
var fadeIntervall = setInterval(function(){
try{if(fadeOutI < 0){
clearInterval(fadeIntervall);
aWin2.webContents.executeJavaScript("window.close()")
}else{
aWin2.setOpacity(fadeOutI)
fadeOutI = fadeOutI - 0.05
}
}catch(e){
console.warn("Startup window got destroyed!")
clearInterval(fadeIntervall);
}
win2.loadFile('ui_templates/startUp.html')
win2.show()
}, 20)
//aWin2.webContents.executeJavaScript("window.close()")
}
function init(){
createWindow();
createStartupInfo();
function init() {
createWindow();
aWin2 = createStartupInfo();
setTimeout(doneLoading, 2000);
//sysInf.battery()
//.then(data => console.log(data))
//.catch(error => console.error(error));
}
app.whenReady().then(init)
app.whenReady().then(init);
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
}
})
});
app.on('activate', () => {
app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
createWindow();
}
})
});