Created
April 18, 2023 02:58
-
-
Save wescopeland/03518db84128d092818768904655b7d7 to your computer and use it in GitHub Desktop.
Working LockedColored if badge hover colorization is merged
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name RA_LockedColored | |
// @version 0.1 | |
// @author Xymjak | |
// @match http://localhost:64000/game/* | |
// @match http://localhost:64000/achievement/* | |
// @match https://retroachievements.org/game/* | |
// @match https://retroachievements.org/achievement/* | |
// @icon https://www.google.com/s2/favicons?domain=retroachievements.org | |
// @grant none | |
// ==/UserScript== | |
const LockedColored = function() { | |
const LOCK_TEXT_LENGTH = 9; | |
const ProcessImage = function(badge) { | |
badge.classList.remove("grayscale", "blur-[0.8px]", "contrast-[0.65]"); | |
} | |
const GamePage = function() { | |
const badges = document.getElementsByClassName("achievementlist")[0].getElementsByClassName("badgeimg"); | |
for(let i = 0; i < badges.length; i++) ProcessImage(badges[i]); | |
} | |
const AchPage = function() { | |
ProcessImage(document.getElementById("achievemententryicon").getElementsByTagName("img")[0]) | |
} | |
const page = window.location.pathname.split('/')[1]; | |
const PagesFunc = { "achievement": AchPage , "game": GamePage}; | |
const Func = PagesFunc[page]; | |
Func(); | |
} | |
LockedColored(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment