From 6f8b14fb2d6e9ebd47bf618825f6649dd24dfa1b Mon Sep 17 00:00:00 2001
From: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
Date: Mon, 22 Sep 2025 04:42:46 -0700
Subject: [PATCH] chore(webui): stick from on top in acquire cards (#2802)
Also use `d-none` instead `style="display: none;"` in modular cards
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2802
Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com>
Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
---
 static/webui/index.html | 230 ++++++++++++++++++++++++----------------
 static/webui/script.js  |  47 ++++----
 2 files changed, 157 insertions(+), 120 deletions(-)
diff --git a/static/webui/index.html b/static/webui/index.html
index a9f44ce4..b3facf05 100644
--- a/static/webui/index.html
+++ b/static/webui/index.html
@@ -180,33 +180,37 @@
                     
                         
                     
                         
@@ -215,38 +219,42 @@
                     
                         
                     
                         
@@ -255,28 +263,32 @@
                     
                         
                     
                         
@@ -285,28 +297,32 @@
                     
                         
                     
                         
@@ -315,40 +331,44 @@
                     
                         
                     
                         
@@ -357,36 +377,40 @@
                     
                         
                     
                         
@@ -395,26 +419,28 @@
                     
                         
                     
                         
@@ -433,28 +461,32 @@
                     
                         
                     
                         
@@ -463,29 +495,33 @@
                     
                         
                     
                         
@@ -552,28 +588,32 @@
                     
                         
                     
                         
@@ -807,16 +847,18 @@
                 
                 
                     
-                        
+                        
diff --git a/static/webui/script.js b/static/webui/script.js
index 6990392f..bf971cf8 100644
--- a/static/webui/script.js
+++ b/static/webui/script.js
@@ -2220,18 +2220,13 @@ function doAcquireModularEquipment(category, WeaponType) {
                 if (mainInput) {
                     mainInput.value = "";
                     if (category === "MoaPets") {
-                        const modularFieldsMoa = document.getElementById("modular-MoaPets-Moa");
-                        const modularFieldsZanuka = document.getElementById("modular-MoaPets-Zanuka");
-                        modularFieldsZanuka.style.display = "none";
-                        modularFieldsMoa.style.display = "none";
+                        document.getElementById("modular-MoaPets-Zanuka").classList.add("d-none");
+                        document.getElementById("modular-MoaPets-Moa").classList.add("d-none");
                     } else if (category === "KubrowPets") {
-                        const modularFieldsCatbrow = document.getElementById("modular-KubrowPets-Catbrow");
-                        const modularFieldsKubrow = document.getElementById("modular-KubrowPets-Kubrow");
-                        modularFieldsCatbrow.style.display = "none";
-                        modularFieldsKubrow.style.display = "none";
+                        document.getElementById("modular-KubrowPets-Catbrow").classList.add("d-none");
+                        document.getElementById("modular-KubrowPets-Kubrow").classList.add("d-none");
                     } else {
-                        const modularFields = document.getElementById("modular-" + category);
-                        modularFields.style.display = "none";
+                        document.getElementById("modular-" + category).classList.add("d-none");
                     }
                 }
                 requiredParts.forEach(part => {
@@ -3512,35 +3507,35 @@ function handleModularSelection(category) {
             if (webUiModularWeapons.includes(key)) {
                 if (inventoryCategory === "MoaPets") {
                     if (key === "/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetPowerSuit") {
-                        modularFieldsMoa.style.display = "none";
-                        modularFieldsZanuka.style.display = "";
+                        modularFieldsMoa.classList.add("d-none");
+                        modularFieldsZanuka.classList.remove("d-none");
                     } else if (key === "/Lotus/Types/Friendly/Pets/MoaPets/MoaPetPowerSuit") {
-                        modularFieldsMoa.style.display = "";
-                        modularFieldsZanuka.style.display = "none";
+                        modularFieldsMoa.classList.remove("d-none");
+                        modularFieldsZanuka.classList.add("d-none");
                     }
                 } else if (inventoryCategory === "KubrowPets") {
                     if (key.endsWith("InfestedCatbrowPetPowerSuit")) {
-                        modularFieldsCatbrow.style.display = "";
-                        modularFieldsKubrow.style.display = "none";
+                        modularFieldsCatbrow.classList.remove("d-none");
+                        modularFieldsKubrow.classList.add("d-none");
                     } else if (key.endsWith("PredatorKubrowPetPowerSuit")) {
-                        modularFieldsCatbrow.style.display = "none";
-                        modularFieldsKubrow.style.display = "";
+                        modularFieldsCatbrow.classList.add("d-none");
+                        modularFieldsKubrow.classList.remove("d-none");
                     } else {
-                        modularFieldsCatbrow.style.display = "none";
-                        modularFieldsKubrow.style.display = "none";
+                        modularFieldsCatbrow.classList.add("d-none");
+                        modularFieldsKubrow.classList.add("d-none");
                     }
                 } else {
-                    modularFields.style.display = "";
+                    modularFields.classList.remove("d-none");
                 }
             } else {
                 if (inventoryCategory === "MoaPets") {
-                    modularFieldsZanuka.style.display = "none";
-                    modularFieldsMoa.style.display = "none";
+                    modularFieldsMoa.classList.add("d-none");
+                    modularFieldsZanuka.classList.add("d-none");
                 } else if (inventoryCategory === "KubrowPets") {
-                    modularFieldsCatbrow.style.display = "none";
-                    modularFieldsKubrow.style.display = "none";
+                    modularFieldsCatbrow.classList.add("d-none");
+                    modularFieldsKubrow.classList.add("d-none");
                 } else {
-                    modularFields.style.display = "none";
+                    modularFields.classList.add("d-none");
                 }
             }
         });