fix joindate styling
This commit is contained in:
parent
4f5aeedeb3
commit
7483a6c357
@ -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",
|
||||
|
||||
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user