Greasy Fork is available in English.

EasyCNBLOGS

这是一款促进博客园极致简洁和高效的插件。免费共享大量创新功能,如:净化页面等。让我们的学习体验无比简洁、专注、高效、畅快。

As of 2023-12-17. See the latest version.

  1. // ==UserScript==
  2. // @name EasyCNBLOGS
  3. // @description 这是一款促进博客园极致简洁和高效的插件。免费共享大量创新功能,如:净化页面等。让我们的学习体验无比简洁、专注、高效、畅快。
  4. // @version 4.0
  5. // @author xcanwin
  6. // @namespace https://github.com/xcanwin/EasyCNBLOGS/
  7. // @supportURL https://github.com/xcanwin/EasyCNBLOGS/
  8. // @license GPL-2.0-only
  9. // @match *://www.cnblogs.com/*/p/*.html
  10. // @match *://www.cnblogs.com/*/archive/*.html
  11. // @grant GM_addStyle
  12. // @run-at document-start
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. const $ = (Selector, el) => (el || document).querySelector(Selector);
  19. const $$ = (Selector, el) => (el || document).querySelectorAll(Selector);
  20.  
  21. /*电脑端净化样式*/
  22. const purify_style_pc = `
  23. .postTitle /*隐藏[正文的][顶部的]原标题*/,
  24. #right_meun /*隐藏[正文的][右边的]栏*/,
  25. #blog_post_info_block /*隐藏[正文的][底部的]推荐关注*/
  26. {
  27. display: none !important;
  28. }
  29.  
  30. /*隐藏背景*/
  31. html body {
  32. background: none !important;
  33. background-image: unset !important;
  34. background-color: unset !important;
  35. }
  36.  
  37. /*展示全屏*/
  38. body {
  39. margin-left: unset !important;
  40. margin-right: unset !important;
  41. margin-bottom: unset !important;
  42. padding: unset !important;
  43. padding-bottom: unset !important;
  44. display: flex;
  45. justify-content: center;
  46. }
  47. .post {
  48. border: unset !important;
  49. border-bottom-width: unset !important;
  50. border-right-width: unset !important;
  51. padding: unset !important;
  52. margin-bottom: unset !important;
  53. width: 80%;
  54. }
  55. .postText {
  56. padding-right: unset !important;
  57. padding-left: unset !important;
  58. padding-bottom: unset !important;
  59. padding-top: unset !important;
  60. }
  61.  
  62. /*调整标题*/
  63. span[role="heading"] {
  64. display: flex;
  65. justify-content: center;
  66. margin-top: 35px !important;
  67. margin-bottom: 20px !important;
  68. color: black !important;
  69. font-size: 33px !important;
  70. font-family: 'PingFang SC','Microsoft YaHei','SimHei','Arial','SimSun';
  71. }
  72. `;
  73.  
  74. //净化页面
  75. const purifyPage = function() {
  76. GM_addStyle(purify_style_pc);
  77. };
  78.  
  79. //超净化页面
  80. const purifyPageSuper = function() {
  81. const p = $(".post");
  82. $('body').innerHTML = "";
  83. $('body').appendChild(p);
  84. };
  85.  
  86. //调整标题
  87. const beautyTitle = function() {
  88. $('.post').insertBefore($('span[role="heading"]'), $('.post').childNodes[0]);
  89. };
  90.  
  91. document.addEventListener("DOMContentLoaded", function() {
  92. purifyPageSuper();
  93. beautyTitle();
  94. });
  95.  
  96. purifyPage();
  97.  
  98. })();