必应搜索质感主题

以卡片形式展示结果,遵循Material Design。

当前为 2021-04-24 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Bing Search Material Theme
  3. // @name:zh-CN 必应搜索质感主题
  4. // @description Show results as cards, follow Material Design.
  5. // @description:zh-CN 以卡片形式展示结果,遵循Material Design。
  6. // @namespace https://greasyfork.org/users/197529
  7. // @version 0.7.14
  8. // @author kkocdko
  9. // @license Unlicense
  10. // @match *://*.bing.com/search
  11. // @run-at document-start
  12. // ==/UserScript==
  13. document.lastChild.appendChild(document.createElement("style")).textContent = `
  14.  
  15. #b_context,
  16. #b_footer,
  17. #b_header #id_h,
  18. #b_header .b_logoArea,
  19. #b_content #ev_talkbox_wrapper,
  20. #b_content #mfa_root,
  21. #b_results .sb_fav,
  22. #b_results .fbans,
  23. #b_results > li:empty,
  24. #fbpgbt,
  25. #b_notificationContainer_bop,
  26. #b_opalpers,
  27. #b_lbOverlay {
  28. display: none;
  29. }
  30.  
  31. html {
  32. background: rgb(248, 249, 250);
  33. }
  34.  
  35. body {
  36. --card-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3),
  37. 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  38. min-width: 0;
  39. }
  40.  
  41. #b_header,
  42. #b_header .b_searchboxForm,
  43. #b_content,
  44. #b_results {
  45. width: 90vw;
  46. min-width: 0;
  47. max-width: 700px;
  48. margin: 0 auto;
  49. background: rgba(0, 0, 0, 0);
  50. }
  51.  
  52. #b_header > * {
  53. z-index: 1;
  54. margin: 0;
  55. }
  56.  
  57. #b_header #est_switch > *::after,
  58. #b_header .b_searchboxForm,
  59. #b_header #sa_ul {
  60. border: 0;
  61. box-shadow: var(--card-shadow);
  62. }
  63.  
  64. #b_header .b_searchboxForm {
  65. text-align: right;
  66. background: #fff;
  67. border-radius: 0 5px 5px 5px;
  68. }
  69.  
  70. #b_header #sb_form_q {
  71. float: left;
  72. width: calc(100% - 150px);
  73. height: 46px;
  74. padding-top: 0;
  75. margin: 0;
  76. font-size: 16px;
  77. }
  78.  
  79. #b_header .sa_as {
  80. text-align: left;
  81. border: none;
  82. }
  83.  
  84. #b_header #sb_form,
  85. #b_content #b_tween {
  86. margin-bottom: 10px;
  87. }
  88.  
  89. #b_content {
  90. padding-left: 0;
  91. }
  92.  
  93. #b_results > *,
  94. #b_content #b_pole {
  95. position: relative;
  96. padding: 15px 20px;
  97. margin: 0;
  98. margin-bottom: 15px;
  99. overflow: hidden;
  100. border-radius: 5px;
  101. box-shadow: var(--card-shadow);
  102. }
  103.  
  104. #b_results > * > * {
  105. padding-top: 0;
  106. padding-bottom: 0;
  107. margin: 0;
  108. border: 0;
  109. outline: 0;
  110. }
  111.  
  112. #b_results :not(.b_rs) > h2 {
  113. padding-bottom: 5px;
  114. }
  115.  
  116. #b_results h2 a,
  117. #b_results .b_factrow a,
  118. #b_results .b_rs a {
  119. color: rgb(13, 71, 161);
  120. text-decoration: none;
  121. }
  122.  
  123. #b_results strong,
  124. #b_results .b_factrow strong,
  125. #b_results .b_rs strong {
  126. color: rgb(183, 28, 28);
  127. }
  128.  
  129. #b_results .b_title .square_mi {
  130. padding-left: 0;
  131. }
  132.  
  133. /* Media List Scroll Button */
  134. #b_results .b_overlay .btn {
  135. margin: -16px 5px;
  136. }
  137.  
  138. /* View More Button */
  139. #b_results .salink,
  140. #b_results .b_expDesk {
  141. margin-bottom: 30px;
  142. }
  143.  
  144. /* Sports Match Card */
  145. #b_results li > .sportsAns {
  146. margin: 0 -1px -15px;
  147. }
  148.  
  149. /* Map Card */
  150. #b_results .mt_mop,
  151. #b_results .lgb_ans {
  152. margin: -15px -20px;
  153. }
  154. #b_results .mt_mop table {
  155. margin-left: 10px;
  156. }
  157. #b_results .dynMap {
  158. width: 100%;
  159. }
  160.  
  161. /* Dict Card */
  162. #b_results .dict_oa {
  163. padding: 0;
  164. box-shadow: none;
  165. }
  166.  
  167. /* Translate Card */
  168. #b_results #tt_perajx {
  169. margin: -17px -2px;
  170. }
  171.  
  172. /* People Also Ask Card */
  173. #b_results #df_listaa {
  174. margin: -15px -20px -20px;
  175. }
  176.  
  177. /* Hotspot Panel */
  178. #b_content #b_pole div {
  179. background: none;
  180. }
  181.  
  182. `.replace(/;/g, "!important;");