WNP78

SP tweaks

Sep 17th, 2019
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         simpleplanes.com tweaks
  3. // @version      0.2
  4. // @include http://simpleplanes.com/*
  5. // @include https://simpleplanes.com/*
  6. // @include http://www.simpleplanes.com/*
  7. // @include https://www.simpleplanes.com/*
  8. // @author       WNP78
  9. // ==/UserScript==
  10.  
  11. var style = `
  12.  
  13.  
  14. /* Aircraft Post Pop-out */
  15.  
  16. .post-block { transition: all .2s cubic-bezier(.68,-0.55,.27,1.55); }
  17. .post-block:hover { transform: scale(1.1,1.1); }
  18. /* Basic dark theme */
  19.  
  20. body {
  21.     background: linear-gradient( rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8) ), url('/Content/img/patterns/gray_jean.png') !important;
  22.     color: #dedede;
  23. }
  24. .body {
  25.     background: #272727 !important;
  26.     border-top-color: #272727 !important;
  27. }
  28. .body header {
  29.     background: #272727 !important;
  30. }
  31. a { color: #079ae4; }
  32. h1, h2, h3, h4, h5, h6 {
  33.     color: #cfcfcf !important;
  34. }
  35. h3, h4, h5 {
  36.     color: #20b3fc !important;
  37. }
  38. p { color: #dedede; }
  39. code, pre {
  40.     background-color: #2d2d2d;
  41.     color: white;
  42.     border-color: #4a4a4a;
  43.     margin: 7px 0px;
  44. }
  45.  
  46. /* Controls */
  47. .btn-default {
  48.     color: white;
  49.     background: #777;
  50.     border-color: #777;
  51. }
  52. .btn-default:hover, .btn-default:focus, .btn-default:active {
  53.     color: white !important;
  54.     background: #666 !important;
  55.     border-color: #666 !important;
  56. }
  57. .pagination > li > a, .pagination > li > span, .pagination > li > a:hover, .pagination > li > span:hover {
  58.     background: #232323;
  59.     border-color: #232323;
  60. }
  61. .dropdown-menu {
  62.     background: #4d4d4d;
  63.     border-color: #4d4d4d;
  64.     color: white !important;
  65. }
  66. .dropdown-menu > li > a {
  67.     background: #4d4d4d !important;
  68.     border-color: #4d4d4d !important;
  69.     color: white !important;
  70. }
  71. .dropdown-menu > li > a:hover {
  72.     background: #555 !important;
  73.     border-color: #555 !important;
  74.     color: white !important;
  75. }
  76. .modal-content { background-color: #333131 !important; }
  77. .label-success {
  78.     background: #1e9c1e;
  79. }
  80. .label-default {
  81.     background: #666;
  82. }
  83. .form-control[disabled], .form-control[readonly], fieldset[disabled] {
  84.     background-color: #333 !important;
  85.     color: #AAA;
  86. }
  87. .form-control {
  88.     background-color: #666;
  89.     border-color: #222;
  90.     color: #FFF;
  91. }
  92. .tag-item {
  93.     background: #484848 !important;
  94. }
  95. .tag-item:hover {
  96.     background: #686868 !important;
  97. }
  98.  
  99. /* SP specific */
  100. body.boxed .body {
  101.   border-bottom: 5px solid #0c0c0c !important;
  102. }
  103. .product-thumb-info {
  104.     background: #1a1a1a !important;
  105.     border-color: #1a1a1a !important;
  106. }
  107. .product-thumb-info.unread {
  108.     background-color: #00334d !important;
  109. }
  110. .product-thumb-info h4 {
  111.     color: white;
  112. }
  113. .forum-list-votes {
  114.     background: #474747;
  115.     color: #ffaa3e;
  116. }
  117. .notification {
  118.     background: #4d4d4d;
  119.     border-color: transparent !important;
  120. }
  121. .notification p {
  122.     color: white;
  123. }
  124. .notification:hover {
  125.     background: #7d7d7d;
  126. }
  127. .post-body {
  128.     background: #4d4d4d;
  129.     border-color: #4d4d4d;
  130. }
  131. ul.comments .comment-block {
  132.     background: #3c3c3c;
  133. }
  134. .downloads {
  135.     color: #c8c8c8;
  136. }
  137. .user-detail {
  138.     background: #444;
  139. }
  140. ul.comments .comment-arrow {
  141.     border-right-color: #3c3c3c;
  142. }
  143. .img-thumbnail {
  144.     background: #3f3f3f;
  145.     border-color: transparent;
  146. }
  147. #header nav ul.nav-main ul.dropdown-menu > li > a { border:none; }
  148. .shop table.cart td {
  149.     border-top: 4px solid #2d2d2d;
  150.     padding: 6px 10px;
  151. }
  152. .page-top {
  153.     border-bottom: 5px solid #666
  154. }
  155. a.mention-link {
  156.     background-color: #212121;
  157.     color: white;
  158.     border-radius: 5px;
  159.     padding-left: 3px;
  160.     padding-right: 3px;
  161.     padding-top: 2px;
  162.     padding-bottom: 2px;
  163. }
  164. .post-body img {
  165.     max-width: 100%;
  166. }
  167. .col-md-6 img {
  168.     max-width: 100%;
  169. }
  170. .featured-box {
  171.     background: #444;
  172.     border-color: #555;
  173.     color: #DDD;
  174. }
  175. #new .row {
  176.     background-color: #272727 !important;
  177. }
  178.  
  179. /* Tables */
  180. .table-striped > tbody > tr:nth-child(2n+1) > td, .table-striped > tbody > tr:nth-child(2n+1) > th {
  181.     background: #363636;
  182. }
  183. .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
  184.     border-top: none;
  185. }
  186.  
  187. /* Custom Point Tags */
  188. .user-points.dev { transition: all .5s linear; }
  189. .user-points.mod { background: linear-gradient(#d2322d, #8f0000) #d2322d; }
  190. .user-points.master { background: linear-gradient(#323030,#181818) #333; border-radius: .25em; }
  191. .user-points.gold { background: linear-gradient(#ecbf4f, #bf8800) #e4b84b; }
  192. .user-points.silver { background: linear-gradient(#8f8f8f, #545454) #797979; }
  193. .user-points.bronze { background: linear-gradient(#786113, #59480f) #786113; }
  194. .user-points.noob { border: none; background: linear-gradient(white, #d2d2d2) white; }
  195.  
  196. `;
  197. // Apply CSS
  198. var css = document.createElement("style");
  199. css.type = "text/css";
  200. css.innerHTML = style;
  201. document.body.appendChild(css);
  202. // Add mention links
  203. Array.prototype.forEach.call(document.getElementsByClassName("comment-block"), function (e) { Array.prototype.forEach.call(e.getElementsByTagName("p"), function(s) { s.innerHTML = s.innerHTML.replace(/@([A-z0-9]+)/g, "<a class=\"mention-link\" href=\"/u/$1\">$&</a>"); }); });
  204. Array.prototype.forEach.call(document.getElementsByClassName("post-body"), function (e) { Array.prototype.forEach.call(e.getElementsByTagName("p"), function(s) { s.innerHTML = s.innerHTML.replace(/@([A-z0-9]+)/g, "<a class=\"mention-link\" href=\"/u/$1\">$&</a>"); }); });
  205.  
  206. // Fix aircraft descriptions
  207. var r = document.getElementsByClassName("morecontent");
  208. if (r.length == 1) {
  209.     var sp = r[0].getElementsByTagName("span")[0];
  210.     sp.innerHTML = sp.innerHTML.substr(1);
  211.     var m = document.getElementsByClassName("more")[0];
  212.     m.childNodes[m.childNodes.length - 2].textContent = "";
  213. }
  214.  
  215. // Re-add the mods button
  216. var main = document.getElementById("mainMenu");
  217. var li = document.createElement("li");
  218. var a = document.createElement("a");
  219. a.href = "/Mods";
  220. a.innerText = "Mods";
  221. li.appendChild(a);
  222. main.children[3].insertAdjacentElement("afterend", li);
Advertisement
Add Comment
Please, Sign In to add comment