Versions Check added and Position arguments added.

This commit is contained in:
2026-02-15 19:37:39 +01:00
parent 596d70e72f
commit a99607dd0a
6 changed files with 183 additions and 10 deletions

View File

@@ -42,6 +42,61 @@ window.onload = (event) => {
Container.style.display = data ? "flex" : "none";
}
if (action == "setPosition") {
console.log("setPosition received:", data);
const IconsContainer = document.getElementById("IconsContainer");
let vPosition = data;
let hPosition = "center";
if (typeof data === "object" && data !== null) {
vPosition = data.v || "bottom";
hPosition = data.h || "center";
}
IconsContainer.style.marginTop = "";
IconsContainer.style.marginBottom = "";
IconsContainer.style.top = "";
IconsContainer.style.bottom = "";
IconsContainer.style.left = "";
IconsContainer.style.right = "";
IconsContainer.style.transform = "";
switch (vPosition) {
case "top":
IconsContainer.style.top = "20px";
IconsContainer.style.bottom = "auto";
break;
case "middle":
IconsContainer.style.top = "50%";
break;
case "bottom":
default:
IconsContainer.style.top = "auto";
IconsContainer.style.bottom = "20px";
break;
}
switch (hPosition) {
case "left":
IconsContainer.style.left = "220px";
IconsContainer.style.right = "auto";
IconsContainer.style.transform = vPosition === "middle" ? "translate(0, -50%)" : "";
break;
case "right":
IconsContainer.style.left = "auto";
IconsContainer.style.right = "60px";
IconsContainer.style.transform = vPosition === "middle" ? "translate(0, -50%)" : "";
break;
case "center":
default:
IconsContainer.style.left = "50%";
IconsContainer.style.right = "auto";
IconsContainer.style.transform = vPosition === "middle" ? "translate(-50%, -50%)" : "translateX(-50%)";
break;
}
}
if (action == "setLogo") {
Logo.style.display = "block";
}

View File

@@ -13,10 +13,17 @@ img {
margin: 0;
display: none;
flex-direction: column;
position: absolute;
bottom: 0;
left: 0;
}
#IconsContainer {
margin-top: auto;
margin-bottom: 20px;
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
}
#Icons {