forked from JohnJunior/electron-desktop-capturing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
overlay.html
69 lines (65 loc) · 2.37 KB
/
overlay.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
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Overlay</title>
<style>
body {
margin: 0;
overflow: hidden;
background: rgba(0, 0, 0, 0.3); /* More transparent background */
color: white;
font-family: Arial, sans-serif;
}
#overlayContent {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
white-space: nowrap;
background: rgba(0, 0, 0, 0); /* Transparent background for the overlay content */
padding: 10px; /* Add some padding to make content readable */
border-radius: 8px; /* Rounded corners */
}
#stats {
display: inline-block;
gap: 20px;
justify-content: center;
align-items: center;
white-space: nowrap; /* Prevents wrapping to a new line */
}
</style>
</head>
<body>
<div id="overlayContent">
<div id="stats">
<span id="matchId">ID: N/A</span>
<span id="sepe"> | </span>
<span id="wins">W: 0</span>
<span id="losses">L: 0</span>
<span id="draws">D: 0</span>
</div>
</div>
<script>
// Access the matchStats data from the exposed API
const winsElement = document.getElementById('wins');
const lossesElement = document.getElementById('losses');
const drawsElement = document.getElementById('draws');
const matchIdElement = document.getElementById('matchId');
function updateStats() {
console.log('Updating stats');
console.log(window);
winsElement.textContent = `W: ${window.electronApi.matchStats.getWins()}`;
lossesElement.textContent = `L: ${window.electronApi.matchStats.getLosses()}`;
drawsElement.textContent = `D: ${window.electronApi.matchStats.getDraws()}`;
matchIdElement.textContent = `ID: ${window.electronApi.matchStats.getStartTime()}`;
}
// Initial update
updateStats();
// Optionally, set up a timer to periodically update the stats
setInterval(updateStats, 16000); // Update every second
</script>
</body>
</html>