百度身谷歌壳

让百度变成谷歌的外观

  1. // ==UserScript==
  2. // @name 百度身谷歌壳
  3. // @namespace https://ez118.github.io/
  4. // @version 0.1
  5. // @description 让百度变成谷歌的外观
  6. // @author ZZY_WISU
  7. // @match https://www.baidu.com/*
  8. // @match http://www.baidu.com/*
  9. // @match https://baidu.com/*
  10. // @license GNU GPLv3
  11. // @icon https://cn.bing.com/sa/simg/favicon-white-bg-gra-mg.ico
  12. // @run-at document-end
  13. // @grant GM_registerMenuCommand
  14. // @grant GM_addStyle
  15. // @grant window.onurlchange
  16. // ==/UserScript==
  17.  
  18. (function () {
  19. 'use strict';
  20.  
  21. var url = window.location.href;
  22. if (url.includes("baidu.com") && !url.includes("baidu.com/s?")) {
  23. /* 如果是百度首页 */
  24. GM_addStyle(`
  25. body { overflow-x:hidden; min-width:100px!important; }
  26. #s_main { margin-top: calc(53vh + 50px); } /* 新闻 */
  27. #s_main > .san-card[tpl='feed-ad'] { display: none; visibility: hidden; }
  28. #bottom_layer { visibility: hidden; display: none; } /* 页脚 */
  29. #s_form_wrapper { margin-top: 20vh; }
  30.  
  31. .s-top-img-wrapper { border:none!important; top:-2px!important; }
  32. .s-top-img-wrapper img { width:30px!important; height:30px!important; }
  33.  
  34. #s_top_wrap { display: none; visibility: hidden; } /* 顶栏 */
  35. .s-weather-wrapper { display: none; visibility: hidden; }
  36. #s-top-username > .user-name { display: none; }
  37. .s-top-right { padding-left:0px; }
  38. #s-top-left { right:100px; left:unset; }
  39. #s_side_wrapper { display: none; visibility: hidden; }
  40. #aging-tools-pc { display: none; visibility: hidden; }
  41. #s-top-more { padding:15px; border-radius:28px; }
  42. #s-top-more > .s-top-tomore { margin-top:18px; left:22px; }
  43. .s_ipt_wr { border-radius:28px !important; box-shadow:0px 0px 8px #3047a4 !important; }
  44. #kw { border-radius:28px !important; right:0;left:0; }
  45. #su { content:''; width:44px!important; border-radius:28px!important; margin-left:13px; box-shadow:0px 0px 10px #3047a4 !important; }
  46. #form { right:0;left:0; }
  47. .bdsug { border-radius:5px 0px 20px 20px!important; overflow:hidden; box-shadow:0px 3px 5px #3047a4 !important; }
  48. .bdsug>ul { border-radius:10px!important; }
  49. `);
  50.  
  51. setTimeout(() => {
  52. document.getElementById("su").value = " ▶";
  53. },300)
  54. } else if(url.includes("baidu.com/s?")){
  55. /* 如果是搜索详情页 */
  56. GM_addStyle(`
  57. body { overflow-x:hidden; min-width:100px!important; }
  58. #ai-talk-container { display: none; visibility: hidden; }
  59.  
  60. .s-top-img-wrapper { border:none!important; top:-2px!important; }
  61. .s-top-img-wrapper img { width:30px!important; height:30px!important; }
  62.  
  63. #s_top_wrap { display: none; visibility: hidden; } /* 顶栏 */
  64. .s-weather-wrapper { display: none; visibility: hidden; }
  65. .s-top-username { display: none; visibility: hidden; }
  66. #user { width:40px }
  67.  
  68. #s_side_wrapper { display: none; visibility: hidden; }
  69. #aging-tools-pc { display: none; visibility: hidden; }
  70.  
  71. #s_kw_wrap {box-shadow:0px 0px 8px #3047a4 !important; border-radius:28px !important;}
  72. #kw { border-radius:28px !important; right:0;left:0; }
  73. #su { width:40px!important; border-radius:28px!important; margin-left:13px; box-shadow:0px 0px 10px #3047a4 !important; }
  74. #form { right:0;left:0; }
  75. .bdsug { border-radius:5px 0px 20px 20px!important; overflow:hidden; box-shadow:0px 3px 5px #3047a4 !important; }
  76. .bdsug>ul { border-radius:10px!important; }
  77. `);
  78. setTimeout(() => {
  79. document.getElementById("su").value = " ▶";
  80. },200)
  81. }
  82. // Your code here...
  83. })();