Nerarchy site redesign

Tries to make the site a bit easier to handle by reducing the overload of the right side bar.

  1. // ==UserScript==
  2. // @name Nerarchy site redesign
  3. // @namespace http://idrinth.de/
  4. // @version 1.1.2
  5. // @description Tries to make the site a bit easier to handle by reducing the overload of the right side bar.
  6. // @author Björn "Idrinth" Büttner
  7. // @match https://nerdarchy.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function(list) {
  12. 'use strict';
  13. var styles=document.createElement('style');
  14. styles.setAttribute('type','text/css');
  15. for(var pos in list) {
  16. styles.appendChild(document.createTextNode(
  17. list[pos].elements.join(',')+"{"+list[pos].rules.join(';')+"}"
  18. ));
  19. }
  20. document.getElementsByTagName('head')[0].appendChild(styles);
  21. document.getElementsByTagName('body')[0].appendChild(document.getElementById('categories-3'));
  22. document.getElementsByClassName('title-area')[0].parentNode.insertBefore(document.getElementById('social_stickers_widget-3'),document.getElementsByClassName('title-area')[0].parentNode.firstChild);
  23. document.getElementsByClassName('title-area')[0].parentNode.appendChild(document.getElementById('search-4'));
  24. var l = document.querySelectorAll("#WFItem10830201 *");
  25. for(var c=0;c<l.length;c++) {
  26. if(l[c].hasAttribute('style')) {
  27. l[c].removeAttribute('style','');
  28. }
  29. }
  30. var header=document.createElement('h3');
  31. var mailerList = document.getElementById('WFIcenter').children[0].children[1].children[0].children[0];
  32. header.appendChild(document.createTextNode(mailerList.children[0].innerText));
  33. document.getElementById('WFIheader').appendChild(header);
  34. mailerList.removeChild(mailerList.children[0]);
  35. var l2 = mailerList.children;
  36. var ul = document.createElement('ul');
  37. for(var c1=0;c1<l2.length;c1++) {
  38. ul.appendChild(document.createElement('li'));
  39. ul.lastChild.appendChild(document.createTextNode((l2[c1].textContent).replace(/^\s*\*\s*/,'')));
  40. }
  41. mailerList.parentNode.insertBefore(ul,mailerList);
  42. mailerList.parentNode.removeChild(mailerList);
  43. })(
  44. [
  45. {
  46. elements: ['body'],
  47. rules: ['font-size:13px','line-height: 1.5;']
  48. },
  49. {
  50. elements: ['#WFItem10830201 #WFIheader *'],
  51. rules: ['display:none !important']
  52. },
  53. {
  54. elements: ['h1','.entry-title'],
  55. rules: ['font-size:2em']
  56. },
  57. {
  58. elements: ['h2'],
  59. rules: ['font-size:1.75em']
  60. },
  61. {
  62. elements: ['h3','#WFItem10830201 #WFIheader h3'],
  63. rules: ['font-size:1.55em !important','display:block !important']
  64. },
  65. {
  66. elements: ['h4'],
  67. rules: ['font-size:1.4em']
  68. },
  69. {
  70. elements: ['h5'],
  71. rules: ['font-size:1.3em']
  72. },
  73. {
  74. elements: ['.site-container'],
  75. rules: ['padding:12px','box-shadow: 5px 5px 15px #aaa']
  76. },
  77. {
  78. elements: ['.nav-primary'],
  79. rules: ['margin:0 -12px']
  80. },
  81. {
  82. elements: ['#social_stickers_widget-3'],
  83. rules: ['margin:0','overflow:hidden','float:right']
  84. },
  85. {
  86. elements: ['#categories-3'],
  87. rules: ['box-shadow: 3px 0 6px #000;','margin-bottom:0','direction: rtl','padding-right:2px','transition: margin-left 2s','overflow-y: scroll','overflow-x:hidden','position: fixed','left: 0','top: 0','background: #fff','height: 100%','margin-left: -275px','width: 300px','box-sizing: border-box','transition-delay:2.5s']
  88. },
  89. {
  90. elements: ['#categories-3:hover'],
  91. rules: ['margin-left:0','transition-delay:0s']
  92. },
  93. {
  94. elements: ['#categories-3 > *'],
  95. rules: ['direction: ltr']
  96. },
  97. {
  98. elements: ['#categories-3 li'],
  99. rules: ['margin-bottom:0','margin-left:1.5em','margin-right:1.5em','padding:2px','list-style:none']
  100. },
  101. {
  102. elements: ['#categories-3 li a'],
  103. rules: ['background:#f96e5b','color:#fff','border-radius:3px','display:block','text-align:center','text-decoration:none']
  104. },
  105. {
  106. elements: ['#categories-3 .widget-title'],
  107. rules: ['margin:0','padding: 0.5em']
  108. },
  109. {
  110. elements: ['.footer-widgets'],
  111. rules: ['display:none']
  112. },
  113. {
  114. elements: ['#search-4'],
  115. rules: ['margin: 0','float: left','overflow: hidden']
  116. },
  117. {
  118. elements: ['#search-4 form'],
  119. rules: ['width:100%','margin:0']
  120. },
  121. {
  122. elements: ['#WFItem10830201 #WFIfooter'],
  123. rules: ['display:none !important']
  124. },
  125. {
  126. elements: ['#WFItem10830201 *','#WFItem10830201'],
  127. rules: ['max-width:100% !important']
  128. },
  129. {
  130. elements: ['#WFItem10830201 #WFIcenter .wf-labelpos'],
  131. rules: ['width:33% !important','float:left !important',]
  132. },
  133. {
  134. elements: ['#WFItem10830201 #WFIcenter .wf-inputpos'],
  135. rules: ['width:66% !important','float:right !important',]
  136. },
  137. {
  138. elements: ['#WFItem10830201 .wf-body li.wf-submit'],
  139. rules: ['width:66% !important','float:right !important','box-sizing:border-box !important','margin:0 !important','clear:none !important']
  140. },
  141. {
  142. elements: ['#WFItem10830201 .wf-body li.wf-counter'],
  143. rules: ['width:33% !important','float:left !important','box-sizing:border-box !important','margin:0 !important','clear:none !important']
  144. },
  145. {
  146. elements: ['#WFItem10830201 #WFIcenter.wf-body li'],
  147. rules: ['padding: 5px !important']
  148. },
  149. {
  150. elements: ['#WFItem10830201 .wf-body li.wf-text__0 p'],
  151. rules: ['color: #222 !important']
  152. },
  153. {
  154. elements: ['#WFItem10830201 #WFIcenter .wf-image__0','#WFItem10830201 #WFIcenter .wf-image__1'],
  155. rules: ['display:none !important']
  156. },
  157. {
  158. elements: ['.widget-area.header-widget-area .widget'],
  159. rules: ['margin-bottom: 0']
  160. },
  161. {
  162. elements: ['#WFItem10830201 .wf-contbox ul li'],
  163. rules: ['list-style: circle !important','margin-left: 1em !important']
  164. }
  165. ]
  166. );