fix joindate styling
This commit is contained in:
parent
4f5aeedeb3
commit
7483a6c357
@ -40,8 +40,10 @@ window.CSS_CLASSES = {
|
|||||||
settingsRegion: "sidebarRegion-1VBisG",
|
settingsRegion: "sidebarRegion-1VBisG",
|
||||||
contentRegion: "contentRegion-3HkfJJ",
|
contentRegion: "contentRegion-3HkfJJ",
|
||||||
settingsSidebar: "standardSidebarView-E9Pc3j",
|
settingsSidebar: "standardSidebarView-E9Pc3j",
|
||||||
profileHeader: "defaultColor-24IHKz eyebrow-Ejf06y defaultColor-HXu-5n userInfoSectionHeader-2mYYun",
|
userInfoTitle: "eyebrow-Ejf06y defaultColor-HXu-5n userInfoTitle-39qq0Y",
|
||||||
profileText: "userInfoText-2MFCmH markup-eYLPri clamped-2ZePhX",
|
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",
|
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",
|
miniTitle: "colorStandard-1Xxp1s size14-k_3Hy4 h5-2RwDNl title-3hptVQ title-1HgbhV",
|
||||||
hidden: "hidden-27eifz",
|
hidden: "hidden-27eifz",
|
||||||
|
|||||||
@ -48,29 +48,35 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this is a shitty patch
|
// 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() {
|
function addJoinDates() {
|
||||||
if (document.getElementById("join-date")) return;
|
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]");
|
const nitroBadge = document.querySelector(".clickable-1knRMS[aria-label]");
|
||||||
if (!noteTextArea || !nitroBadge) return;
|
if (!nitroBadge) return;
|
||||||
|
|
||||||
const nitroText = nitroBadge.getAttribute("aria-label");
|
const nitroText = nitroBadge.getAttribute("aria-label");
|
||||||
if (!nitroText) return;
|
if (!nitroText) return;
|
||||||
|
|
||||||
const div1 = document.createElement("div");
|
const infoText = document.createElement("div");
|
||||||
div1.id = "join-date";
|
infoText.id = "join-date";
|
||||||
div1.className = CSS_CLASSES.profileHeader;
|
infoText.className = infoSection ? CSS_CLASSES.userInfoSectionHeader : CSS_CLASSES.userInfoTitle;
|
||||||
div1.textContent = "Account since";
|
infoText.textContent = "Member since";
|
||||||
|
infoText.style.color = "var(--header-secondary)";
|
||||||
|
infoText.style.marginTop = "10px";
|
||||||
|
|
||||||
const div2 = document.createElement("div");
|
const dateText = document.createElement("div");
|
||||||
div2.id = "join-date";
|
dateText.id = "join-date";
|
||||||
div2.className = CSS_CLASSES.profileText;
|
dateText.className = infoSection ? CSS_CLASSES.userInfoText : CSS_CLASSES.userInfoBody;
|
||||||
div2.textContent = nitroText.replace("Subscriber since ", "");
|
dateText.textContent = nitroText.replace("Subscriber since ", "");
|
||||||
|
|
||||||
noteTextArea.insertAdjacentElement("beforebegin", div1);
|
infoSection && infoSection.insertAdjacentElement("beforebegin", infoText);
|
||||||
div1.insertAdjacentElement("afterend", div2);
|
firstBody && firstBody.insertAdjacentElement("afterend", infoText);
|
||||||
|
infoText.insertAdjacentElement("afterend", dateText);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addSwitches(container) {
|
async function addSwitches(container) {
|
||||||
|
|||||||
Reference in New Issue
Block a user