Replaces ranks with colored tiers!
// ==UserScript==
// @name Lichess - Tier System
// @namespace http://tampermonkey.net/
// @version 1
// @description Replaces ranks with colored tiers!
// @author SaberSpeed77
// @match https://lichess.org/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=lichess.org
// @grant none
// @license MIT
// ==/UserScript==
var observer = new MutationObserver((mutations) => {
var ratings = document.querySelectorAll("rating, .rating");
ratings.forEach(r => {
var text = parseInt(r.textContent);
r.style.fontSize = "1px";
r.style.width = "20px";
r.style.height = "10px";
if (text < 800) {
r.style.color = "#998671";
r.style.backgroundColor = "#998671";
} else if (text <= 1100) {
r.style.color = "#828181";
r.style.backgroundColor = "#828181";
} else if (text <= 1300) {
r.style.color = "#bdbb53";
r.style.backgroundColor = "#bdbb53";
} else if (text <= 1600) {
r.style.color = "#538bbd";
r.style.backgroundColor = "#538bbd";
} else if (text <= 2000) {
r.style.color = "#5ed168";
r.style.backgroundColor = "#5ed168";
} else if (text <= 2300) {
r.style.color = "#b85dc2";
r.style.backgroundColor = "#b85dc2";
} else if (text > 2300) {
r.style.color = "#d15e64";
r.style.backgroundColor = "#d15e64";
}
})
});
observer.observe(document, {
childList: true,
subtree: true
});