Greasy Fork镜像 支持简体中文。

搜索页面美化

支持的搜索引擎有1.百度;2.搜狗;3.谷歌;4.必应。兼容“AC-baidu”脚本【支持自定义背景】【支持随机背景图】【支持背景图分类】【支持屏蔽广告】【支持透明度调节】

  1. /*========================================如 有 自 定 义 代 码 里 面 的 图 片 注 意 备 份 !!!========================================*/
  2.  
  3. /*========================================如 有 自 定 义 代 码 里 面 的 图 片 注 意 备 份 !!!========================================*/
  4.  
  5. /*========================================如 有 自 定 义 代 码 里 面 的 图 片 注 意 备 份 !!!========================================*/
  6.  
  7. /*========================================如 有 自 定 义 代 码 里 面 的 图 片 注 意 备 份 !!!========================================*/
  8.  
  9. // ==UserScript==
  10. // @name 搜索页面美化
  11. // @name:zh 搜索页面美化
  12. // @name:en Search page beautification
  13. // @name:ja 検索ページの美化
  14. // @description 支持的搜索引擎有1.百度;2.搜狗;3.谷歌;4.必应。兼容“AC-baidu”脚本【支持自定义背景】【支持随机背景图】【支持背景图分类】【支持屏蔽广告】【支持透明度调节】
  15. // @description:zh 支持的搜索引擎有1.百度;2.搜狗;3.谷歌;4.必应。兼容“AC-baidu”脚本【支持自定义背景】【支持随机背景图】【支持背景图分类】【支持屏蔽广告】【支持透明度调节】
  16. // @description:en Supported search engines are 1. Baidu; 2. Sogou; 3. Google; 4. Bing. Compatible with "AC-baidu" script[Support custom background] [Support random background image] [Support background image classification] [Support shielding ads] [Support transparency adjustment]
  17. // @description:ja サポートされている検索エンジンは、1。Baidu、2。Sogou、3。Google、4。Bingです。 「AC-baidu」スクリプトと互換性があります[カスタム背景のサポート] [ランダムな背景画像のサポート] [背景画像の分類のサポート] [シールド広告のサポート] [透明度の調整のサポート]
  18. // @icon https://upyun.calendarli.com/logo.png
  19. // @author 只为你收集世间云朵
  20. // @license MIT License
  21. // @version 4.1.3
  22. // @namespace https://www.calendarli.com
  23. // @match *://www.google.com/search?*
  24. // @match *://www.google.com.hk/search?*
  25. // @match *://cn.bing.com/search?*
  26. // @match *://www.bing.com/search?*
  27. // @match *://www.baidu.com/s?*
  28. // @match *://www.baidu.com/baidu?*
  29. // @match *://www.sogou.com/web?*
  30. // @grant GM_log
  31. // @connect google.com
  32. // @connect baidu.com
  33. // @connect sogou.com
  34. // @connect bing.com
  35. // @require http://cdn.staticfile.org/jquery/2.0.0/jquery.min.js
  36. // @require https://gf.qytechs.cn/scripts/422038-%E5%8F%96%E8%89%B2%E5%99%A8js%E8%84%9A%E6%9C%AC/code/%E5%8F%96%E8%89%B2%E5%99%A8JS%E8%84%9A%E6%9C%AC.js?version=902518
  37. // @copyright 该脚本完全由 只为你收集世间云朵@greasyfork 原创,谢绝抄袭部分或全部代码!如有借鉴代码,请声明并标注脚本链接。
  38. // @copyright:en This script is completely original by 你收集世间云朵@greasyfork, please do not copy part or all of the code! If you have reference code, please declare and mark the script link.
  39. // @copyright:ja このスクリプトは你收集世间云朵@ greasyforkによって完全にオリジナルです。コードの一部または全部をコピーしないでください。 参照コードがある場合は、スクリプトリンクを宣言してマークを付けてください。
  40. // ==/UserScript==
  41.  
  42.  
  43. (function() {
  44.  
  45. setTimeout(function() {
  46. $('html').append($('<style>').append("@media only screen and (min-width: 321px) and (max-width: 1300px){div#rcnt>div:nth-child(2) {display: none;}}div#center_col {margin-left: 132px;}body.b_lbShow #b_header{position: relative;z-index: 9999;} /*Main container*/ #wrapper #content_left .result[tpl='soft'] .op-soft-title, #wrapper #content_left .result h3, #wrapper #content_left .c-container h3{ background-color: #ffffffa8;}#wrapper #rs, #wrapper #content_left .result, #wrapper #content_left .c-container,#rso .g{background: rgba(243 243 243 / " + getVariable('ListTransparencyNumberValue') + ");backdrop-filter: blur(2px);padding: 10px 20px;border-radius: 6px;}div.colpick_dark{z-index: 99;}#b_results>.b_algo{margin-top: 10px;}.search_tool_conter.new_search_tool_conter span,div#b_tween span,.b_underSearchbox span{color: #e9a2b0;}.s_tab_inner {margin-top: 10px;background: #ffffffa8;width: 591px;padding: 0 5px;margin-left: -10px;}.container_s>div#content_right{position: relative;right: -72px;}.colpick { position: absolute; width: 346px; height: 170px; overflow: hidden; display: none; font-family: Arial, Helvetica, sans-serif; background:#ebebeb; border: 1px solid #bbb; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; /*Prevents selecting text when dragging the selectors*/ -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; } .colpick, .colpick * { -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; } /*Color selection box*/ .colpick_color { position: absolute; left: 7px; top: 7px; width: 156px; height: 156px; overflow: hidden; outline: 1px solid #aaa; cursor: crosshair; } .colpick_color_overlay1 { position: absolute; left:0; top:0; width: 156px; height: 156px; filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff'); /* IE6 & IE7 */ -ms-filter: 'progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')'; /* IE8 */ background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0)); } .colpick_color_overlay2 { position: absolute; left:0; top:0; width: 156px; height: 156px; filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000'); /* IE6 & IE7 */ -ms-filter: 'progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')'; /* IE8 */ background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1)); } /*HSL gradients are different*/ .colpick_hsl .colpick_color_overlay1 { background: linear-gradient(to right, rgba(128,128,128,1) 0%, rgba(128,128,128,0) 100%); } .colpick_hsl .colpick_color_overlay2 { background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0) 50%, rgba(0,0,0,1) 100%); } /*Circular color selector*/ .colpick_selector_outer { background:none; position: absolute; width: 11px; height: 11px; margin: -6px 0 0 -6px; border: 1px solid black; border-radius: 50%; } .colpick_selector_inner{ position: absolute; width: 9px; height: 9px; border: 1px solid white; border-radius: 50%; } /*Vertical hue bar*/ .colpick_hue { position: absolute; top: 6px; left: 175px; width: 19px; height: 156px; border: 1px solid #aaa; cursor: n-resize; } /*Hue bar sliding indicator*/ .colpick_hue_arrs { position: absolute; left: -8px; width: 35px; height: 7px; margin: -7px 0 0 0; } .colpick_hue_larr { position:absolute; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 7px solid #858585; } .colpick_hue_rarr { position:absolute; right:0; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-right: 7px solid #858585; } /*New color box*/ .colpick_new_color { position: absolute; left: 207px; top: 6px; width: 60px; height: 27px; background: #f00; border: 1px solid #8f8f8f; } /*Current color box*/ .colpick_current_color { position: absolute; left: 277px; top: 6px; width: 60px; height: 27px; background: #f00; border: 1px solid #8f8f8f; } /*Input field containers*/ .colpick_field, .colpick_hex_field { position: absolute; height: 20px; width: 60px; overflow:hidden; background:#f3f3f3; color:#b8b8b8; font-size:12px; border:1px solid #bdbdbd; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .colpick_rgb_r { top: 40px; left: 207px; } .colpick_rgb_g { top: 67px; left: 207px; } .colpick_rgb_b { top: 94px; left: 207px; } .colpick_hsx_h { top: 40px; left: 277px; } .colpick_hsx_s { top: 67px; left: 277px; } .colpick_hsx_x { top: 94px; left: 277px; } .colpick_hex_field { width: 68px; left: 207px; top: 121px; } /*Text field container on focus*/ .colpick_focus { border-color: #999; } /*Field label container*/ .colpick_field_letter { position: absolute; width: 12px; height: 20px; line-height: 20px; padding-left: 4px; background: #efefef; border-right: 1px solid #bdbdbd; font-weight: bold; color:#777; } /*Text inputs*/ .colpick_field input, .colpick_hex_field input { position: absolute; right: 11px; margin: 0; padding: 0; height: 20px; line-height: 20px; background: transparent; border: none; font-size: 12px; font-family: Arial, Helvetica, sans-serif; color: #555; text-align: right; outline: none; } .colpick_hex_field input { right: 4px; } /*Field up/down arrows*/ .colpick_field_arrs { position: absolute; top: 0; right: 0; width: 9px; height: 21px; cursor: n-resize; } .colpick_field_uarr { position: absolute; top: 5px; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 4px solid #959595; } .colpick_field_darr { position: absolute; bottom:5px; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid #959595; } /*Submit/Select button*/ .colpick_submit { position: absolute; left: 207px; top: 149px; width: 130px; height: 22px; line-height:22px; background: #efefef; text-align: center; color: #555; font-size: 12px; font-weight:bold; border: 1px solid #bdbdbd; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .colpick_submit:hover { background:#f3f3f3; border-color:#999; cursor: pointer; } /*full layout with no submit button*/ .colpick_full_ns .colpick_submit, .colpick_full_ns .colpick_current_color{ display:none; } .colpick_full_ns .colpick_new_color { width: 130px; height: 25px; } .colpick_full_ns .colpick_rgb_r, .colpick_full_ns .colpick_hsx_h { top: 42px; } .colpick_full_ns .colpick_rgb_g, .colpick_full_ns .colpick_hsx_s { top: 73px; } .colpick_full_ns .colpick_rgb_b, .colpick_full_ns .colpick_hsx_x { top: 104px; } .colpick_full_ns .colpick_hex_field { top: 135px; } /*rgbhex layout*/ .colpick_rgbhex .colpick_hsx_h, .colpick_rgbhex .colpick_hsx_s, .colpick_rgbhex .colpick_hsx_x { display:none; } .colpick_rgbhex { width:282px; } .colpick_rgbhex .colpick_field, .colpick_rgbhex .colpick_submit { width:68px; } .colpick_rgbhex .colpick_new_color { width:34px; border-right:none; } .colpick_rgbhex .colpick_current_color { width:34px; left:240px; border-left:none; } /*rgbhex layout, no submit button*/ .colpick_rgbhex_ns .colpick_submit, .colpick_rgbhex_ns .colpick_current_color{ display:none; } .colpick_rgbhex_ns .colpick_new_color{ width:68px; border: 1px solid #8f8f8f; } .colpick_rgbhex_ns .colpick_rgb_r { top: 42px; } .colpick_rgbhex_ns .colpick_rgb_g { top: 73px; } .colpick_rgbhex_ns .colpick_rgb_b { top: 104px; } .colpick_rgbhex_ns .colpick_hex_field { top: 135px; } /*hex layout*/ .colpick_hex .colpick_hsx_h, .colpick_hex .colpick_hsx_s, .colpick_hex .colpick_hsx_x, .colpick_hex .colpick_rgb_r, .colpick_hex .colpick_rgb_g, .colpick_hex .colpick_rgb_b { display:none; } .colpick_hex { width:206px; height:201px; } .colpick_hex .colpick_hex_field { width:72px; height:25px; top:168px; left:80px; } .colpick_hex .colpick_hex_field div, .colpick_hex .colpick_hex_field input { height: 25px; line-height: 25px; } .colpick_hex .colpick_new_color { left:9px; top:168px; width:30px; border-right:none; } .colpick_hex .colpick_current_color { left:39px; top:168px; width:30px; border-left:none; } .colpick_hex .colpick_submit { left:164px; top: 168px; width:30px; height:25px; line-height: 25px; } /*hex layout, no submit button*/ .colpick_hex_ns .colpick_submit, .colpick_hex_ns .colpick_current_color { display:none; } .colpick_hex_ns .colpick_hex_field { width:80px; } .colpick_hex_ns .colpick_new_color{ width:60px; border: 1px solid #8f8f8f; } /*Dark color scheme*/ .colpick_dark { background: #161616; border-color: #2a2a2a; } .colpick_dark .colpick_color { outline-color: #333; } .colpick_dark .colpick_hue { border-color: #555; } .colpick_dark .colpick_field, .colpick_dark .colpick_hex_field { background: #101010; border-color: #2d2d2d; } .colpick_dark .colpick_field_letter { background: #131313; border-color: #2d2d2d; color: #696969; } .colpick_dark .colpick_field input, .colpick_dark .colpick_hex_field input { color: #7a7a7a; } .colpick_dark .colpick_field_uarr { border-bottom-color:#696969; } .colpick_dark .colpick_field_darr { border-top-color:#696969; } .colpick_dark .colpick_focus { border-color:#444; } .colpick_dark .colpick_submit { background: #131313; border-color:#2d2d2d; color:#7a7a7a; } .colpick_dark .colpick_submit:hover { background-color:#101010; border-color:#444; }"))
  47. }, 1000)
  48.  
  49. /**
  50. * 图片数据
  51. */
  52. var GroupList = {
  53. Anime: {
  54. Name: "动漫",
  55. ImgList: [
  56. "https://upyun.calendarli.com/Anime/063f89738882f07b08aaebaeaff23510.jpg",
  57. "https://upyun.calendarli.com/Anime/1fa0ed09fe6ef8a09b114ba40b8c22f3.jpg",
  58. "https://upyun.calendarli.com/Anime/5bc35d75b52b852d12544b7d8c1b88c6.jpg",
  59. "https://upyun.calendarli.com/Anime/11fed6086ab5ee4cd24989a2a816db77.jpg"
  60. ]
  61. },
  62. landscape: {
  63. Name: "自然风景",
  64. ImgList: [
  65. "https://upyun.calendarli.com/Landscape/150909a21756042f3a38e0db3d47c2c5.jpg",
  66. "https://upyun.calendarli.com/Landscape/4940e494d71f9400a85f63288cefe8de.jpeg",
  67. "https://upyun.calendarli.com/Landscape/d5603970a58c68cb2e758f8e4924487a.jpeg",
  68. "https://upyun.calendarli.com/Landscape/db27f9d0e53d7571926c05faf63ce9a0.jpg"
  69. ]
  70. }
  71. };
  72. /**
  73. * localStorage数据储存的封装
  74. */
  75. // eslint-disable-next-line camelcase
  76. var CL_LocalStorage = ((function() {
  77. var currentLocalKey = "__CLKZB__STORAGE__KEY__";
  78. var currentLocal = localStorage.getItem(currentLocalKey);
  79. var currentLocalObject;
  80. if (currentLocal === null) {
  81. currentLocalObject = {};
  82. } else {
  83. currentLocalObject = JSON.parse(currentLocal);
  84. }
  85. return {
  86. getRawObj: function() {
  87. return currentLocalObject;
  88. },
  89. /**
  90. * 获取元素
  91. * @param key 要获取的值的key
  92. * @param defaultValue 若不存在相应的key,则应该返回的默认值,默认为undefined
  93. */
  94. getItem: function(key, defaultValue) {
  95. if (defaultValue === void 0) { defaultValue = undefined; }
  96. var value = currentLocalObject[key];
  97. if (value) {
  98. return value;
  99. } else {
  100. return defaultValue;
  101. }
  102. },
  103. /**
  104. * 设置元素
  105. * @param key 要设置的key
  106. * @param value 要设置的值内容
  107. */
  108. setItem: function(key, value) {
  109. currentLocalObject[key] = value;
  110. },
  111. /**
  112. * 保存数据到localStorage
  113. */
  114. save: function() {
  115. localStorage.setItem(currentLocalKey, JSON.stringify(currentLocalObject));
  116. },
  117. /**
  118. * 移除元素
  119. * @param key 要移除的key
  120. */
  121. removeItem: function(key) {
  122. delete currentLocalObject[key];
  123. },
  124. /**
  125. * 清空元素
  126. */
  127. clear: function() {
  128. currentLocalObject = {};
  129. }
  130. };
  131. })());
  132.  
  133. var getVariable = (function(name) {
  134. /* 获取localStorage数据*/
  135. window.BackgroundTransparencyNumberValue = CL_LocalStorage.getItem('BackgroundTransparencyNumberValue', '0.4') //背景透明
  136. window.ListTransparencyNumberValue = CL_LocalStorage.getItem('ListTransparencyNumberValue', '0.6') //列表透明
  137. window.PureColorBackgroundChecked = CL_LocalStorage.getItem('PureColorBackgroundChecked', false) //自定义纯色背景
  138. window.CustomizeUrlValueChecked = CL_LocalStorage.getItem('CustomizeUrlValueChecked', '') //自定义URL值
  139. window.CustomizeURLChecked = CL_LocalStorage.getItem('CustomizeURLChecked', false) //自定义URL
  140. window.CustomBackgroundCode = CL_LocalStorage.getItem('CustomBackgroundCode', '#FFF') //纯色背景代码
  141. window.RandomPicturesChecked = CL_LocalStorage.getItem('RandomPicturesChecked', false) //随机图片
  142. window.picGroupSelectValue = CL_LocalStorage.getItem('picGroupSelectValue', 'Anime') //分组
  143. window.advertisingChecked = CL_LocalStorage.getItem('advertisingChecked', false) //清除广告
  144. window.SideColumnChecked = CL_LocalStorage.getItem('SideColumnChecked', false) //删除侧栏
  145. window.PictureURLIndex = CL_LocalStorage.getItem('PictureURLIndex', '0') //图片当前索引
  146. window.len = GroupList[picGroupSelectValue].ImgList.length - 1 //图片索引数量
  147. n = window[name]
  148. return n
  149. })
  150.  
  151. /* 获取localStorage数据 */
  152. // var CustomBackgroundCode = CL_LocalStorage.getItem("CustomBackgroundCode", "#FFF"); // 纯色背景代码
  153. /* 输出localStorage数据到控制台 */
  154. console.log(CL_LocalStorage.getRawObj());
  155.  
  156. /**
  157. * CSS数据
  158. */
  159. var cssContent = {
  160. 'body': {
  161. "background-position-x": "center",
  162. "background-attachment": "fixed",
  163. "background-size": "cover",
  164. 'z-index': '-1000',
  165. 'position': 'relative'
  166. },
  167. "div#CL_Console": {
  168. "-moz-user-select": "none",
  169. "-webkit-user-select": "none",
  170. "-ms-user-select": "none",
  171. "-khtml-user-select": "none",
  172. "user-select": "none",
  173. 'position': "fixed",
  174. 'top': "35%",
  175. 'left': "1",
  176. 'z-index': '99'
  177. },
  178. "img#CL_img": {
  179. 'width': "35px",
  180. "border-radius": "20px",
  181. 'cursor': "pointer"
  182. },
  183. ".none": {
  184. 'display': "none"
  185. },
  186. ".block": {
  187. 'display': "block"
  188. },
  189. "div#CL_OperationPanel": {
  190. 'width': "300px",
  191. 'height': "300px",
  192. 'background': "rgb(232 240 255 / 70%)",
  193. 'backdrop-filter': 'blur(3px)',
  194. 'position': "absolute",
  195. 'top': "20px",
  196. 'left': "35px",
  197. "box-shadow": "1px 1px 4px 0px #747698",
  198. "border-radius": "6px",
  199. 'padding': "10px"
  200. },
  201. "div#CL_OperationPanel>div": {
  202. 'height': "30px",
  203. "line-height": "30px",
  204. "margin-top": "10px"
  205. },
  206. ".Button": {
  207. 'width': "49%",
  208. 'display': "inline-block",
  209. "text-align": "center",
  210. 'background': "#fbfbfb",
  211. "box-shadow": "1px 1px 3px 0px #5e8796",
  212. "border-radius": "7px",
  213. 'cursor': "pointer",
  214. 'background': 'rgba(240, 248, 255, 0)'
  215. },
  216. ".functional>p": {
  217. 'margin': "0px",
  218. 'display': "inline-block",
  219. 'width': "31%"
  220. },
  221. ".color-box": {
  222. 'float': "left",
  223. 'width': "30px",
  224. 'height': "20px",
  225. 'margin': "5px",
  226. 'border': "1px solid white",
  227. 'cursor': "pointer"
  228. },
  229. "p.RandomPictures": {
  230. 'float': "left",
  231. 'margin': "0"
  232. },
  233. "span#save,span#Reset": {
  234. 'margin': "auto",
  235. 'display': "inline-block",
  236. 'width': "50px",
  237. "margin-left": "10px"
  238. },
  239. ".OperationButton": {
  240. 'position': "absolute",
  241. 'left': "50%",
  242. "margin-left": "-66px",
  243. 'bottom': "10px"
  244. },
  245. "#panelDOM select": {
  246. "border-color": "#7b7b7b"
  247. },
  248. ".checkboxWrap": {
  249. 'cursor': "pointer"
  250. },
  251. '.wrapper_new #foot': {
  252. 'background-color': '#f5f5f6a8'
  253. },
  254. "div#s_tab": {
  255. 'background': '#f8f8f8'
  256. },
  257. '.s_tab_inner': {
  258. 'background': 'none'
  259. },
  260. 'div#fbar,.appbar,.yg51vc,#hdtb': {
  261. 'background': '#f2f2f29e'
  262. },
  263. '.MXl0lf.mtqGb,div#pagebar_container': {
  264. 'background': '#ffffffc9',
  265. 'margin-top': '19px'
  266. },
  267. 'div#b_content': {
  268. 'padding-left': '140px'
  269. },
  270. 'p.Customize.checkboxWrap': {
  271. 'float': 'left',
  272. 'margin': '0px',
  273. 'cursor': 'pointer'
  274. },
  275. 'div#CL_OperationPanel input[type="text"]': {
  276. 'width': '190px',
  277. 'margin-top': '4.3px',
  278. 'height': '20px'
  279. },
  280. 'span#help':{
  281. 'background':'none'
  282. }
  283.  
  284. };
  285.  
  286. /**
  287. * 加载控制面板
  288. */
  289. $('body').append(
  290. $('<div id="CL_Console">').append(
  291. $('<img id="CL_img" src="https://upyun.calendarli.com/logo.png" title="MOD控制台"/>')
  292. ).append(
  293. $('<div id="CL_OperationPanel" class="none">').append(
  294. $('<div class="ChangePicture">').append('<span id="before" class="Button">上一张</span><span id="Rear" class="Button">下一张</span>')
  295. ).append(
  296. $('<div class="DropDownGroup">').append($('<span>切换分组:')).append($('<select class="select" name="picGroup" id="pic-group-selector">'))
  297. ).append(
  298. $('<div class="CustomizeURL">').append('<div><p class="Customize checkboxWrap" title="可填写图床URL"><input type="checkbox" name="CustomizeURL" value="自定义URL" default="false">自定义URL</p><input type="text" name="CustomizeUrlValue"></div>')
  299. ).append(
  300. $('<div class="transparency">').append(
  301. $('<span>').append('背景透明度:')
  302. ).append('<select class="BackgroundSelector" name="BackgroundTransparency" cl-select-number defaultValue="0.4" maxValue="1" minValue="0" stepValue="0.1"></select>').append(
  303. $('<span>').append('列表透明度:')
  304. ).append('<select class="ListSelector" name="ListTransparency" cl-select-number defaultValue="0.4" maxValue="1" minValue="0" stepValue="0.1"></select>')
  305. ).append(
  306. $('<div class="functional">').append('<p class="advertising checkboxWrap"><input type="checkbox" name="advertising" default="false" value="清除广告"/>清除广告</p><p class="SideColumn checkboxWrap"><input type="checkbox" name="SideColumn" default="false" value="删除侧栏"/>删除侧栏</p><p class="RandomPictures checkboxWrap"><input type="checkbox" name="RandomPictures" default="false" value="随机图片" title="启用后将禁用手动切换"/>随机图片</p>')
  307. ).append(
  308. $('<div class="PureColorBackground">').append(
  309. $('<p class="RandomPictures checkboxWrap">').append('<input type="checkbox" name="PureColorBackground" value="纯色背景" default="false" title="启用后背景透明度将不可用"/>纯色背景')
  310. ).append('<div class="color-box"></div>')
  311. ).append(
  312. $('<div class="OperationButton">').append('<span id="save" class="Button">保存</span><span id="Reset" class="Button">重置</span>')
  313. )
  314. )
  315. )
  316. $('#CL_OperationPanel input[name=CustomizeUrlValue]').val(getVariable('CustomizeUrlValueChecked'))
  317. $('#CL_Console').siblings().on('click',()=>{
  318. $('#CL_OperationPanel').hide(200)
  319. })
  320.  
  321. /**
  322. * 启用调色器
  323. */
  324. // @ts-ignore
  325. /*$(".color-box").colpick({
  326. colorScheme: "dark",
  327. layout: "rgbhex",
  328. color: "fff",
  329. onSubmit: function(hsb, hex, rgb, el) {
  330. $(el).css("background-color", "#" + hex);
  331. // @ts-ignore
  332. $(el).colpickHide();
  333. }
  334. });*/
  335.  
  336. /**
  337. * 加载自定义的背景色
  338. */
  339. $(".color-box").css("background-color", getVariable('CustomBackgroundCode')); // 纯色背景代码
  340. /**
  341. * 把固定CSS数据绑定到相应的元素上
  342. */
  343. for (var selector in cssContent) {
  344. $(selector).css(cssContent[selector]);
  345. }
  346.  
  347. /**
  348. * 加载分组选项
  349. */
  350. for (var group in GroupList) {
  351. $("#pic-group-selector").append("<option value=\"" + group + "\">" + GroupList[group].Name + "</option>");
  352. }
  353. /**
  354. * 加载checkbox的选中
  355. */
  356. $.each($("#CL_OperationPanel input[type=checkbox]"), function(_, item) {
  357. var jqDOM = $(item);
  358. var key = jqDOM.attr("name") + "Checked";
  359. var defaultValue = JSON.parse(jqDOM.attr("default"));
  360. jqDOM.prop("checked", CL_LocalStorage.getItem(key, defaultValue));
  361. });
  362. /**
  363. * 加载number下拉选项的选项内容
  364. */
  365. $.each($("select[cl-select-number]"), function(_, item) {
  366. var jqDOM = $(item);
  367. var key = jqDOM.attr("name") + "NumberValue";
  368. var defaultValue = parseFloat(JSON.parse(jqDOM.attr("defaultValue")));
  369. var minValue = parseFloat(jqDOM.attr("minValue"));
  370. var maxValue = parseFloat(jqDOM.attr("maxValue"));
  371. var stepValue = parseFloat(jqDOM.attr("stepValue"));
  372. var targetValue = CL_LocalStorage.getItem(key, defaultValue);
  373. for (var i = minValue; i <= maxValue; i = parseFloat((i + stepValue).toPrecision(12))) {
  374. if (Math.abs(targetValue - i) < 0.0001) {
  375. jqDOM.append("<option value=\"" + i + "\" selected>" + i + "</option>");
  376. } else {
  377. jqDOM.append("<option value=\"" + i + "\">" + i + "</option>");
  378. }
  379. }
  380. });
  381.  
  382. (function() {
  383. var key = $("#pic-group-selector").attr("name") + "SelectValue";
  384. var targetValue = CL_LocalStorage.getItem(key);
  385. if (targetValue) {
  386. $("#pic-group-selector").val(targetValue);
  387. }
  388. })();
  389.  
  390. $('body').prepend($('<div class="Masklayer" style="background: #fff;width: 10090px;height: 10080px;z-index: -999;position: fixed;top: 0px;left: 0px; opacity:0.4;">'))
  391. var Output = function() {
  392.  
  393. var obj = new Image();
  394. /**
  395. * 输出背景
  396. */
  397. if (getVariable('CustomizeURLChecked') == true) {
  398. obj.src = getVariable('CustomizeUrlValueChecked')
  399. } else {
  400. if (getVariable('RandomPicturesChecked') == true) {
  401. obj.src = GroupList[getVariable('picGroupSelectValue')].ImgList[parseInt(Math.random() * getVariable('len') + 1)]
  402. } else {
  403. obj.src = GroupList[getVariable('picGroupSelectValue')].ImgList[getVariable('PictureURLIndex')];
  404. }
  405. }
  406. /**
  407. * 输出纯色背景
  408. */
  409. if (getVariable('PureColorBackgroundChecked') == true) {
  410. $('body')[0].style.backgroundColor = getVariable('CustomBackgroundCode')
  411. $('body')[0].style.backgroundImage = ''
  412. } else {
  413. obj.onload = function() {
  414. $('body')[0].style.backgroundImage = 'url(' + this.src + ')'
  415. $('body')[0].style.backgroundColor = ''
  416. console.log(getVariable('PictureURLIndex') + '/' + getVariable('len'))
  417. }
  418. }
  419. /**
  420. * 清除侧栏
  421. */
  422. if (getVariable('SideColumnChecked') == true) {
  423. $('div#content_right,div#rhs[jscontroller],aside[aria-label],div#right[class="right"],div#rcnt>div:nth-child(2)').hide()
  424. } else {
  425. $('div#content_right,div#rhs[jscontroller],aside[aria-label],div#right[class="right"],div#rcnt>div:nth-child(2)').show()
  426. }
  427. /**div#rhs
  428. * 清除广告
  429. */
  430. if (getVariable('advertisingChecked') == true) {
  431. setInterval(function() { $('.new-pmd.c-container[data-ecimtimesign],div[class="result c-container"],#bottomads,div#center_col>#taw').hide() }, 1000)
  432. } else {
  433. $('.new-pmd.c-container[data-ecimtimesign]').show()
  434. }
  435.  
  436. /**
  437. * 设置背景透明
  438. */
  439. $('.Masklayer')[0].style.opacity = getVariable('BackgroundTransparencyNumberValue')
  440.  
  441. /**
  442. * 设置列表透明
  443. */
  444. $('div[class ^= result],div[data-ecimtimesign],div#rhs[jscontroller],.kp-blk.knowledge-panel.Wnoohf.OJXvsb,div.hlcw0c>.g,.ccBEnf,.MGqjK,ol#b_results li[class],#b_context li,header#b_header,#wrapper div#right,#taw,#bottomads>div').attr({ style: 'background: rgba(243 243 243 / ' + getVariable('ListTransparencyNumberValue') + ');backdrop-filter: blur(2px);padding: 10px 20px;border-radius: 6px;' })
  445.  
  446. }
  447.  
  448. /**适应搜索动态刷新列表 */
  449. $(document).on('change', '#b_context li', Output())
  450.  
  451. /**
  452. * 默认调整样式
  453. */
  454. $('div#rs,span.fk,#bres,#b_results>.b_ans,div#promotion_adv_container,.hintBox,#leftbottomleadContainer').hide()
  455. $('h3[class="t"],h3[class="LC20lb DKV0Md"]').after('<hr/>')
  456. $('#page a,.page-inner strong').attr({ style: 'height: 36px; background: #ffffffb8;' })
  457. $('.result-molecule.new-pmd[tpl="app/page"]').css('height','73px')
  458. $('div#page').css({'background':'none','margin':'0'})
  459. setTimeout(function(){
  460. $('.result-molecule.new-pmd[tpl="app/rs"]').css('width','58%')
  461. },500)
  462.  
  463. Output()
  464.  
  465. /**
  466. * 操作板的显示/隐藏
  467. */
  468. $(document).on("click", "#CL_img", function() {
  469. $("#CL_OperationPanel").toggle(200);
  470. });
  471. /**
  472. * 自定义按钮的按下动态特效
  473. */
  474. $(document).on("mousedown", ".Button", function() {
  475. $(this).css("box-shadow", "1px 1px 1px 0px #5e8796");
  476. });
  477. /**
  478. * 自定义按钮的松开动态特效
  479. */
  480. $(document).on("mouseup", ".Button", function() {
  481. $(this).css("box-shadow", "1px 1px 3px 0px #5e8796");
  482. });
  483. /**
  484. * 背景前后切换
  485. */
  486. $(document).on('click', '#before', function() {
  487. var xn = getVariable('PictureURLIndex') ? Number(getVariable('PictureURLIndex')) - 1 : getVariable('len');
  488. xn = xn < '0' ? getVariable('len') : xn
  489. CL_LocalStorage.setItem("PictureURLIndex", String(xn))
  490. CL_LocalStorage.save()
  491. // window.location.reload();
  492. Output()
  493. })
  494. $(document).on('click', '#Rear', function() {
  495. var xn = getVariable('PictureURLIndex') ? Number(getVariable('PictureURLIndex')) + 1 : 1;
  496. console.log(picGroupSelectValue + ':' + xn + '/' + getVariable('len'))
  497. xn = xn > getVariable('len') ? '0' : xn
  498. CL_LocalStorage.setItem("PictureURLIndex", String(xn))
  499. CL_LocalStorage.save()
  500. // window.location.reload();
  501. Output()
  502. })
  503.  
  504. /**
  505. * 重置
  506. */
  507. $(document).on("click", "#Reset", function() {
  508. CL_LocalStorage.clear();
  509. CL_LocalStorage.save()
  510. window.location.reload();
  511. });
  512. /**
  513. * 保存
  514. */
  515. $(document).on("click", "#save", function() {
  516. /**
  517. * 保存数字选项的值
  518. */
  519. $.each($("select[cl-select-number]"), function(_, item) {
  520. var jqDOM = $(item);
  521. var key = jqDOM.attr("name") + "NumberValue";
  522. var value = jqDOM.val();
  523. CL_LocalStorage.setItem(key, value);
  524. });
  525. /**
  526. * 保存picGroup的值
  527. */
  528. (function() {
  529. var key = $("#pic-group-selector").attr("name") + "SelectValue";
  530. var value = $("#pic-group-selector").val();
  531. CL_LocalStorage.setItem(key, value);
  532. })();
  533. /**
  534. * 保存Checkbox的值
  535. */
  536. $.each($("#CL_OperationPanel input[type=checkbox]"), function(_, item) {
  537. var jqDOM = $(item);
  538. var key = jqDOM.attr("name") + "Checked";
  539. var value = jqDOM.prop("checked");
  540. CL_LocalStorage.setItem(key, value);
  541. });
  542. /**
  543. * 保存text的值
  544. */
  545. $.each($("#CL_OperationPanel input[type=text]"), function(_, item) {
  546. var jqDOM = $(item);
  547. var key = jqDOM[0].name + "Checked";
  548. var value = jqDOM.val();
  549. CL_LocalStorage.setItem(key, value);
  550. })
  551. /**
  552. * 保存自定义颜色代码
  553. */
  554. CL_LocalStorage.setItem("CustomBackgroundCode", $(".color-box")[0].style.backgroundColor);
  555. /**
  556. * 保存默认图片索引
  557. */
  558. var PX = CL_LocalStorage.getItem("PictureURLIndex") ? function() {} : function() { CL_LocalStorage.setItem("PictureURLIndex", '0') }
  559. PX();
  560. CL_LocalStorage.save();
  561. // window.location.reload();
  562. Output()
  563. });
  564. /**
  565. * 点击checkbox的外部,也相当于点击了checkbox内部
  566. */
  567. $(document).on("click", ".checkboxWrap", function(event) {
  568. $.each($(event.target).children("input[type=checkbox]"), function(_, item) {
  569. $(item).prop("checked", !$(item).prop("checked"));
  570. });
  571. });
  572. })();

QingJ © 2025

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