-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
44 lines (42 loc) · 1.13 KB
/
index.html
File metadata and controls
44 lines (42 loc) · 1.13 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Electron App</title>
<style>
body {
margin: 0;
padding-top: 30px; /* Added padding to body */
-webkit-app-region: drag;
}
.content {
padding-top: 60px; /* Increased padding to avoid overlap */
}
</style>
</head>
<body>
<div class="content">
<h1>Welcome to Electron</h1>
</div>
<script>
const { remote } = require('electron');
window.minimize = () => remote.getCurrentWindow().minimize();
window.maximize = () => {
const win = remote.getCurrentWindow();
if (win.isMaximized()) {
win.unmaximize();
} else {
win.maximize();
}
};
window.close = () => remote.getCurrentWindow().close();
// Ensure padding is maintained on page navigation
const maintainPadding = () => {
document.querySelector('.content').style.paddingTop = '60px';
};
window.addEventListener('load', maintainPadding);
window.addEventListener('hashchange', maintainPadding);
window.addEventListener('popstate', maintainPadding);
maintainPadding(); // Ensure padding on initial load
</script>
</body>
</html>