Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name CheatHappens Dark Mode
- // @version 1.0.0
- // @description CheatHappens Dark Mode
- // @author 0x90
- // @include https://*.cheathappens.com/*
- // @run-at document-end
- // @inject-into content
- // @grant none
- // ==/UserScript==
- function addGlobalStyle(css) {
- var head, style;
- head = document.getElementsByTagName('head')[0];
- if (!head) { return; }
- style = document.createElement('style');
- style.type = 'text/css';
- style.innerHTML = css;
- head.appendChild(style);
- }
- //Others
- addGlobalStyle('body { color: #B7B9C4 !important; background-color: #202020 !important; }');
- addGlobalStyle('a { color: #B7B9C4; }');
- addGlobalStyle('.col { color: #B7B9C4; } ');
- addGlobalStyle('.btn { color: black; } ');
- addGlobalStyle('.badge-tmcompat { color: black; } ');
- addGlobalStyle('.fa-square { color: #202020 !important; }');
- addGlobalStyle('.scndtrn { background-color: #303134 !important; }');
- addGlobalStyle('.alert-primary { background-color: #303134 !important; }');
- addGlobalStyle('.list-group-item { background-color: #303134 !important; }');
- //Message board
- var posts = document.getElementsByClassName('list-group-item clearfix')
- for (var i = 0; i < posts.length; i++) {
- posts[i].setAttribute("style", "background: linear-gradient(to right, #242424 105px, #303134 0px)!important;");
- }
- var replies = document.getElementsByTagName('div')
- for (var i = 0; i < replies.length; i++) {
- //Message board - replies
- if (replies[i].getAttribute("style") == "background-color: #f6f6f6;") {
- replies[i].setAttribute("style","background-color: #4b516b;");
- }
- //Trainer page - option description
- if (replies[i].getAttribute("style") == "background-color: #e1e1e1; border-top: solid 1px #c4c4c4;") {
- replies[i].setAttribute("style","background-color: #4b516b; border-top: solid 1px #c4c4c4;");
- }
- //Trainer page - trainer options
- if (replies[i].getAttribute("style") == "padding: 5px; background-color: lightgray; font-size: 12px;") {
- replies[i].setAttribute("style","padding: 5px; background-color: #303134; font-size: 12px;");
- }
- //Trainer page - trainer options
- if (replies[i].style.backgroundColor === "rgb(157, 164, 176)") { //#9da4b0
- replies[i].style.color = "black";
- }
- }
- //Profile panel
- var pPanel = document.getElementsByClassName('row rounded-bottom m-0 p-0 align-items-center')[0];
- pPanel.setAttribute("style", "height: 40px; background-color: #4b516b; color: black; !important");
- var children = pPanel.querySelectorAll('a,div');
- for (var i = 0; i < children.length; i++) {
- children[i].style["color"] = "black";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement