[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 03/04: fix: resolve a few live-reload styling bugs
From: |
gnunet |
Subject: |
[taler-wallet-core] 03/04: fix: resolve a few live-reload styling bugs |
Date: |
Tue, 20 Aug 2024 10:31:58 +0200 |
This is an automated email from the git hooks/post-receive script.
nora-grothoff pushed a commit to branch master
in repository wallet-core.
commit ca736ba051dfed15e1ccfab3da0162bc6c95b549
Author: Nullptrderef <nullptrderef@proton.me>
AuthorDate: Tue Aug 20 10:18:03 2024 +0200
fix: resolve a few live-reload styling bugs
---
packages/web-util/src/live-reload.ts | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/packages/web-util/src/live-reload.ts
b/packages/web-util/src/live-reload.ts
index cd3a7540d..c89d09383 100644
--- a/packages/web-util/src/live-reload.ts
+++ b/packages/web-util/src/live-reload.ts
@@ -1,10 +1,12 @@
/* eslint-disable no-undef */
function setupLiveReload(): void {
- const stopWs = localStorage.getItem("stop-ws")
+ const stopWs = localStorage.getItem("stop-ws");
if (!!stopWs) return;
const protocol = window.location.protocol === "http:" ? "ws:" : "wss:";
- const ws = new
WebSocket(`${protocol}//${window.location.hostname}:${window.location.port}/ws`);
+ const ws = new WebSocket(
+ `${protocol}//${window.location.hostname}:${window.location.port}/ws`,
+ );
ws.addEventListener("message", (message) => {
try {
@@ -60,18 +62,22 @@ setupLiveReload();
function showReloadOverlay(): void {
const d = document.createElement("div");
d.id = "overlay";
- d.style.position = "absolute";
- d.style.width = "100%";
- d.style.height = "100%";
+ d.style.position = "fixed";
+ d.style.left = "0px";
+ d.style.top = "0px";
+ d.style.width = "100vw";
+ d.style.height = "100vh";
+ d.style.display = "flex";
+ d.style.alignItems = "center";
+ d.style.justifyContent = "center";
+ d.style.fontFamily = `system-ui, -apple-system, BlinkMacSystemFont, Roboto,
Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif`;
d.style.color = "white";
d.style.backgroundColor = "rgba(0,0,0,0.5)";
- d.style.display = "flex";
d.style.zIndex = String(Number.MAX_SAFE_INTEGER);
- d.style.justifyContent = "center";
const h = document.createElement("h1");
h.id = "overlay-text";
h.style.margin = "auto";
- h.innerHTML = "reloading...";
+ h.innerHTML = "Reloading...";
d.appendChild(h);
if (document.body.firstChild) {
document.body.insertBefore(d, document.body.firstChild);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.