百度搜索页面美化成谷歌

特色:谷歌化,尽量的精简 - 注意:切记需要配合脚本<AC-baidu:重定向优化百度搜狗谷歌必应搜索_favicon_双列 - inDarkness>使用

  1. // ==UserScript==
  2. // @name 百度搜索页面美化成谷歌
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.6
  5. // @description 特色:谷歌化,尽量的精简 - 注意:切记需要配合脚本<AC-baidu:重定向优化百度搜狗谷歌必应搜索_favicon_双列 - inDarkness>使用
  6. // @author lrc
  7. // @match https://www.baidu.com/*
  8. // @match http://www.baidu.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. //$(".c-container").css("margin-bottom", "50px !important");
  15. //$("#container").css("height","1900px");
  16. //$(".c-container").css("cssText", "margin-top:50px !important;");
  17. // $(".c-container").css("padding-bottom", "50px");
  18. //$(this).css("background","transparent");
  19. //$(this).css("cssText","background:transparent !important");
  20.  
  21. //引入jquery库
  22. var head = document.getElementsByTagName("html")[0];
  23. var script = document.createElement("script");
  24. script.src = "https://code.jquery.com/jquery-3.4.1.min.js";
  25. head.appendChild(script);
  26.  
  27.  
  28.  
  29. var websiteURL = window.location.href;
  30.  
  31. //www.baidu.com修改
  32. if(websiteURL == 'https://www.baidu.com/' || websiteURL == 'https://www.baidu.com/') {
  33.  
  34. //去底部
  35. $("#bottom_layer").remove();
  36. $("#s_tab").remove();
  37. $("#virus-2020").remove();
  38.  
  39. $("#s_fm").css("padding-top", "100px");
  40.  
  41. //最小宽度、高度去掉
  42. $("body").css("min-width", "unset");
  43. $("#head_wrapper").css("min-height", "unset");
  44.  
  45. }
  46.  
  47. //非www.baidu.com页面 - 搜索页面美化
  48. if(websiteURL != 'https://www.baidu.com/' || websiteURL != 'https://www.baidu.com/') {
  49.  
  50. $("#wrapper_wrapper").css("background-color", "white");
  51.  
  52. //删除logo
  53. $("#s_lg_img").remove();
  54.  
  55. //TODO待做
  56. $("#content_right").remove();
  57. //$("#container").css("left","50%");
  58. //$("#container").css({"left":"50% !important","transform":"translateX(-50%) !important", "margin-left":"0px !important"})
  59.  
  60. //移除下一页
  61.  
  62. //每个li添加间隔,去掉页显示、每个li边框有阴影
  63. $(".sp-separator").remove();
  64. $(".c-container").css("box-shadow","0 0 20px 2px rgba(0,0,0,0.3)");
  65. $(".c-container").css("border-radius","20px");
  66. $(".t").css("background-color","transparent");
  67. $(document).scroll(function(){
  68. $(".sp-separator").remove();
  69. $(".c-container").css("box-shadow","0 0 20px 2px rgba(0,0,0,0.3)");
  70. $(".c-container").css("border-radius","20px");
  71. $(".t").css("background-color","transparent");
  72. var div = $("<div></div>")
  73. div.css("height", "40px");
  74. $(".c-container").filter(function(index){
  75.  
  76. console.log( $(this).next().attr("style") != "height: 40px;");
  77.  
  78. //return false;
  79. return $(this).next().attr("style") != "height: 40px;"
  80. }).after(div);
  81.  
  82.  
  83. });
  84.  
  85. setTimeout(function() {
  86. var div = $("<div></div>")
  87. div.css("height", "40px");
  88.  
  89. $(".c-container").after(div);
  90.  
  91. var div2 = $("<div></div>")
  92. div2.css("height", "30px");
  93.  
  94. $(".c-container").eq(0).before(div2);
  95. }, 0);
  96.  
  97.  
  98. //去底部元素
  99. $("#foot").remove();
  100. //页面底部有点边距
  101. $("body").css("padding-bottom", "70px");
  102.  
  103.  
  104. console.log("==============" + window.location.href );
  105.  
  106. //去logo、搜索按钮、搜索右边的高级搜索、搜索工具
  107. $("#result_logo").remove();
  108. $(".s_btn_wr").remove();
  109. $("#u").remove();
  110. $(".search_tool").remove();
  111.  
  112.  
  113. //删除搜索框推荐
  114. $("#s-hotsearch-wrapper").remove();
  115.  
  116.  
  117. // 百度首页搜索框居中
  118. var currrentURL = window.location.href;
  119. var str = /index.php/
  120.  
  121. //搜索类型居中显示
  122. $("#s_tab").css("position", "relative");
  123. $("#s_tab>.s_tab_inner").css({"position":"absolute", "left":"48%"});
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. //百度首页美化
  132. if(str.test(currrentURL) || currrentURL=="https://www.baidu.com/"){
  133. $("#head_wrapper").css({"top":"50%", "transform":"translateY(-60%)"})
  134.  
  135. $("#bottom_layer").remove();
  136.  
  137. $("#s_upfunc_menus").remove();
  138.  
  139. $(".s_bri").remove();
  140.  
  141. $("#u_sp>a").filter(function(index){
  142. if(index < 3){
  143. return true;
  144. };
  145. }).remove();
  146. $("#su").remove();
  147. }
  148.  
  149.  
  150. //搜索框样式美化
  151. $(".s_ipt_wr").css({"border-right":"1px solid #b6b6b6","border-radius":"20px","padding-left":"20px","height":"40px","line-height":"40px"});
  152.  
  153.  
  154.  
  155. $("#result_logo").css({"left":"calc(44% - 440px)", "top":"6px"});
  156.  
  157.  
  158. //替代
  159. $("html").on("focus", "#kw", function() {
  160. $(".s_ipt_wr").css("border-right-color", "#4791ff");
  161. })
  162.  
  163.  
  164.  
  165.  
  166. //替代
  167. $("html").on("blur", "#kw", function() {
  168. $(".s_ipt_wr").css("border-right-color", "#b6b6b6");
  169. })
  170.  
  171.  
  172.  
  173.  
  174. $("#head").css("background","white");
  175. $("#s_tab").css("background","white");
  176.  
  177.  
  178.  
  179.  
  180.  
  181. //替代
  182. $("html").on("mouseover", ".c-container", function() {
  183. $(this).css("box-shadow","0 0 2px grey");
  184. })
  185.  
  186.  
  187.  
  188. //替代
  189. $("html").on("mouseout", ".c-container", function() {
  190. $(".c-container").css("box-shadow","0 0 20px 2px rgba(0,0,0,0.3)");
  191. })
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. $(".nums").css("margin-bottom","30px");
  202.  
  203. $(".s_tab_inner>a").eq(4).nextAll().remove();
  204. $(".s_tab_inner>b").css("left", "calc(50% - 290px)");
  205. $(".s_tab_inner>a").css("left", "calc(50% - 290px)");
  206. $(".s_tab_inner>a").css("font-weight", "bold");
  207. $(".s_tab_inner>b").css("border-bottom", "3px solid #1A73E8");
  208. $(".s_tab_inner>a").css("color", "#5f6368");
  209.  
  210.  
  211. //替代
  212. $("html").on("mouseover", ".s_tab_inner>a", function() {
  213. $(this).css("color", "#1A73E8");
  214. })
  215.  
  216.  
  217.  
  218. //替代
  219. $("html").on("mouseout", ".s_tab_inner>a", function() {
  220. $(this).css("color", "#5f6368");
  221. })
  222.  
  223.  
  224.  
  225.  
  226. var con = document.getElementById("container");
  227. con.setAttribute('style', 'background-color:white');
  228.  
  229. //修复最新版本作者的container加了左外边距
  230. //$("#container").css("margin-left", "0px")
  231. $("#container").css({"left":"50%","transform":"translateX(-50%) ", "margin-left":"0px "})
  232.  
  233.  
  234.  
  235.  
  236.  
  237. }
  238.  
  239. // Your code here...
  240. })();

QingJ © 2025

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