aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-01-17 18:08:06 +0100
committerGitHub <noreply@github.com>2022-01-17 18:08:06 +0100
commit2a9e35aaeceaa2fcfc3f6d3d35a47c808fba0c56 (patch)
tree543adaf1fb28d1602ebb643f34db748caf31a1dc /src
parent0386d37697cd22bd97dd50d0293ff90fe51d0c81 (diff)
parent9807e2f4c626dbc7741447a6f49f01e84a11686f (diff)
downloadViper-2a9e35aaeceaa2fcfc3f6d3d35a47c808fba0c56.tar.gz
Viper-2a9e35aaeceaa2fcfc3f6d3d35a47c808fba0c56.zip
Merge pull request #49 from 0neGal/minimize-button
Add minimize button
Diffstat (limited to 'src')
-rw-r--r--src/app/icons/minimize.pngbin0 -> 981 bytes
-rw-r--r--src/app/index.html5
-rw-r--r--src/app/main.css24
-rw-r--r--src/index.js1
4 files changed, 21 insertions, 9 deletions
diff --git a/src/app/icons/minimize.png b/src/app/icons/minimize.png
new file mode 100644
index 0000000..4169e28
--- /dev/null
+++ b/src/app/icons/minimize.png
Binary files differ
diff --git a/src/app/index.html b/src/app/index.html
index 8ebffff..c8777e4 100644
--- a/src/app/index.html
+++ b/src/app/index.html
@@ -8,7 +8,10 @@
<body>
<div id="bgHolder"></div>
- <div id="close" onclick="ipcRenderer.send('exit')"></div>
+ <div id="winbtns">
+ <div id="minimize" onclick="ipcRenderer.send('minimize')"></div>
+ <div id="close" onclick="ipcRenderer.send('exit')"></div>
+ </div>
<nav class="gamesContainer">
<button id="vpBtn" onclick="page(0)"></button>
diff --git a/src/app/main.css b/src/app/main.css
index 3907461..de0db46 100644
--- a/src/app/main.css
+++ b/src/app/main.css
@@ -26,25 +26,33 @@
background: var(--red);
}
-.playBtn, .gamesContainer button, #close {
+.playBtn, .gamesContainer button, #winbtns div {
cursor: pointer;
}
-#close {
+#winbtns {
z-index: 1;
+ display: flex;
+ position: fixed;
+ top: var(--padding);
+ right: calc(var(--padding) / 2);
+}
+
+#winbtns div {
width: 25px;
opacity: 0.6;
height: 25px;
- position: fixed;
- top: var(--padding);
- right: var(--padding);
+ position: relative;
background-size: contain;
transition: 0.25s ease-in-out;
- background-image: url("icons/close.png");
+ margin-right: calc(var(--padding) / 2);
}
-#close:hover {opacity: 1.0}
-#close:active {transform: scale(0.98)}
+#winbtns #close {background-image: url("icons/close.png")}
+#winbtns #minimize {background-image: url("icons/minimize.png")}
+
+#winbtns div:hover {opacity: 1.0}
+#winbtns div:active {transform: scale(0.98)}
body {
margin: 0;
diff --git a/src/index.js b/src/index.js
index 333b1c9..1dce746 100644
--- a/src/index.js
+++ b/src/index.js
@@ -32,6 +32,7 @@ function start() {
win.loadFile(__dirname + "/app/index.html");
ipcMain.on("exit", () => {process.exit(0)})
+ ipcMain.on("minimize", () => {win.minimize()})
ipcMain.on("winLog", (event, ...args) => {win.webContents.send("log", ...args)});
ipcMain.on("winAlert", (event, ...args) => {win.webContents.send("alert", ...args)});
ipcMain.on("ns-update-event", (event) => win.webContents.send("ns-update-event", event));