Re-Mcbbs

修改mcbbs界面-未完成

目前为 2017-08-14 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Re-Mcbbs
  3. // @namespace undefined
  4. // @version 0.2
  5. // @description 修改mcbbs界面-未完成
  6. // @author SettingDust
  7. // @include *mcbbs.net/*
  8. // @require https://code.jquery.com/jquery-latest.js
  9. // ==/UserScript==
  10.  
  11. $(function() {
  12. var css="";
  13. //修改标题
  14. document.title=" Minecraft(我的世界)中文论坛 - Mcbbs";
  15. $("[src='template/mcbbs/image/logo_sc.png']").attr("src","http://i.imgur.com/8WUBLPS.png");
  16.  
  17. //主体背景颜色
  18. css+=[
  19. "#hd .wp {",
  20. " background: none;",
  21. "}",
  22. "#ip_notice .bm{",
  23. " background: #C5A97A;",
  24. "}",
  25. "#ip_notice{",
  26. " background: none;",
  27. " bottom: -9px;",
  28. "}",
  29. ".plugin .bm_h {",
  30. " background: #D6BE96",
  31. "}"
  32. ].join("\n");
  33.  
  34. //修改底部
  35. $("[style*='width:100%;margin-top:-20px;']").css("background","rgba(0, 0, 0, 0.4) none repeat scroll 0 0");
  36.  
  37. //修改顶部
  38. css+=[
  39. "#toptb {",
  40. " background: none 0px 0px repeat scroll rgba(0, 0, 0, 0.4);",
  41. " line-height: 39px;",
  42. " height: auto;",
  43. "}",
  44. "#toptb .z a {",
  45. " height: 39px;",
  46. "}",
  47. "#toptb .z a:hover {",
  48. " background: rgba(255, 255, 255, 0.2) none repeat scroll 0 0;",
  49. " background-size: 100% 37px;",
  50. " color: #fff;",
  51. " text-decoration: none;",
  52. "}",
  53. "#um {",
  54. " margin-right: 82px;",
  55. "}",
  56. ".mc_map_wp {",
  57. " margin-top: -26px;",
  58. "}",
  59. ".z {",
  60. " margin-left: 100px;",
  61. "}"
  62. ].join("\n");
  63. $(".hdc.cl > h2").css("margin-top","-18px").css("margin-left","130px");
  64.  
  65. //边框修改
  66. css+=[
  67. ".mc_map_border_top {",
  68. " background: none;",
  69. " height: 0;",
  70. "}",
  71. ".mc_map_border_right {",
  72. " background: none",
  73. "}",
  74. ".mc_map_border_foot {",
  75. " height: 0;",
  76. " background: none",
  77. "}",
  78. ".mc_map_border_left {",
  79. " background: none",
  80. "}",
  81. "#scrolltop .scrolltopa {",
  82. " visibility: hidden;",
  83. "}"
  84. ].join("\n");
  85.  
  86. //导航栏修改
  87. $(".nv_ul").css("background","none");
  88. css+=["#nv .nv_ul li a {",
  89. " width: 80px;",
  90. " height: 57px;",
  91. " padding: 0;",
  92. " text-align: center;",
  93. " font-size: 14px;",
  94. " background: none !important;",
  95. " border: none",
  96. "}",
  97. "#nv .nv_ul li a:hover {",
  98. " background: none !important;",
  99. " color: #ffff58;",
  100. " text-decoration: underline;",
  101. "}",
  102. "#nv .nv_ul li {",
  103. " width: 60px;",
  104. " padding: 0;",
  105. " height: 57px;",
  106. " line-height: 56px;",
  107. " background: none;",
  108. "}",
  109. "#nv .nv_ul li:last-child a {",
  110. " border: none;",
  111. "}",
  112. "#nv .nv_ul li:first-child a:hover{",
  113. " border: none;",
  114. "}",
  115. "#nv li#mn_N7844.hover a {",
  116. " background: none !important;",
  117. " color: #ffff58 !important;",
  118. "}",
  119. "#hd .h_pop {",
  120. " border-top: 1px solid #b1a994;",
  121. "}",
  122. "#hd .p_pop a:hover {",
  123. " color: #C5A97A;",
  124. "}"
  125. ].join("\n");
  126. $("#nv_right").remove();
  127.  
  128. //修改搜索
  129. css+=[
  130. ".y_search {",
  131. " width: auto;",
  132. " margin-top:4px;",
  133. "}",
  134. ".y_search_inp {",
  135. " background: none;",
  136. "}"
  137. ].join("\n");
  138. $(".y_search_btn").remove();
  139.  
  140. //分情况处理
  141. var url=document.URL;
  142. if(url.endsWith("forum.php") || url.endsWith("portal.php")){
  143. //修改个人资料部分
  144. css+=[
  145. ".special_info {",
  146. " background: none !important;",
  147. "}",
  148. ".special_info_t {",
  149. " background: none !important;",
  150. "}",
  151. ".special_info_i {",
  152. " background: none !important;",
  153. "}",
  154. ].join("\n");
  155. $(".special_user_info").css("background-color","#C5A97A");
  156. var avatar=$(".special_photo > img").attr("src");
  157. if(avatar!==undefined){
  158. avatar=avatar.replace("big","middle");
  159. $(".special_photo").css("background","url("+avatar+") center no-repeat");
  160. $(".special_photo > img").remove();
  161. }
  162.  
  163. //微博修改
  164. css+=[
  165. "iframe {",
  166. " height: 415px;",
  167. " width: 264px;",
  168. "}"
  169. ].join("\n");
  170.  
  171. //背景修改
  172. css+=[
  173. "#wp {",
  174. " background: none;",
  175. "}",
  176. "#nv_forum #ct {",
  177. " background: none;",
  178. "}"
  179. ].join("\n");
  180.  
  181. if(url.endsWith("portal.php")){
  182. //背景修改
  183. css+=[
  184. "#wp .wp {",
  185. " background: none;",
  186. "}",
  187. ".portal_left_dev {",
  188. " background: #D6BE96",
  189. "}"
  190. ].join("\n");
  191. //修改侧边栏
  192. css+=[
  193. "#portal_index_right .block {",
  194. " background: #C5A97A",
  195. "}",
  196. "#portal_index_right .frame {",
  197. " background: none",
  198. "}",
  199. "#portal_index_right .portal_game {",
  200. " width: auto;",
  201. "}",
  202. "#portal_index_right .portal_game {",
  203. " padding: 0px 1px",
  204. "}"
  205. ].join("\n");
  206. $("#portal_block_737_content").attr("style","margin: 0 !important;");
  207.  
  208. //修改轮播
  209. css+=[
  210. ".ss3_wrapper .slideshow_paging li {",
  211. " background: none;",
  212. "}",
  213. ".ss3_wrapper .slideshow_paging a {",
  214. " width: 90px;",
  215. " height: 43px;",
  216. " overflow: hidden;",
  217. "}",
  218. ".ss3_wrapper .slideshow_paging .activeSlide {",
  219. " background-color: rgba(255,255,255,0.4);",
  220. "}",
  221. ".portal_wrapper4 .slideshow_paging li {",
  222. " height: auto;",
  223. "}",
  224. "#portal_left .portal_txt {",
  225. " margin: auto 8px;",
  226. "}",
  227. ".portal_wrapper .slideshow_paging a {",
  228. " width: 73px;",
  229. " height: 39px",
  230. "}",
  231. ".portal_wrapper .slideshow_paging li {",
  232. " background: none;",
  233. "}",
  234. ".portal_wrapper .slideshow_paging .activeSlide {",
  235. " background-color: rgba(255,255,255,0.6);",
  236. "}",
  237. "#slideshow_3 .slideshow_item .image a {",
  238. " height: 320px;",
  239. " width: 670px;",
  240. " overflow: hidden;",
  241. "}",
  242. ].join("\n");
  243. }
  244. if(url.endsWith("forum.php")){
  245. //修改侧边栏
  246. css+=[
  247. "#forum_index_right .frame {",
  248. " background: none;",
  249. "}",
  250. "#forum_index_right .block {",
  251. " background-color: #C5A97A !important;",
  252. "}"
  253. ].join("\n");
  254. $(".bm.bmw.cl").css("background","#D6BE96");
  255. }
  256. }
  257. $("<style></style>").text(css).appendTo($("head"));
  258. });