diff options
author | 0neGal <mail@0negal.com> | 2024-12-20 18:39:57 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2024-12-20 18:39:57 +0100 |
commit | 1be8c774251c3a1e1e3559f628aa24b465ab8685 (patch) | |
tree | 0660c8e634f9dd047975e6c8a8122275af3eec6f /src/app | |
parent | 554fe88942135583404ddf8c1a97f342287cea5a (diff) | |
download | Viper-1be8c774251c3a1e1e3559f628aa24b465ab8685.tar.gz Viper-1be8c774251c3a1e1e3559f628aa24b465ab8685.zip |
added offline indicator icon
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/icons/offline.png | bin | 0 -> 2707 bytes | |||
-rw-r--r-- | src/app/index.html | 3 | ||||
-rw-r--r-- | src/app/js/request.js | 5 | ||||
-rw-r--r-- | src/app/main.css | 8 |
4 files changed, 14 insertions, 2 deletions
diff --git a/src/app/icons/offline.png b/src/app/icons/offline.png Binary files differnew file mode 100644 index 0000000..a9d2f1f --- /dev/null +++ b/src/app/icons/offline.png diff --git a/src/app/index.html b/src/app/index.html index 98c59d4..f9d3d51 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -14,6 +14,9 @@ <div id="toasts"></div> <div id="winbtns"> + <div class="hidden" id="offline" tooltip="%%tooltip.offline%%" tooltip-position="horizontal"> + <img src="icons/offline.png"> + </div> <div id="settings" tooltip="%%tooltip.settings%%" tooltip-position="horizontal" onclick="settings.popup.toggle()"> <img src="icons/settings.png"> </div> diff --git a/src/app/js/request.js b/src/app/js/request.js index cc73f1b..b9b5081 100644 --- a/src/app/js/request.js +++ b/src/app/js/request.js @@ -1,9 +1,12 @@ const ipcRenderer = require("electron").ipcRenderer; let update_status = () => { - // show a toast message if no Internet connection has been detected. + // if offline, show toast and offline icon if (! navigator.onLine) { ipcRenderer.send("no-internet"); + offline.classList.remove("hidden"); + } else { // remove offline icon + offline.classList.add("hidden"); } } diff --git a/src/app/main.css b/src/app/main.css index 9ade423..b6b0ac7 100644 --- a/src/app/main.css +++ b/src/app/main.css @@ -59,8 +59,14 @@ button:active {filter: brightness(90%)} margin-right: calc(var(--padding) / 2); } +#winbtns div.hidden { + width: 0px; + opacity: 0.0; + margin-right: 0px; + pointer-events: none; +} + #winbtns div img { - width: 100%; height: 100%; transition: transform 0.25s ease-in-out; } |