-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
59 lines (49 loc) · 1.86 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Logi Control Panel</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<script>
const { ipcRenderer } = require('electron');
let isHooked = false;
function pulse() {
console.log('Pulse...')
ipcRenderer.send('pulse-led', document.getElementById('pulse-interval').value);
}
function on() {
console.log('On...')
ipcRenderer.send('on-led');
}
function off() {
console.log('Off...')
ipcRenderer.send('off-led');
}
function change(event) {
var val = Number(event.target.value).toString(16);
if (val.length == 1)
val = '0' + val;
ipcRenderer.send('change-led', val);
}
function hookNotifications() {
ipcRenderer.send('hook-notifications');
document.getElementById('button-hook').setAttribute('disabled', true);
}
function unhookNotifications() {
ipcRenderer.send('unhook-notifications');
document.getElementById('button-hook').removeAttribute('disabled');
}
</script>
</head>
<body style="background: white;">
<h2>Logi Control Panel</h2>
<button onclick="pulse()">Start pulsing LED...</button>
<input id="pulse-interval" type="number" value="2">
<button onclick="on()">ON</button>
<button onclick="off()">OFF</button>
<input type="range" onchange="change(event)" id="brightness" name="brightness" min="0" max="255">
<button id="button-hook" onclick="hookNotifications()">Hook into notifications</button>
<button onclick="unhookNotifications()">Unhook from notifications</button>
<!-- <h5>Made with ♥ by theGeekyLad</h5> -->
</body>
</html>