What's new

[GUIDE] Removing the bright white threads when using Dimension Dark.

Cordova

Donator
Joined
Nov 24, 2016
Messages
195
Hello! I am not sure if there is another proposed solution but I made a small script to change them to a more dark theme friendly colour. All you have to do is download Tampermonkey on your browser, create a new script and copy paste the script given below. If there are any bugs or a thread is not working let me know and I will look into it.

JavaScript:
// ==UserScript==
// @name         RCRP - Dark Mode Fix
// @version      1.0
// @description  Darkening light elements for easier viewing,
// @author       Vassilios
// @match        https://forum.redcountyrp.com/threads/*
// @grant        none
// ==/UserScript==

// Checks whether you are currently in Dark Mode.
function isDarkMode() { return document.getElementById("footer").children[0].children[0].children[0].children[0].children[0].children[0].innerText == " Dimension Dark RCRP" ; };

// Changes the current font colour, background colour and border of an element.
function changeColour(element) { element.style.color = "white"; element.style.backgroundColor = "#2c2f35"; if (element.tagName == "FIELDSET") { element.style.border = "1px solid white"; } };

// Iterates over an element and every child thereof then changes their colour.
function modifyTree(element) { for (let i=0; i<element.childElementCount; i++) { changeColour(element.children[i]); modifyTree(element.children[i]); } };

if (isDarkMode())
{
    // Obtaining all the articles.
    let articles = document.getElementsByClassName("bbWrapper");

    // Minus one because the last bbox is the reply box.
    for (let i=0; i<articles.length-1; i++)
    {
        // We only want to change the DIVs.
        if (articles[i].firstChild.tagName != "DIV") { continue; };

        // Add a border around the main element then modify the tree.
        let curArticle = articles[i].firstElementChild;
        curArticle.style.border = "medium solid white";
        changeColour(curArticle);

        modifyTree(curArticle);
    }
}
 

xRemixHDz

Member
Joined
Jul 7, 2016
Messages
52
god bless
i was actually looking for a solution to this. rcrp forums in dark mode is such a pain in the ass
 
Top