Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.65 KB | None | 0 0
  1. // ==UserScript==
  2. // @name        CheatHappens Dark Mode
  3. // @version     1.0.0
  4. // @description CheatHappens Dark Mode
  5. // @author      0x90
  6. // @include     https://*.cheathappens.com/*
  7. // @run-at      document-end
  8. // @inject-into content
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12.  
  13. function addGlobalStyle(css) {
  14.     var head, style;
  15.     head = document.getElementsByTagName('head')[0];
  16.     if (!head) { return; }
  17.     style = document.createElement('style');
  18.     style.type = 'text/css';
  19.     style.innerHTML = css;
  20.     head.appendChild(style);
  21.  
  22. }
  23. //Others
  24. addGlobalStyle('body { color: #B7B9C4 !important; background-color: #202020 !important; }');
  25. addGlobalStyle('a { color: #B7B9C4; }');
  26. addGlobalStyle('.col  { color: #B7B9C4; } ');
  27. addGlobalStyle('.btn  { color: black; } ');
  28. addGlobalStyle('.badge-tmcompat  { color: black; } ');
  29.  
  30. addGlobalStyle('.fa-square { color: #202020 !important; }');
  31. addGlobalStyle('.scndtrn { background-color: #303134 !important; }');
  32. addGlobalStyle('.alert-primary { background-color: #303134 !important; }');
  33.  
  34. addGlobalStyle('.list-group-item { background-color: #303134 !important; }');
  35.  
  36.  
  37. //Message board
  38. var posts = document.getElementsByClassName('list-group-item clearfix')
  39. for (var i = 0; i < posts.length; i++) {    
  40.   posts[i].setAttribute("style", "background: linear-gradient(to right, #242424 105px, #303134 0px)!important;");
  41. }
  42.  
  43. var replies = document.getElementsByTagName('div')
  44. for (var i = 0; i < replies.length; i++) {
  45.  
  46.   //Message board - replies
  47.   if (replies[i].getAttribute("style") == "background-color: #f6f6f6;") {    
  48.      replies[i].setAttribute("style","background-color: #4b516b;");
  49.   }
  50.   //Trainer page - option description
  51.   if (replies[i].getAttribute("style") == "background-color: #e1e1e1; border-top: solid 1px #c4c4c4;") {    
  52.      replies[i].setAttribute("style","background-color: #4b516b; border-top: solid 1px #c4c4c4;");
  53.   }
  54.   //Trainer page - trainer options
  55.   if (replies[i].getAttribute("style") == "padding: 5px; background-color: lightgray; font-size: 12px;") {    
  56.      replies[i].setAttribute("style","padding: 5px; background-color: #303134; font-size: 12px;");
  57.   }
  58.   //Trainer page - trainer options
  59.   if (replies[i].style.backgroundColor === "rgb(157, 164, 176)") { //#9da4b0    
  60.      replies[i].style.color = "black";
  61.   }
  62. }
  63.  
  64. //Profile panel
  65. var pPanel = document.getElementsByClassName('row rounded-bottom m-0 p-0 align-items-center')[0];
  66. pPanel.setAttribute("style", "height: 40px; background-color: #4b516b; color: black; !important");
  67. var children = pPanel.querySelectorAll('a,div');
  68. for (var i = 0; i < children.length; i++) {  
  69.      children[i].style["color"] = "black";
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement