- add gui electron application

! sometimes the tray icon does not open it's context menu
This commit is contained in:
grey committed 2022-08-18 22:00:24 +02:00
1 parent 16a2549942
commit 013ad881d3
11 files changed
+2115 -10

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" width="3840" height="2160"><path d="M1900.8,1049.6L1771.1,955.2L1799.2,1079.8Z" fill="rgb(250,148,95)" shape-rendering="crispEdges"></path><path d="M1900.8,1049.6L1880.3,939.9L1771.1,955.2Z" fill="rgb(245,147,94)" shape-rendering="crispEdges"></path><path d="M1621.5,1095.1L1798.1,1201L1799.2,1079.8Z" fill="rgb(242,138,88)" shape-rendering="crispEdges"></path><path d="M1799.2,1079.8L1891.6,1202.3L1900.8,1049.6Z" fill="rgb(251,141,90)" shape-rendering="crispEdges"></path><path d="M1798.1,1201L1891.6,1202.3L1799.2,1079.8Z" fill="rgb(242,132,83)" shape-rendering="crispEdges"></path><path d="M1891.6,1202.3L2052.3,1044.8L1900.8,1049.6Z" fill="rgb(246,134,84)" shape-rendering="crispEdges"></path><path d="M1900.8,1049.6L2052.3,1044.8L1880.3,939.9Z" fill="rgb(249,143,91)" shape-rendering="crispEdges"></path><path d="M1771.1,955.2L1621.5,1095.1L1799.2,1079.8Z" fill="rgb(244,145,93)" shape-rendering="crispEdges"></path><path d="M2098.1,887.8L1882.2,753L1880.3,939.9Z" fill="rgb(243,150,98)" shape-rendering="crispEdges"></path><path d="M1880.3,939.9L1795.4,734.4L1771.1,955.2Z" fill="rgb(248,159,105)" shape-rendering="crispEdges"></path><path d="M1771.1,955.2L1561.1,901L1621.5,1095.1Z" fill="rgb(245,155,102)" shape-rendering="crispEdges"></path><path d="M1882.2,753L1795.4,734.4L1880.3,939.9Z" fill="rgb(252,166,112)" shape-rendering="crispEdges"></path><path d="M2052.3,1044.8L2098.1,887.8L1880.3,939.9Z" fill="rgb(252,148,97)" shape-rendering="crispEdges"></path><path d="M1599.1,767.1L1561.1,901L1771.1,955.2Z" fill="rgb(242,162,108)" shape-rendering="crispEdges"></path><path d="M1425.3,1206.7L1635.5,1233.9L1621.5,1095.1Z" fill="rgb(247,148,98)" shape-rendering="crispEdges"></path><path d="M1621.5,1095.1L1635.5,1233.9L1798.1,1201Z" fill="rgb(247,143,93)" shape-rendering="crispEdges"></path><path d="M1900.4,1390.7L2053.4,1249.2L1891.6,1202.3Z" fill="rgb(243,122,79)" shape-rendering="crispEdges"></path><path d="M1900.4,1390.7L1891.6,1202.3L1798.1,1201Z" fill="rgb(246,129,84)" shape-rendering="crispEdges"></path><path d="M1891.6,1202.3L2053.4,1249.2L2052.3,1044.8Z" fill="rgb(247,130,83)" shape-rendering="crispEdges"></path><path d="M2052.3,1044.8L2207.2,958.9L2098.1,887.8Z" fill="rgb(238,133,84)" shape-rendering="crispEdges"></path><path d="M1795.4,734.4L1599.1,767.1L1771.1,955.2Z" fill="rgb(251,171,116)" shape-rendering="crispEdges"></path><path d="M2098.1,887.8L2112.2,765.7L1882.2,753Z" fill="rgb(239,149,98)" shape-rendering="crispEdges"></path><path d="M1951.9,601.2L1726.7,614.3L1795.4,734.4Z" fill="rgb(245,169,115)" shape-rendering="crispEdges"></path><path d="M2233.4,1068.4L2207.2,958.9L2052.3,1044.8Z" fill="rgb(242,130,83)" shape-rendering="crispEdges"></path><path d="M2098.1,887.8L2208.3,763.5L2112.2,765.7Z" fill="rgb(238,145,96)" shape-rendering="crispEdges"></path><path d="M1454.9,797.8L1460,947.4L1561.1,901Z" fill="rgb(250,176,121)" shape-rendering="crispEdges"></path><path d="M1561.1,901L1460,947.4L1621.5,1095.1Z" fill="rgb(243,159,105)" shape-rendering="crispEdges"></path><path d="M1612,1374.5L1720.8,1376.1L1635.5,1233.9Z" fill="rgb(247,136,92)" shape-rendering="crispEdges"></path><path d="M1635.5,1233.9L1720.8,1376.1L1798.1,1201Z" fill="rgb(246,135,90)" shape-rendering="crispEdges"></path><path d="M1720.8,1376.1L1900.4,1390.7L1798.1,1201Z" fill="rgb(236,120,77)" shape-rendering="crispEdges"></path><path d="M2053.4,1249.2L2233.4,1068.4L2052.3,1044.8Z" fill="rgb(243,125,80)" shape-rendering="crispEdges"></path><path d="M1951.9,601.2L1795.4,734.4L1882.2,753Z" fill="rgb(242,161,108)" shape-rendering="crispEdges"></path><path d="M1795.4,734.4L1726.7,614.3L1599.1,767.1Z" fill="rgb(246,172,118)" shape-rendering="crispEdges"></path><path d="M2112.2,765.7L1951.9,601.2L1882.2,753Z" fill="rgb(251,165,113)" shape-rendering="crispEdges"></path><path d="M1472.7,1380.8L1612,1374.5L1635.5,1233.9Z" fill="rgb(243,136,92)" shape-rendering="crispEdges"></path><path d="M1720.8,1376.1L1796.4,1539.4L1900.4,1390.7Z" fill="rgb(236,115,74)" shape-rendering="crispEdges"></path><path d="M1567.9,621.5L1454.9,797.8L1599.1,767.1Z" fill="rgb(248,182,127)" shape-rendering="crispEdges"></path><path d="M1599.1,767.1L1454.9,797.8L1561.1,901Z" fill="rgb(243,172,118)" shape-rendering="crispEdges"></path><path d="M1291.2,1119.9L1408.4,1107L1280.5,887.9Z" fill="rgb(241,160,106)" shape-rendering="crispEdges"></path><path d="M1460,947.4L1408.4,1107L1621.5,1095.1Z" fill="rgb(249,161,107)" shape-rendering="crispEdges"></path><path d="M2207.2,958.9L2208.3,763.5L2098.1,887.8Z" fill="rgb(244,144,96)" shape-rendering="crispEdges"></path><path d="M2112.2,765.7L2079,591.2L1951.9,601.2Z" fill="rgb(246,161,110)" shape-rendering="crispEdges"></path><path d="M2386.1,789.2L2208.3,763.5L2207.2,958.9Z" fill="rgb(239,140,93)" shape-rendering="crispEdges"></path><path d="M1408.4,1107L1425.3,1206.7L1621.5,1095.1Z" fill="rgb(246,153,101)" shape-rendering="crispEdges"></path><path d="M1570.9,443.7L1567.9,621.5L1726.7,614.3Z" fill="rgbLine truncated

