吾爱破解美化 - 暗黑模式 精简元素 优化体验

更改颜色、隐藏冗杂的元素、加入暗黑模式、享受更好的浏览体验。

  1. // ==UserScript==
  2. // @name 吾爱破解美化 - 暗黑模式 精简元素 优化体验
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-08-25
  5. // @description 更改颜色、隐藏冗杂的元素、加入暗黑模式、享受更好的浏览体验。
  6. // @author Beiqh
  7. // @match https://www.52pojie.cn/*
  8. // @icon https://avatar.52pojie.cn/images/noavatar_small.gif
  9. // @grant GM_getResourceText
  10. // @grant GM_registerMenuCommand
  11. // @grant GM_unregisterMenuCommand
  12. // @grant GM_setValue
  13. // @grant GM_getValue
  14. // @grant GM_addStyle
  15. // @grant GM_getResourceText
  16. // @license GNU GPLv3
  17. // ==/UserScript==
  18.  
  19. (function() {
  20. var default_colors = [
  21. 'black',//默认前景色
  22. '#f8f9fa',//全页面背景色
  23. 'white',//一般元素背景色
  24. '#cfe2ff',//分区表头背景色
  25. '#0d6efd',// 顶部菜单颜色
  26. '#cfe2ff',//发帖用户栏背景色
  27. '#6ea8fe',//辅助类颜色1
  28. '#6ea8fe',//辅助类颜色2
  29. '#dc3545',//红色
  30. '#198754',//绿色
  31. '#0d6efd',//蓝色
  32. ]
  33. var dark_colors = [
  34. '#C9C9CF',
  35. '#2c2e2f',
  36. '#343a40',
  37. '#2c2e2f',//分区表头背景色
  38. '#212529',// 顶部菜单颜色
  39. '#031633',//发帖用户栏背景色
  40. '#084298',//辅助类颜色1
  41. '#dee2e6',//辅助类颜色2
  42. '#dc3545',//红色
  43. '#198754',//绿色
  44. '#0d6efd',//蓝色
  45. ];
  46. var classic_colors = [
  47. '#333333',//默认前景色
  48. '#f8f9fa',//全页面背景色
  49. 'white',//一般元素背景色
  50. '#E8EFF5',//分区表头背景色
  51. '#2B7ACD',// 顶部菜单颜色
  52. '#E5EDF2',//发帖用户栏背景色
  53. '#C2D5E3',//辅助类颜色1
  54. '#E5EDF2',//辅助类颜色2
  55. '#FF0000',//红色
  56. '#009900',//绿色
  57. '#0000FF',//蓝色
  58. ]
  59. let now_colors = [];
  60. if(GM_getValue("colors") == 0){
  61. now_colors = default_colors;
  62. }
  63. if(GM_getValue("colors") == 1){
  64. now_colors = dark_colors;
  65. }
  66. if(GM_getValue("colors") == 2){
  67. now_colors = classic_colors;
  68. }
  69.  
  70. console.log(GM_getValue("colors"));
  71. console.log(now_colors);
  72. if(GM_getValue("colors") == 0){
  73. let id1 = GM_registerMenuCommand(
  74. "默认✅",
  75. function () {
  76. GM_setValue("colors", 0);
  77. location.reload()
  78. },
  79. )}else{
  80. let id1 = GM_registerMenuCommand(
  81. "默认",
  82. function () {
  83. GM_setValue("colors", 0);
  84. location.reload()
  85. },
  86. )
  87. };
  88. if(GM_getValue("colors") == 1){
  89. let id2 = GM_registerMenuCommand(
  90. "暗黑✅",
  91. function () {
  92. GM_setValue("colors", 1);
  93. location.reload()
  94. },
  95. )}else{
  96. let id2 = GM_registerMenuCommand(
  97. "暗黑",
  98. function () {
  99. GM_setValue("colors", 1);
  100. location.reload()
  101. },
  102. )
  103. };
  104. if(GM_getValue("colors") == 2){
  105. let id3 = GM_registerMenuCommand(
  106. "经典✅",
  107. function () {
  108. GM_setValue("colors", 2);
  109. location.reload()
  110. },
  111. )}else{
  112. let id3 = GM_registerMenuCommand(
  113. "经典",
  114. function () {
  115. GM_setValue("colors", 2);
  116. location.reload()
  117. },
  118. )
  119. };
  120. if(GM_getValue("icon") == 0){
  121. let id4 = GM_registerMenuCommand(
  122. "✅更换小图标",
  123. function () {
  124. if(GM_getValue("icon") == 0){
  125. GM_setValue("icon", 1);
  126. location.reload()
  127. }else{
  128. GM_setValue("icon", 0);
  129. location.reload()
  130. }
  131. },
  132. )}else{
  133. let id4 = GM_registerMenuCommand(
  134. "❌更换小图标",
  135. function () {
  136. if(GM_getValue("icon") == 0){
  137. GM_setValue("icon", 1);
  138. location.reload()
  139. }else{
  140. GM_setValue("icon", 0);
  141. location.reload()
  142. }
  143. },
  144. )
  145. };
  146. // 全局样式
  147. // 强制性规则
  148. var style = document.createElement('style');
  149. style.type = 'text/css';
  150. style.innerHTML = 'body { background:'+ now_colors[1]+' !important; }';
  151.  
  152. // 将新样式添加到文档的<head>部分
  153. document.head.appendChild(style);
  154.  
  155. //隐藏原背景图
  156. var body = document.querySelectorAll("body")
  157. for (let i =0; i < body.length; i++){
  158. body[i].style.background = ""
  159. body[i].style.backgroundImage = "none";
  160. }
  161. //更改a标签
  162. var aElements = document.getElementsByTagName("a");
  163. for (var i = 0; i < aElements.length; i++) {
  164. aElements[i].style.color = now_colors[0];
  165. }
  166. var aElements_xi1 = document.querySelectorAll("a.xi1");
  167. for (let i = 0; i < aElements_xi1.length; i++) {
  168. aElements_xi1[i].style.color = "#F26C4F";
  169. }
  170.  
  171. var tbodyElements = document.getElementsByTagName("tbody");
  172. for (i = 0; i < tbodyElements.length; i++) {
  173. tbodyElements[i].style.backgroundColor = now_colors[2];
  174. tbodyElements[i].style.color = now_colors[0];
  175. }
  176. var bm = document.getElementsByClassName("bm");
  177. for (i =0; i < bm.length; i++){
  178. bm[i].style.backgroundColor = now_colors[2];
  179. }
  180.  
  181. document.getElementById("toptb").style.display = "none";//隐藏B站官方账号提示
  182.  
  183. //更改font标签颜色
  184. var font = document.querySelectorAll('font');
  185. for (i =0; i < font.length; i++){
  186. font[i].style.color = now_colors[0];
  187. }
  188.  
  189. //替换红色
  190. var font_red_1 = document.querySelectorAll('font[color="#FF0000"]');
  191. var font_red_2 = document.querySelectorAll('font[color="red"]');//替换红色
  192. for (i =0; i < font_red_1.length; i++){
  193. font_red_1[i].style.color = now_colors[8];
  194. }
  195. for (i =0; i < font_red_2.length; i++){
  196. font_red_2[i].style.color = now_colors[8];
  197. }
  198.  
  199. //替换绿色
  200. var font_green = document.querySelectorAll('font[color="#009900"]');
  201. for (i =0; i < font_green.length; i++){
  202. font_green[i].style.color = now_colors[9];
  203. }
  204.  
  205. //替换蓝色
  206. var font_blue_1 = document.querySelectorAll('font[color="#0000FF"]');
  207. var font_blue_2 = document.querySelectorAll('font[color="blue"]');
  208. for (i =0; i < font_blue_1.length; i++){
  209. font_blue_1[i].style.color = now_colors[10];
  210. }
  211. for (i =0; i < font_blue_2.length; i++){
  212. font_blue_2[i].style.color = now_colors[10];
  213. }
  214.  
  215. //更改h2颜色
  216. var h2 = document.querySelectorAll('h2');
  217. for (i =0; i < h2.length; i++){
  218. h2[i].style.color = now_colors[0];
  219. }
  220.  
  221. //门户样式
  222. var dxb_bc = document.querySelectorAll('.dxb_bc,.module.cl.xl.xl1');
  223. for (i =0; i < dxb_bc.length; i++){
  224. dxb_bc[i].style.backgroundColor = now_colors[2];
  225. }
  226. var area = document.querySelectorAll('.area,.frame.move-span.cl.frame-1-1-1');
  227. for (i =0; i < area.length; i++){
  228. area[i].style.backgroundColor = now_colors[1];
  229. }
  230. var frame = document.querySelectorAll('.frame, .frame-tab');
  231. for (i =0; i < frame.length; i++){
  232. frame[i].style.backgroundColor = now_colors[1];
  233. frame[i].style.border = "none";
  234. }
  235.  
  236. //网站样式
  237. if(document.getElementsByClassName("bm_h cl")[0]){
  238. document.getElementsByClassName("bm_h cl")[0].style.display = "none";//隐藏抖音官方账号提示
  239. }
  240. if(document.getElementById("chart")){//隐藏统计数据
  241. document.getElementById("chart").style.display = "none";
  242. }
  243. if(document.getElementById("nv")){
  244. var nv = document.getElementById("nv");
  245. nv.style.background = now_colors[4];//设置顶部菜单颜色
  246. nv.style.borderLeft= "none";
  247. nv.style.borderRight= "none";
  248. var nv_a = document.getElementById("nv").getElementsByTagName("a");//设置a标签元素
  249. for (i = 0; i < nv_a.length; i++) {
  250. nv_a[i].style.color = "white";
  251. }
  252. }
  253. if(document.getElementsByClassName("nav_ico02")[0]){
  254. var nav_ico02 = document.getElementsByClassName("nav_ico02")[0];//更改图标02
  255. nav_ico02.style.backgroundImage = "url(https://icons.getbootstrap.com/assets/icons/archive.svg)";
  256. nav_ico02.style.backgroundSize = '40px 40px';
  257. nav_ico02.style.backgroundPosition = "4px"
  258. var nav_ico03 = document.getElementsByClassName("nav_ico03")[0];//更改图标03
  259. nav_ico03.style.backgroundImage = "url(https://icons.getbootstrap.com/assets/icons/box.svg)";
  260. nav_ico03.style.backgroundSize = '40px 40px';
  261. nav_ico03.style.backgroundPosition = "4px"
  262. var nav_ico01 = document.getElementsByClassName("nav_ico01")[0];//更改图标01
  263. nav_ico01.style.backgroundImage = "url(https://icons.getbootstrap.com/assets/icons/house.svg)";
  264. nav_ico01.style.backgroundSize = '40px 40px';
  265. nav_ico01.style.backgroundPosition = "4px"
  266. var nav_ico04 = document.getElementsByClassName("nav_ico04")[0];//更改图标04
  267. nav_ico04.style.backgroundImage = "url(https://icons.getbootstrap.com/assets/icons/search.svg)";
  268. nav_ico04.style.backgroundSize = '40px 40px';
  269. nav_ico04.style.backgroundPosition = "4px";
  270. }
  271. //更改顶部菜单
  272. if(document.getElementsByClassName("comiis_nav")[0]){
  273. var comiis_nav_font = document.getElementsByClassName("comiis_nav")[0].getElementsByTagName("font");
  274. for (i = 0; i < comiis_nav_font.length; i++) {
  275. comiis_nav_font[i].style.color = now_colors[0];
  276. }
  277. document.getElementsByClassName("comiis_nav")[0].style.background = "none"
  278. document.getElementsByClassName("comiis_nav")[0].style.border= "none";
  279. }
  280. //更改搜索栏
  281. if(document.getElementById("scbar")){
  282. var scbar_tbody = document.getElementById("scbar").getElementsByTagName("tbody");
  283. for (i = 0; i < scbar_tbody.length; i++) {
  284. scbar_tbody[i].style.backgroundColor = now_colors[3];
  285. }
  286. document.getElementById("scbar").style.background = "none";
  287. document.getElementById("scbar").style.border= "none";
  288. document.getElementById("scbar").style.backgroundColor = now_colors[3];
  289. document.getElementsByClassName("scbar_icon_td")[0].style.background = "none";
  290. }
  291. //搜索页样式
  292. var scform = document.querySelectorAll("table#scform_form > tbody")
  293. for (i =0; i < scform.length; i++){
  294. scform[i].style.background = "none";
  295. }
  296.  
  297. //更改排行榜表头
  298. if(document.getElementsByClassName("toptitle_7ree")[0]){
  299. var toptitle_7ree_span = document.getElementsByClassName("toptitle_7ree")[0].getElementsByTagName("span");
  300. for (i = 0; i < toptitle_7ree_span.length; i++) {
  301. toptitle_7ree_span[i].style.color = now_colors[0];
  302. }
  303. var toptitle_7ree_td = document.getElementsByClassName("toptitle_7ree")[0].getElementsByTagName("td");//更改排行榜表头
  304. for (i = 0; i < toptitle_7ree_td.length; i++) {
  305. toptitle_7ree_td[i].style.backgroundColor = now_colors[2];//设置表头背景色
  306. toptitle_7ree_td[i].style.borderTop = "1px solid #CDCDCD";//补回缺失的表头顶部框线
  307. }
  308. var threadline_7ree = document.getElementsByClassName("threadline_7ree");
  309. for (i = 0; i < threadline_7ree.length; i++) {
  310. var threadline_7ree_a = document.getElementsByClassName("threadline_7ree")[i].getElementsByTagName("a");
  311. for (var j = 0; j < threadline_7ree_a.length; j++) {
  312. threadline_7ree_a[j].style.color = now_colors[0];//更改排行榜表格内标注颜色
  313. }
  314. threadline_7ree[i].style.marginBottom = "8px";//优化行距
  315. threadline_7ree[i].style.borderBottom="none";//去除横线
  316. }
  317. //设置排行榜图标
  318. var boxbg_7ree = document.getElementsByClassName("boxbg_7ree");
  319. for (i = 0; i < boxbg_7ree.length; i++) {
  320. boxbg_7ree[i].style.backgroundImage = "none";//隐藏原图标
  321. boxbg_7ree[i].style.paddingLeft = "0px";//删除间隔
  322. var divs = boxbg_7ree[i].getElementsByTagName('div');
  323. // 获取div元素
  324. var divArray = Array.prototype.slice.call(divs);
  325.  
  326. // 定义颜色数组
  327. var colors = [
  328. '#f1404b', // 第1个div的颜色
  329. '#c56831', // 第2个div的颜色
  330. '#b89e2c', // 第3个div的颜色
  331. 'rgba(124, 124, 124, .3)' // 其他div的颜色
  332. ];
  333.  
  334. // 遍历div数组
  335. divArray.forEach(function(div, index) {
  336. // 创建包含序号的span元素
  337. var numberSpan = document.createElement('span');
  338. numberSpan.textContent = index + 1;
  339. numberSpan.style.color = "white";
  340. numberSpan.style.borderRadius = "4px";
  341. numberSpan.style.width = "18px";
  342. numberSpan.style.display = "inline-block";
  343. numberSpan.style.textAlign="center"
  344.  
  345. // 根据序号设置span的颜色
  346. if (index < colors.length) {
  347. numberSpan.style.backgroundColor = colors[index];
  348.  
  349. } else {
  350. numberSpan.style.backgroundColor = colors[3]; // 索引超出颜色数组时使用最后一个颜色
  351. }
  352.  
  353. // 将span插入到div的开头
  354. div.insertBefore(numberSpan, div.firstChild);
  355.  
  356. // 如果div已经有内容,需要在序号后添加空格以分隔
  357. if (div.firstChild !== numberSpan) {
  358. var spaceNode = document.createTextNode(' ');
  359. div.insertBefore(spaceNode, numberSpan.nextSibling);
  360. }
  361. });
  362. }
  363. }
  364. if(document.getElementById("pt")){
  365. document.getElementById("pt").backgroundColor = now_colors[2];//设置面包屑菜单背景色
  366. }
  367. //设置页码栏
  368. if(document.getElementsByClassName("pgs cl")){
  369. var pgs_cl = document.getElementsByClassName("pgs cl");
  370. for (i = 0; i < pgs_cl.length; i++) {
  371. pgs_cl[i].style.backgroundColor = now_colors[1];
  372. var pgs_cl_a = pgs_cl[i].getElementsByTagName("a")
  373. for (j = 0; j < pgs_cl_a.length; j++) {
  374. pgs_cl_a[j].style.backgroundColor = now_colors[5];
  375. }
  376. if(pgs_cl[i].getElementsByTagName("label")[0]){
  377. var pgs_cl_label = pgs_cl[i].getElementsByTagName("label");
  378. pgs_cl_label[0].style.backgroundColor = now_colors[5];
  379. pgs_cl_label[0].getElementsByTagName("span")[0].style.color = now_colors[0];
  380. }
  381. }
  382. }
  383. //设置类型栏
  384. if(document.getElementById("thread_types")){
  385. var thread_types_li = document.getElementById("thread_types").getElementsByTagName("li")
  386. for (i =0; i < thread_types_li.length; i++){
  387. thread_types_li[i].getElementsByTagName("a")[0].style.backgroundColor = now_colors[5];
  388. }
  389. }
  390. //分区样式
  391. if(document.getElementsByClassName("th")[0]){
  392. document.getElementsByClassName("th")[0].style.backgroundColor = now_colors[2];}
  393. var fl_bm_h = document.getElementsByClassName("bm_h cl");
  394. for (i =0; i < fl_bm_h.length; i++){
  395. fl_bm_h[i].style.backgroundImage = "none";//隐藏原背景图
  396. fl_bm_h[i].style.backgroundColor = now_colors[3];
  397. }
  398. var bm_bmw_cl = document.getElementsByClassName("bm bmw cl");
  399. for (i = 0; i < bm_bmw_cl.length; i++) {
  400. var bm_bmw_cl_a = document.getElementsByClassName("bm bmw cl")[i].getElementsByTagName("a");//更改顶部菜单内字体颜色
  401. for (j = 0; j < bm_bmw_cl_a.length; j++) {
  402. bm_bmw_cl_a[j].style.color = now_colors[0];
  403. }
  404. var bm_bmw_cl_font = document.getElementsByClassName("bm bmw cl")[i].getElementsByTagName("font");//更改顶部菜单内字体颜色
  405. for (var k = 0; k < bm_bmw_cl_font.length; k++) {
  406. bm_bmw_cl_font[k].style.display = "none";
  407. }
  408. var bm_bmw_cl_p = document.getElementsByClassName("bm bmw cl")[i].getElementsByTagName("p");//删除常驻的说明文本
  409. for (var m = 0; m < bm_bmw_cl_p.length; m++) {
  410. if (bm_bmw_cl_p[m].textContent.includes('◇')) {
  411. bm_bmw_cl_p[m].parentNode.removeChild(bm_bmw_cl_p[m]);
  412. }
  413. }
  414. }
  415. //定义函数:替换图标
  416. async function replaceImageWithSVG(originalSrc, svgUrl, width, height, color1, color2, color3) {
  417. try {
  418. // 选择所有具有指定src的img元素
  419. var imgElements = document.querySelectorAll('img[src="' + originalSrc + '"]');
  420.  
  421. // 遍历所有找到的img元素
  422. imgElements.forEach(async function(imgElement) {
  423. // 获取SVG内容
  424. let svgContent
  425. if(svgUrl==="postIcon"){
  426. svgContent = '<svg width="80" height="33" xmlns="http://www.w3.org/2000/svg"><g><title>发新帖</title><rect y="0" stroke="#000" rx="3" id="svg_4" height="33" width="80" opacity="NaN" fill="#fff"/><text transform="matrix(0.608383 0 0 0.60781 1.69923 6.58405)" stroke="#000" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" stroke-width="0" id="svg_5" y="26.34585" x="20.7751" fill="#000000">发帖</text><line id="svg_21" y2="40.02733" x2="84.88746" y1="39.96302" x1="84.82315" stroke="#000" fill="none"/><g id="svg_22"><line stroke="#000" id="svg_13" y2="13.21472" x2="68.9822" y1="13.21472" x1="56.26773" fill="none"/><line id="svg_19" y2="19.42826" x2="62.69555" y1="13.34865" x1="56.61594" stroke="#000" fill="none"/><line id="svg_20" y2="19.78528" x2="62.35787" y1="13.47365" x1="68.6695" stroke="#000" fill="none"/></g></g></svg>'
  427. }
  428. else{
  429. if(svgUrl==="replyIcon"){
  430. svgContent = '<svg width="80" height="33" xmlns="http://www.w3.org/2000/svg"><g><title>回复</title><rect x="0" y="0" stroke="#000" rx="3" id="svg_4" height="33" width="80" opacity="NaN" fill="#fff"/><text transform="matrix(0.608383 0 0 0.60781 1.69923 6.58405)" stroke="#000" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" stroke-width="0" id="svg_5" y="26.34585" x="37" fill="#000000" style="letter-spacing:3px">回复</text><line id="svg_21" y2="40.02733" x2="84.88746" y1="39.96302" x1="84.82315" stroke="#000" fill="none"/></g></svg>'
  431. }
  432. else{
  433. const response = await fetch(svgUrl);
  434. svgContent = await response.text();}
  435. }
  436. // 解析SVG内容
  437. const parser = new DOMParser();
  438. const svgDoc = parser.parseFromString(svgContent, "image/svg+xml");
  439. const svgElement = svgDoc.documentElement;
  440. svgElement.setAttribute('width', width)
  441. if(height){
  442. svgElement.setAttribute('height', height);
  443. }else{
  444. svgElement.setAttribute('height', width);
  445. }
  446. // 遍历SVG中的所有path元素并设置颜色
  447. svgElement.querySelectorAll('path').forEach(function(path) {
  448. path.setAttribute('fill', now_colors[0]);
  449. });
  450. svgElement.querySelectorAll('rect').forEach(function(rect) {
  451. rect.setAttribute('fill', color2);
  452. rect.setAttribute('stroke', color3);
  453. });
  454. svgElement.querySelectorAll('text').forEach(function(text) {
  455. text.setAttribute('fill', color1);
  456. });
  457. svgElement.querySelectorAll('line').forEach(function(line) {
  458. line.setAttribute('stroke', color1);
  459. });
  460. // 创建一个新的SVG元素
  461. const newSvgElement = document.importNode(svgElement, true);
  462. // 替换原始的img元素
  463. imgElement.parentNode.replaceChild(newSvgElement, imgElement);
  464. });
  465. } catch (error) {
  466. console.error('Error replacing image with SVG:', error);
  467. }
  468. }
  469.  
  470. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/pin_1.gif', 'https://icons.getbootstrap.com/assets/icons/arrow-up-circle.svg',17);//置顶图标
  471. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/ann_icon.gif', 'https://icons.getbootstrap.com/assets/icons/megaphone.svg',17);//喇叭图标
  472. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/folder_common.gif', 'https://icons.getbootstrap.com/assets/icons/file-earmark.svg',17);//普通页面图标
  473. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/folder_new.gif', 'https://icons.getbootstrap.com/assets/icons/file-earmark-fill.svg',17);//新页面图标
  474. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/folder_lock.gif', 'https://icons.getbootstrap.com/assets/icons/file-earmark-lock.svg',17);//关闭的主题图标
  475. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/rewardsmall.gif', 'https://icons.getbootstrap.com/assets/icons/coin.svg',17);//悬赏图标
  476. if(GM_getValue("icon") == 0){
  477. replaceImageWithSVG('https://static.52pojie.cn/static/image/filetype/image_s.gif', 'https://icons.getbootstrap.com/assets/icons/file-earmark-image-fill.svg',16);//图片附件图标
  478. replaceImageWithSVG('https://static.52pojie.cn/static/image/filetype/common.gif', 'https://icons.getbootstrap.com/assets/icons/file-earmark-arrow-up-fill.svg',16);//附件图标
  479. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/recommend_2.gif', 'https://icons.getbootstrap.com/assets/icons/hand-index-thumb.svg',16);//推荐图标
  480. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/recommend_1.gif', 'https://icons.getbootstrap.com/assets/icons/hand-index-thumb.svg',16);//推荐图标
  481. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/hot_3.gif', 'https://icons.getbootstrap.com/assets/icons/fire.svg',16);//热门图标
  482. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/hot_2.gif', 'https://icons.getbootstrap.com/assets/icons/fire.svg',16);//热门图标
  483. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/hot_1.gif', 'https://icons.getbootstrap.com/assets/icons/fire.svg',16);//热门图标
  484. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/agree.gif', 'https://icons.getbootstrap.com/assets/icons/hand-thumbs-up-fill.svg',16);//帖子被加分图标
  485. }
  486. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/forum.gif', 'https://icons.getbootstrap.com/assets/icons/chat.svg',31);//非活跃区图标
  487. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/forum_new.gif', 'https://icons.getbootstrap.com/assets/icons/chat-fill.svg',31);//活跃区图标
  488. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/pn_post.png', 'postIcon',80, 33, now_colors[0], now_colors[5], "#C2D5E3");//发帖图标
  489. replaceImageWithSVG('https://static.52pojie.cn/static/image/common/pn_reply.png', 'replyIcon',80, 33, now_colors[0], now_colors[5], "#C2D5E3");//发帖图标
  490.  
  491. //论坛内样式
  492. //设置发帖用户栏
  493. var div = document.getElementsByTagName("div");
  494. for (i =0; i <div.length; i++){
  495. var div_pls = div[i].getElementsByClassName("pls");
  496. for (j =0; j < div_pls.length; j++){
  497. div_pls[j].style.backgroundColor = now_colors[5];
  498. var pls_tbody = document.getElementsByClassName("pls")[j].getElementsByTagName("tbody");
  499. for (k =0; k < pls_tbody.length; k++){
  500. pls_tbody[k].style.backgroundColor = now_colors[5];
  501. }
  502. }
  503. }
  504. //用户栏分割线
  505. var tdpls = document.querySelectorAll("tr.ad > td.pls");
  506. for (i =0; i < tdpls.length; i++){
  507. tdpls[i].style.backgroundColor = now_colors[6];
  508. }
  509. var tdplc = document.querySelectorAll("tr.ad > td.plc");
  510. for (i =0; i < tdplc.length; i++){
  511. tdplc[i].style.backgroundColor = now_colors[7];
  512. }
  513. //用户栏内样式
  514. var dt = document.getElementsByTagName("dt")
  515. for (i =0; i < dt.length; i++){
  516. dt[i].style.color = now_colors[0];
  517. }
  518. var dd = document.getElementsByTagName("dd")
  519. for (i =0; i < dd.length; i++){
  520. dd[i].style.color = now_colors[0];
  521. }
  522. //楼层标号样式
  523. var pistronga = document.querySelectorAll(".pi>strong>a");
  524. for (i =0; i < pistronga.length; i++){
  525. pistronga[i].style.border = "none";
  526. }
  527.  
  528. if(document.getElementById("online")){//隐藏在线人数框
  529. document.getElementById("online").style.display="none";
  530. }
  531. if(document.getElementById("category_lk")){//隐藏友站
  532. document.getElementById("category_lk").style.display="none";
  533. }
  534.  
  535. //下一页样式
  536. var bm_h = document.getElementsByClassName("bm_h")
  537. for (i =0; i < bm_h.length; i++){
  538. bm_h[i].style.backgroundColor = now_colors[5];
  539. }
  540. //板块主题样式
  541. var trts_th = document.querySelectorAll("tr.ts,tr.ts > th");
  542. for (i =0; i < trts_th.length; i++){
  543. trts_th[i].style.backgroundColor = now_colors[5];
  544. }
  545. var trts_td = document.querySelectorAll("tr.ts > td");
  546. for (i =0; i < trts_td.length; i++){
  547. trts_td[i].style.backgroundColor = now_colors[5];
  548. }
  549.  
  550. //隐藏免责声明
  551. if(document.getElementsByClassName("wp vw50_kfc_f")[0]){
  552. document.getElementsByClassName("wp vw50_kfc_f")[0].style.display="none";
  553. }
  554.  
  555. })();