diff --git a/assets/public/custom/utils.js b/assets/public/custom/utils.js index 266aeb9b..211cb036 100644 --- a/assets/public/custom/utils.js +++ b/assets/public/custom/utils.js @@ -40,8 +40,10 @@ window.CSS_CLASSES = { settingsRegion: "sidebarRegion-1VBisG", contentRegion: "contentRegion-3HkfJJ", settingsSidebar: "standardSidebarView-E9Pc3j", - profileHeader: "defaultColor-24IHKz eyebrow-Ejf06y defaultColor-HXu-5n userInfoSectionHeader-2mYYun", - profileText: "userInfoText-2MFCmH markup-eYLPri clamped-2ZePhX", + userInfoTitle: "eyebrow-Ejf06y defaultColor-HXu-5n userInfoTitle-39qq0Y", + userInfoBody: "userInfoBody-1zgAd0 markup-eYLPri clamped-2ZePhX", + userInfoSectionHeader: "defaultColor-24IHKz eyebrow-Ejf06y defaultColor-HXu-5n userInfoSectionHeader-2mYYun", + userInfoText: "userInfoText-2MFCmH markup-eYLPri clamped-2ZePhX", title: "colorStandard-1Xxp1s size14-k_3Hy4 h1-34Txb0 title-3hptVQ defaultColor-2cKwKo defaultMarginh1-EURXsm", miniTitle: "colorStandard-1Xxp1s size14-k_3Hy4 h5-2RwDNl title-3hptVQ title-1HgbhV", hidden: "hidden-27eifz", diff --git a/assets/public/custom/web/main.js b/assets/public/custom/web/main.js index e490c67a..87ceb7ab 100644 --- a/assets/public/custom/web/main.js +++ b/assets/public/custom/web/main.js @@ -48,29 +48,35 @@ } // this is a shitty patch - // you can just grab this shit from the req but i do not care + // you can just grab this from the request but i do not care function addJoinDates() { if (document.getElementById("join-date")) return; - const noteTextArea = document.querySelector(".userInfoSection-2u2hir > :has(+ .note-3M15gE)") ?? document.querySelector(".bodyInnerWrapper-2bQs1k > h3"); + const infoSection = document.querySelector(".userInfoSection-2u2hir > :has(+ .note-3M15gE)") + const firstBody = document.querySelector(".userInfoSection-3her-v > div"); + if (!infoSection && !firstBody) return; + const nitroBadge = document.querySelector(".clickable-1knRMS[aria-label]"); - if (!noteTextArea || !nitroBadge) return; + if (!nitroBadge) return; const nitroText = nitroBadge.getAttribute("aria-label"); if (!nitroText) return; - const div1 = document.createElement("div"); - div1.id = "join-date"; - div1.className = CSS_CLASSES.profileHeader; - div1.textContent = "Account since"; + const infoText = document.createElement("div"); + infoText.id = "join-date"; + infoText.className = infoSection ? CSS_CLASSES.userInfoSectionHeader : CSS_CLASSES.userInfoTitle; + infoText.textContent = "Member since"; + infoText.style.color = "var(--header-secondary)"; + infoText.style.marginTop = "10px"; - const div2 = document.createElement("div"); - div2.id = "join-date"; - div2.className = CSS_CLASSES.profileText; - div2.textContent = nitroText.replace("Subscriber since ", ""); + const dateText = document.createElement("div"); + dateText.id = "join-date"; + dateText.className = infoSection ? CSS_CLASSES.userInfoText : CSS_CLASSES.userInfoBody; + dateText.textContent = nitroText.replace("Subscriber since ", ""); - noteTextArea.insertAdjacentElement("beforebegin", div1); - div1.insertAdjacentElement("afterend", div2); + infoSection && infoSection.insertAdjacentElement("beforebegin", infoText); + firstBody && firstBody.insertAdjacentElement("afterend", infoText); + infoText.insertAdjacentElement("afterend", dateText); } async function addSwitches(container) {