百度书签

美化百度首页的书签页面。

  1. // ==UserScript==
  2. // @name BaiDu Bookmark
  3. // @name:zh-CN 百度书签
  4. // @description Beautify the bookmark at the home page of Baidu.
  5. // @description:zh-CN 美化百度首页的书签页面。
  6. // @namespace https://github.com/HaleShaw
  7. // @version 1.0.3
  8. // @author HaleShaw
  9. // @copyright 2020+, HaleShaw (https://github.com/HaleShaw)
  10. // @license AGPL-3.0-or-later
  11. // @homepage https://github.com/HaleShaw/TM-BaiDu
  12. // @supportURL https://github.com/HaleShaw/TM-BaiDu/issues
  13. // @contributionURL https://www.jianwudao.com/
  14. // @icon https://www.baidu.com/favicon.ico
  15. // @match https://www.baidu.com/
  16. // @compatible Chrome
  17. // @grant GM_addStyle
  18. // ==/UserScript==
  19.  
  20. // ==OpenUserJS==
  21. // @author HaleShaw
  22. // @collaborator HaleShaw
  23. // ==/OpenUserJS==
  24.  
  25. (function () {
  26. 'use strict';
  27.  
  28. const mStyle = `
  29. .s-menu-container,
  30. #s_content_2,
  31. #s_content_1,
  32. .s-top-nav,
  33. .tips-manager-area,
  34. #bottom_layer,
  35. #bottom_space,
  36. .s-more-bar.c-color-gray2,
  37. #s_qrcode_feed,
  38. .video-meet-entry,
  39. #result_logo,
  40. #s_lg_img,
  41. #s_lg_img_new,
  42. #s_mp,
  43. #s_side_wrapper>div.guide-info-new.s_side_wrapper-left,
  44. #s_side_wrapper>div.side-entry.aging-entry,
  45. #head>div.s-isindex-wrap.sui-wraper>div.sui-prevent-wheel.s-isindex-wrap.sui-dialog.sui-dialog-nav-pannel.sui-dialog-mine-pannel.sui-dialog-hasmask.sui-dialog-hastitle>div.sui-dialog-body>div>div.recom-content,
  46. #s-usersetting-top>div.guide-info-new.s-usersetting-top-bottom,
  47. #desktopModalMask > div > div > div:nth-child(2) > div:nth-child(2) {
  48. display: none !important;
  49. }
  50.  
  51. body[baidu],
  52. #wrapper #head,
  53. #wrapper #s_tab,
  54. form.fm .s_ipt_wr.bg {
  55. background: none !important;
  56. }
  57.  
  58. #s_content_100 {
  59. display: block !important;
  60. }
  61.  
  62. #s_main {
  63. padding: 0 0;
  64. }
  65.  
  66. .s-content {
  67. padding-bottom: 0;
  68. }
  69.  
  70. .s-mine-wrapper {
  71. margin-top: 0;
  72. }
  73.  
  74. .s-skin-hasbg #s_main {
  75. background: rgba(255, 255, 255, 0.55);
  76. }
  77.  
  78. #head_wrapper {
  79. min-height: 100px;
  80. max-height: 180px;
  81. }
  82.  
  83. #head_wrapper .s-p-top {
  84. min-height: 50px;
  85. max-height: 100px;
  86. }
  87.  
  88. .s-block-nav .dir-item {
  89. margin-left: 10px !important;
  90. }
  91.  
  92. .s-block-nav .dir-item .dir-name {
  93. width: 48px !important;
  94. padding: 5px 0 5px 0 !important;
  95. }
  96.  
  97. .s-block-nav .dir-item .d-nav-item {
  98. margin-right: 5px !important;
  99. margin-top: 5px !important;
  100. margin-bottom: 5px !important;
  101. }
  102.  
  103. .c-span3 {
  104. width: 150px !important;
  105. }
  106.  
  107. .c-gap-left-large {
  108. margin-left: 5px !important;
  109. }
  110.  
  111. .c-gap-left-small.nav-text {
  112. width: 110px !important;
  113. }
  114.  
  115. div.normal-site-img_3ID7V {
  116. width: 36px !important;
  117. height: 36px !important;
  118. line-height: 36px !important;
  119. font-size: 18px !important;
  120. }
  121.  
  122. a.site-item-img_3NN3N,
  123. a.site-item-img_3NN3N>img {
  124. width: 36px !important;
  125. height: 36px !important;
  126. }
  127.  
  128. .site-container_3QJpT .cate-site-item_1rqow {
  129. margin: 6px 4px !important;
  130. height: 54px !important;
  131. line-height: 54px !important;
  132. }
  133.  
  134. .site-item-label_3WxsF {
  135. margin-top: 2px !important;
  136. }
  137.  
  138. .c-wrapper-l {
  139. width: 1380px !important;
  140. }
  141.  
  142. #s_xmancard_desktop>div.san-card>div,
  143. #s_xmancard_desktop>div.san-card>div>div>div>div,
  144. #s_xmancard_desktop>div.san-card>div>div>div>div>div>div.content_2q4gZ {
  145. width: 1412px !important;
  146. }
  147.  
  148. #s_xmancard_desktop>div.san-card>div>div>div>div>div>div>div>div>div {
  149. width: 1310px !important;
  150. }
  151.  
  152. /* 添加按钮 */
  153. #s_xmancard_desktop>div.san-card>div>div>div>div>div>div.content_2q4gZ>div>span.add-cate-site-btn_1U_oz {
  154. position: absolute;
  155. width: 36px;
  156. height: 36px;
  157. line-height: 36px;
  158. top: -105px;
  159. right: 100px;
  160. border: 1px dashed white;
  161. }
  162.  
  163. #s_xmancard_desktop>div.san-card>div>div>div>div>div>div.content_2q4gZ>div>span.add-cate-site-btn_1U_oz>i {
  164. color: white;
  165. }
  166.  
  167. #s_xmancard_desktop>div.san-card>div>div>div>div>div>div.content_2q4gZ>div>span.add-cate-site-btn_1U_oz:hover {
  168. border: 1px dashed #315efb;
  169. }
  170.  
  171. #s_xmancard_desktop>div.san-card>div>div>div>div>div>div.content_2q4gZ>div>span.add-cate-site-btn_1U_oz>i:hover {
  172. color: #315efb;
  173. }
  174.  
  175. /* 添加网址的弹窗 */
  176. #desktopModalMask>div{
  177. height: 100px !important;
  178. }
  179.  
  180. /* 添加网址的弹窗中的“添加网址”按钮 */
  181. #desktopModalMask > div > div > div:nth-child(2) > div:nth-child(1) > button{
  182. margin-top: 10px !important;
  183. }
  184.  
  185. /* 添加网址的弹窗中,分类下拉列表 */
  186. .select-wrapper_3Yt8t,
  187. .select-board_xSgU5 {
  188. max-height: 300px !important;
  189. }
  190. `;
  191.  
  192. window.onload = function () {
  193. updateMenu();
  194. document.getElementById("s_menu_mine").click();
  195. GM_addStyle(mStyle);
  196. }
  197.  
  198. // 更新菜单
  199. function updateMenu() {
  200. let menuParent = document.getElementById('s-top-left');
  201.  
  202. if (menuParent) {
  203. menuParent.innerHTML = '';
  204. menuParent.append(createMenu('地图', 'http://map.baidu.com'));
  205. menuParent.append(createMenu('网盘', 'https://pan.baidu.com/'));
  206. menuParent.append(createMenu('图片', 'http://image.baidu.com/'));
  207. menuParent.append(createMenu('百科', 'https://baike.baidu.com/'));
  208. }
  209. }
  210.  
  211. // 创建菜单项
  212. function createMenu(name, url) {
  213. const menu = document.createElement('a');
  214. menu.setAttribute('href', url);
  215. menu.setAttribute('target', '_blank');
  216. menu.setAttribute('class', 'mnav c-font-normal c-color-t');
  217. menu.text = name;
  218. return menu;
  219. }
  220. })();

QingJ © 2025

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