微信读书-首页字体调整

为微信读书网页端分区域调整字体和字号

  1. // ==UserScript==
  2. // @name 微信读书-首页字体调整
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.23
  5. // @description 为微信读书网页端分区域调整字体和字号
  6. // @icon https://i.miji.bid/2025/03/15/560664f99070e139e28703cf92975c73.jpeg
  7. // @author Grok
  8. // @match https://weread.qq.com/
  9. // @match https://weread.qq.com/web/shelf
  10. // @grant GM_addStyle
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // 添加CSS样式
  18. GM_addStyle(`
  19. /* 导入霞鹜文楷在线字体 */
  20. @import url('https://cdn.jsdelivr.net/npm/lxgw-wenkai-webfont@1.1.0/style.css');
  21.  
  22. /* 全局默认字体设置 */
  23. body, body * {
  24. font-family: "LXGW WenKai", "霞鹜文楷", sans-serif !important;
  25. }
  26.  
  27. /* 【我的书架】区域样式 */
  28. /* 标题栏 - 只加粗 */
  29. .wr_index_page_top_section_header_wrapper {
  30. font-weight: bold !important;
  31. }
  32. /* 书名 - 加粗 */
  33. .wr_index_mini_shelf_card_content_title {
  34. font-weight: bold !important;
  35. font-size: 100% !important;
  36. }
  37. /* 作者 - 默认 */
  38. .wr_index_mini_shelf_card_content_author {
  39. font-weight: normal !important;
  40. font-size: 90% !important;
  41. }
  42.  
  43. /* 【猜你喜欢】区域样式 */
  44. /* 标题栏 - 只加粗 */
  45. .wr_index_page_top_section_content_title {
  46. font-weight: bold !important;
  47. }
  48. /* 书名 - 加粗 */
  49. .wr_suggestion_card_content_title {
  50. font-weight: bold !important;
  51. font-size: 100% !important;
  52. }
  53. /* 作者 - 默认 */
  54. .wr_suggestion_card_content_author {
  55. font-weight: normal !important;
  56. font-size: 90% !important;
  57. }
  58. /* 描述 - 默认 */
  59. .wr_suggestion_card_content_reason {
  60. font-weight: normal !important;
  61. font-size: 90% !important;
  62. }
  63.  
  64. /* 【榜单】区域样式 */
  65. /* 标题栏 - 只加粗 */
  66. .wr_index_page_rank_list_title {
  67. font-weight: bold !important;
  68. }
  69. /* 书名 - 加粗 */
  70. .wr_index_page_mini_bookInfo_content_title {
  71. font-weight: bold !important;
  72. font-size: 100% !important;
  73. }
  74. /* 作者 - 默认 */
  75. .wr_index_page_mini_bookInfo_content_author {
  76. font-weight: normal !important;
  77. font-size: 90% !important;
  78. }
  79. /* 推荐值 - 默认 */
  80. .wr_index_page_mini_bookInfo_content_recommend_lang {
  81. font-weight: normal !important;
  82. font-size: 90% !important;
  83. }
  84.  
  85. /* 【分类】区域样式 */
  86. /* 标题栏 - 只加粗 */
  87. .wr_index_page_category_list_title {
  88. font-weight: bold !important;
  89. }
  90. /* 分类名称 - 默认 */
  91. .wr_index_page_category_list_content_card_name {
  92. font-weight: normal !important;
  93. font-size: 100% !important;
  94. }
  95. /* 书籍数量 - 默认 */
  96. .wr_index_page_category_list_content_card_count {
  97. font-weight: normal !important;
  98. font-size: 90% !important;
  99. }
  100. `);
  101.  
  102. // 动态检查和调试
  103. function checkElements() {
  104. const body = document.querySelector('body');
  105. if (body) {
  106. console.log('找到body元素,样式应已应用', body);
  107. } else {
  108. console.log('未找到body元素');
  109. }
  110.  
  111. // 检查各区域关键元素是否应用了样式(用于调试)
  112. const elements = [
  113. '.wr_index_page_top_section_header_wrapper', // 我的书架标题
  114. '.wr_index_mini_shelf_card_content_title', // 我的书架书名
  115. '.wr_suggestion_card_content_title', // 猜你喜欢书名
  116. '.wr_index_page_rank_list_title', // 榜单标题
  117. '.wr_index_page_category_list_title' // 分类标题
  118. ];
  119.  
  120. elements.forEach(selector => {
  121. const el = document.querySelector(selector);
  122. if (el) {
  123. console.log(`找到元素: ${selector}`, el);
  124. } else {
  125. console.log(`未找到元素: ${selector}`);
  126. }
  127. });
  128. }
  129.  
  130. // 页面加载完成后检查
  131. window.addEventListener('load', checkElements);
  132. // 动态内容可能延迟加载,定时检查
  133. setTimeout(checkElements, 2000);
  134. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址