After

Width:  |  Height:  |  Size: 97 KiB

+222
View File
@@ -0,0 +1,222 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>openCountdown</title>
</head>
<body>
<style>
body,
html {
margin: 0;
padding: 0;
-webkit-app-region: drag;
}
body {
background-color: rgba(35, 35, 35, 1);
color: white;
font-family: 'Helvetica';
overflow: hidden;
}
#wrap {
width: 100%;
margin-top: 20px;
display: block;
text-align: center;
}
#logo {
width: 200px;
padding-top: 20px;
padding-bottom: 10px;
text-align: center;
user-select: none;
}
#actions {
padding: 10px;
display: block;
box-shadow: inset 0px 5px 10px rgba(0, 0, 0, 0.3);
padding-top: 20px;
padding-bottom: 20px;
background-color: #d40215;
background-image: url("background.svg");
background-position: 60% 60%;
user-select: none;
}
.dobutton {
font-size: 1em;
padding: 10px 20px;
border: 0px;
user-select: none;
cursor: pointer;
border-radius: 4px;
}
#launch {
background-color: rgba(255, 255, 255, 1);
margin-right: 5px;
border: 1px solid white;
}
#hide {
background-color: rgba(255, 255, 255, 0.1);
color: white;
margin-right: 5px;
border: 1px solid white;
}
#close {
background-color: rgba(255, 255, 255, 0.1);
color: white;
border: 1px solid white;
}
input {
-webkit-appearance: textfield;
background-color: white;
-webkit-rtl-ordering: logical;
cursor: text;
padding: 1px;
border-width: 2px;
border-style: inset;
border-color: initial;
border-image: initial;
}
#status,
#model {
user-select: none !important;
}
#status {
font-size: 40px;
font-weight: 100;
margin: 0;
color: rgba(255, 255, 255, 0.4);
}
#model {
font-size: 14px;
}
h1 {
font-size: 40px;
padding-top: 20px;
font-weight: 100;
}
#url {
padding-top: 5px;
padding-bottom: 10px;
-webkit-app-region: no-drag !important;
}
#meh {
background-color: #b00013;
background-image: url("background.svg");
background-position: 90% 90%;
margin-top: 30px;
padding-bottom: 10px;
}
textarea:focus,
input:focus {
outline: 0;
}
#ifs,
input[type='button'] {
-webkit-app-region: no-drag !important;
}
input {
-webkit-app-region: no-drag !important;
}
#ifp {
width: 50px;
text-align: center;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
background-color: #d40215;
font-size: 13px;
color: #fff;
padding-top: 3px;
padding-bottom: 3px;
border: 1px solid white;
border-right-width: 1px;
}
#ifpb {
cursor: pointer;
border: 1px solid #ccc;
background-color: #b00013;
color: white;
border: 1px solid white;
padding: 3px 8px;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
border-left-width: 0px;
margin-top: -1px;
font-size: 13px;
}
#ifpb:hover {
background-color: #666;
}
#ift {
color: white;
-webkit-appearance: checkbox;
cursor: pointer;
}
#ifs {
background-color: #d40215;
color: #fff;
border: 1px solid white;
font-size: 12px !important;
margin-bottom: -4px;
}
#guitext {
font-size: 12px;
color: white;
padding-top: 0px;
padding-bottom: 2px;
}
#bottombuttons {
padding-bottom: 100px;
}
</style>
<div id="wrap">
<div id="topwrap">
<img id="logo" src="../static/logo/logoProposal.svg" alt="openCountdown" />
<div id="model">model_text (version_etc)</div>
</div>
<div id="meh">
<h1 id="status">Status</h1>
<div id="url">URL</div>
</div>
<div id="actions">
<p><input type="text" maxlength="5" id="ifp" value="8000" /><input type="button" id="ifpb" value="Change" /></p>
<p>
<input type="checkbox" id="ift" />
<label for="ift" style="font-size: 12px">Start minimized</label>
</p>
<div id="bottombuttons">
<input type="button" class="dobutton" value="Launch GUI" id="launch" />
<input type="button" class="dobutton" value="Hide" id="hide" />
<input type="button" class="dobutton" value="Quit" id="close" />
</div>
</div>
</div>
<script type="text/javascript" src="window.js"></script>
</body>
</html>
+33
View File
@@ -0,0 +1,33 @@
document.getElementById('launch').addEventListener('click', function () {
api.send('skeleton-launch-gui')
})
document.getElementById('hide').addEventListener('click', function () {
api.send('skeleton-minimize')
})
document.getElementById('close').addEventListener('click', function () {
api.send('skeleton-close')
})
api.receive('info', function (info) {
document.getElementById('status').innerHTML = info.appStatus
document.getElementById('url').innerHTML = info.appURL
document.getElementById('model').innerHTML = `${info.appName}`
document.getElementById('ift').checked = info.startMinimised
document.getElementById('ifp').value = configObject.port
document.title = info.appName
})
api.send('info')
document.getElementById('ifpb').addEventListener('click', function () {
var e = document.getElementById('ifp')
api.send('skeleton-bind-port', e.value)
})
document.getElementById('ift').addEventListener('click', function () {
var e = document.getElementById('ift')
api.send('skeleton-start-minimised', e.checked)
})
api.send('skeleton-ready')
+12
View File
@@ -0,0 +1,12 @@
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('api', {
send: (channel, data) => {
// whitelist channels
ipcRenderer.send(channel, data)
},
receive: (channel, func) => {
// Deliberately strip event as it includes `sender`
ipcRenderer.on(channel, (event, ...args) => func(...args))
},
})