搜索页面美化-自用

支持的搜索引擎有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 只为你收集世间云朵(原作者,修改wwdboy)
  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. // @copyright 该脚本完全由 只为你收集世间云朵@greasyfork 原创,谢绝抄袭部分或全部代码!如有借鉴代码,请声明并标注脚本链接。
  37. // @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.
  38. // @copyright:ja このスクリプトは你收集世间云朵@ greasyforkによって完全にオリジナルです。コードの一部または全部をコピーしないでください。 参照コードがある场合は、スクリプトリンクを宣言してマークを付けてください。
  39. // ==/UserScript==
  40.  
  41.  
  42. (function() {
  43.  
  44. setTimeout(function() {
  45. $('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; }"))
  46. }, 1000)
  47.  
  48. /**
  49. * 图片数据
  50. */
  51. var GroupList = {
  52. Anime: {
  53. Name: "动漫",
  54. ImgList: [
  55. "https://upyun.calendarli.com/Anime/063f89738882f07b08aaebaeaff23510.jpg",
  56. "https://upyun.calendarli.com/Anime/1fa0ed09fe6ef8a09b114ba40b8c22f3.jpg",
  57. "https://upyun.calendarli.com/Anime/5bc35d75b52b852d12544b7d8c1b88c6.jpg",
  58. "https://upyun.calendarli.com/Anime/11fed6086ab5ee4cd24989a2a816db77.jpg"
  59. ]
  60. },
  61. landscape: {
  62. Name: "自然风景",
  63. ImgList: [
  64. "https://upyun.calendarli.com/Landscape/150909a21756042f3a38e0db3d47c2c5.jpg",
  65. "https://upyun.calendarli.com/Landscape/4940e494d71f9400a85f63288cefe8de.jpeg",
  66. "https://upyun.calendarli.com/Landscape/d5603970a58c68cb2e758f8e4924487a.jpeg",
  67. "https://upyun.calendarli.com/Landscape/db27f9d0e53d7571926c05faf63ce9a0.jpg"
  68. ]
  69. }
  70. };
  71. /**
  72. * localStorage数据储存的封装
  73. */
  74. // eslint-disable-next-line camelcase
  75. var CL_LocalStorage = ((function() {
  76. var currentLocalKey = "__CLKZB__STORAGE__KEY__";
  77. var currentLocal = localStorage.getItem(currentLocalKey);
  78. var currentLocalObject;
  79. if (currentLocal === null) {
  80. currentLocalObject = {};
  81. } else {
  82. currentLocalObject = JSON.parse(currentLocal);
  83. }
  84. return {
  85. getRawObj: function() {
  86. return currentLocalObject;
  87. },
  88. /**
  89. * 获取元素
  90. * @param key 要获取的值的key
  91. * @param defaultValue 若不存在相应的key,则应该返回的默认值,默认为undefined
  92. */
  93. getItem: function(key, defaultValue) {
  94. if (defaultValue === void 0) { defaultValue = undefined; }
  95. var value = currentLocalObject[key];
  96. if (value) {
  97. return value;
  98. } else {
  99. return defaultValue;
  100. }
  101. },
  102. /**
  103. * 设置元素
  104. * @param key 要设置的key
  105. * @param value 要设置的值内容
  106. */
  107. setItem: function(key, value) {
  108. currentLocalObject[key] = value;
  109. },
  110. /**
  111. * 保存数据到localStorage
  112. */
  113. save: function() {
  114. localStorage.setItem(currentLocalKey, JSON.stringify(currentLocalObject));
  115. },
  116. /**
  117. * 移除元素
  118. * @param key 要移除的key
  119. */
  120. removeItem: function(key) {
  121. delete currentLocalObject[key];
  122. },
  123. /**
  124. * 清空元素
  125. */
  126. clear: function() {
  127. currentLocalObject = {};
  128. }
  129. };
  130. })());
  131.  
  132. var getVariable = (function(name) {
  133. /* 获取localStorage数据*/
  134. window.BackgroundTransparencyNumberValue = CL_LocalStorage.getItem('BackgroundTransparencyNumberValue', '0') //背景透明
  135. window.ListTransparencyNumberValue = CL_LocalStorage.getItem('ListTransparencyNumberValue', '0') //列表透明
  136. window.PureColorBackgroundChecked = CL_LocalStorage.getItem('PureColorBackgroundChecked', false) //自定义纯色背景
  137. window.CustomizeUrlValueChecked = CL_LocalStorage.getItem('CustomizeUrlValueChecked', '') //自定义URL值
  138. window.CustomizeURLChecked = CL_LocalStorage.getItem('CustomizeURLChecked', true) //自定义URL
  139. window.CustomBackgroundCode = CL_LocalStorage.getItem('CustomBackgroundCode', '#FFF') //纯色背景代码
  140. window.RandomPicturesChecked = CL_LocalStorage.getItem('RandomPicturesChecked', false) //随机图片
  141. window.picGroupSelectValue = CL_LocalStorage.getItem('picGroupSelectValue', 'Anime') //分组
  142. window.advertisingChecked = CL_LocalStorage.getItem('advertisingChecked', false) //清除广告
  143. window.SideColumnChecked = CL_LocalStorage.getItem('SideColumnChecked', false) //删除侧栏
  144. window.PictureURLIndex = CL_LocalStorage.getItem('PictureURLIndex', '0') //图片当前索引
  145. window.len = GroupList[picGroupSelectValue].ImgList.length - 1 //图片索引数量
  146. n = window[name]
  147. return n
  148. })
  149.  
  150. /* 获取localStorage数据 */
  151. // var CustomBackgroundCode = CL_LocalStorage.getItem("CustomBackgroundCode", "#FFF"); // 纯色背景代码
  152. /* 输出localStorage数据到控制台 */
  153. console.log(CL_LocalStorage.getRawObj());
  154.  
  155. /**
  156. * CSS数据
  157. */
  158. var cssContent = {
  159. 'body': {
  160. "background-position-x": "center",
  161. "background-attachment": "fixed",
  162. "background-size": "cover",
  163. 'z-index': '-1000',
  164. 'position': 'relative'
  165. },
  166. "div#CL_Console": {
  167. "-moz-user-select": "none",
  168. "-webkit-user-select": "none",
  169. "-ms-user-select": "none",
  170. "-khtml-user-select": "none",
  171. "user-select": "none",
  172. 'position': "fixed",
  173. 'top': "35%",
  174. 'left': "1",
  175. 'z-index': '99'
  176. },
  177. "img#CL_img": {
  178. 'width': "35px",
  179. "border-radius": "20px",
  180. 'cursor': "pointer"
  181. },
  182. ".none": {
  183. 'display': "none"
  184. },
  185. ".block": {
  186. 'display': "block"
  187. },
  188. "div#CL_OperationPanel": {
  189. 'width': "300px",
  190. 'height': "300px",
  191. 'background': "rgb(232 240 255 / 70%)",
  192. 'backdrop-filter': 'blur(3px)',
  193. 'position': "absolute",
  194. 'top': "20px",
  195. 'left': "35px",
  196. "box-shadow": "1px 1px 4px 0px #747698",
  197. "border-radius": "6px",
  198. 'padding': "10px"
  199. },
  200. "div#CL_OperationPanel>div": {
  201. 'height': "30px",
  202. "line-height": "30px",
  203. "margin-top": "10px"
  204. },
  205. ".Button": {
  206. 'width': "49%",
  207. 'display': "inline-block",
  208. "text-align": "center",
  209. 'background': "#fbfbfb",
  210. "box-shadow": "1px 1px 3px 0px #5e8796",
  211. "border-radius": "7px",
  212. 'cursor': "pointer",
  213. 'background': 'rgba(240, 248, 255, 0)'
  214. },
  215. ".functional>p": {
  216. 'margin': "0px",
  217. 'display': "inline-block",
  218. 'width': "31%"
  219. },
  220. ".color-box": {
  221. 'float': "left",
  222. 'width': "30px",
  223. 'height': "20px",
  224. 'margin': "5px",
  225. 'border': "1px solid white",
  226. 'cursor': "pointer"
  227. },
  228. "p.RandomPictures": {
  229. 'float': "left",
  230. 'margin': "0"
  231. },
  232. "span#save,span#Reset": {
  233. 'margin': "auto",
  234. 'display': "inline-block",
  235. 'width': "50px",
  236. "margin-left": "10px"
  237. },
  238. ".OperationButton": {
  239. 'position': "absolute",
  240. 'left': "50%",
  241. "margin-left": "-66px",
  242. 'bottom': "10px"
  243. },
  244. "#panelDOM select": {
  245. "border-color": "#7b7b7b"
  246. },
  247. ".checkboxWrap": {
  248. 'cursor': "pointer"
  249. },
  250. '.wrapper_new #foot': {
  251. 'background-color': '#f5f5f6a8'
  252. },
  253. "div#s_tab": {
  254. 'background': '#f8f8f8'
  255. },
  256. '.s_tab_inner': {
  257. 'background': 'none'
  258. },
  259. 'div#fbar,.appbar,.yg51vc,#hdtb': {
  260. 'background': '#f2f2f29e'
  261. },
  262. '.MXl0lf.mtqGb,div#pagebar_container': {
  263. 'background': '#ffffffc9',
  264. 'margin-top': '19px'
  265. },
  266. 'div#b_content': {
  267. 'padding-left': '140px'
  268. },
  269. 'p.Customize.checkboxWrap': {
  270. 'float': 'left',
  271. 'margin': '0px',
  272. 'cursor': 'pointer'
  273. },
  274. 'div#CL_OperationPanel input[type="text"]': {
  275. 'width': '190px',
  276. 'margin-top': '4.3px',
  277. 'height': '20px'
  278. },
  279. 'span#help':{
  280. 'background':'none'
  281. }
  282.  
  283. };
  284.  
  285. /**
  286. * 加载控制面板
  287. */
  288. $('body').append(
  289. $('<div id="CL_Console">').append(
  290. $('<img id="CL_img" src="https://upyun.calendarli.com/logo.png" title="MOD控制台"/>')
  291. ).append(
  292. $('<div id="CL_OperationPanel" class="none">').append(
  293. $('<div class="ChangePicture">').append('<span id="before" class="Button">上一张</span><span id="Rear" class="Button">下一张</span>')
  294. ).append(
  295. $('<div class="DropDownGroup">').append($('<span>切换分组:')).append($('<select class="select" name="picGroup" id="pic-group-selector">'))
  296. ).append(
  297. $('<div class="CustomizeURL">').append('<div><p class="Customize checkboxWrap" title="可填写图床URL"><input type="checkbox" name="CustomizeURL" value="自定义URL" default="true">自定义URL</p><input type="text" name="CustomizeUrlValue"></div>')
  298. ).append(
  299. $('<div class="transparency">').append(
  300. $('<span>').append('背景透明度:')
  301. ).append('<select class="BackgroundSelector" name="BackgroundTransparency" cl-select-number defaultValue="0" maxValue="1" minValue="0" stepValue="0.1"></select>').append(
  302. $('<span>').append('列表透明度:')
  303. ).append('<select class="ListSelector" name="ListTransparency" cl-select-number defaultValue="0" maxValue="1" minValue="0" stepValue="0.1"></select>')
  304. ).append(
  305. $('<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>')
  306. ).append(
  307. $('<div class="PureColorBackground">').append(
  308. $('<p class="RandomPictures checkboxWrap">').append('<input type="checkbox" name="PureColorBackground" value="纯色背景" default="false" title="启用后背景透明度将不可用"/>纯色背景')
  309. ).append('<div class="color-box"></div>')
  310. ).append(
  311. $('<div class="OperationButton">').append('<span id="save" class="Button">保存</span><span id="Reset" class="Button">重置</span>')
  312. )
  313. )
  314. )
  315. $('#CL_OperationPanel input[name=CustomizeUrlValue]').val(getVariable('CustomizeUrlValueChecked'))
  316. $('#CL_Console').siblings().on('click',()=>{
  317. $('#CL_OperationPanel').hide(200)
  318. })
  319.  
  320. /**
  321. * 启用调色器
  322. */
  323. // @ts-ignore
  324. /*$(".color-box").colpick({
  325. colorScheme: "dark",
  326. layout: "rgbhex",
  327. color: "fff",
  328. onSubmit: function(hsb, hex, rgb, el) {
  329. $(el).css("background-color", "#" + hex);
  330. // @ts-ignore
  331. $(el).colpickHide();
  332. }
  333. });*/
  334.  
  335. /**
  336. * 加载自定义的背景色
  337. */
  338. $(".color-box").css("background-color", getVariable('CustomBackgroundCode')); // 纯色背景代码
  339. /**
  340. * 把固定CSS数据绑定到相应的元素上
  341. */
  342. for (var selector in cssContent) {
  343. $(selector).css(cssContent[selector]);
  344. }
  345.  
  346. /**
  347. * 加载分组选项
  348. */
  349. for (var group in GroupList) {
  350. $("#pic-group-selector").append("<option value=\"" + group + "\">" + GroupList[group].Name + "</option>");
  351. }
  352. /**
  353. * 加载checkbox的选中
  354. */
  355. $.each($("#CL_OperationPanel input[type=checkbox]"), function(_, item) {
  356. var jqDOM = $(item);
  357. var key = jqDOM.attr("name") + "Checked";
  358. var defaultValue = JSON.parse(jqDOM.attr("default"));
  359. jqDOM.prop("checked", CL_LocalStorage.getItem(key, defaultValue));
  360. });
  361. /**
  362. * 加载number下拉选项的选项内容
  363. */
  364. $.each($("select[cl-select-number]"), function(_, item) {
  365. var jqDOM = $(item);
  366. var key = jqDOM.attr("name") + "NumberValue";
  367. var defaultValue = parseFloat(JSON.parse(jqDOM.attr("defaultValue")));
  368. var minValue = parseFloat(jqDOM.attr("minValue"));
  369. var maxValue = parseFloat(jqDOM.attr("maxValue"));
  370. var stepValue = parseFloat(jqDOM.attr("stepValue"));
  371. var targetValue = CL_LocalStorage.getItem(key, defaultValue);
  372. for (var i = minValue; i <= maxValue; i = parseFloat((i + stepValue).toPrecision(12))) {
  373. if (Math.abs(targetValue - i) < 0.0001) {
  374. jqDOM.append("<option value=\"" + i + "\" selected>" + i + "</option>");
  375. } else {
  376. jqDOM.append("<option value=\"" + i + "\">" + i + "</option>");
  377. }
  378. }
  379. });
  380.  
  381. (function() {
  382. var key = $("#pic-group-selector").attr("name") + "SelectValue";
  383. var targetValue = CL_LocalStorage.getItem(key);
  384. if (targetValue) {
  385. $("#pic-group-selector").val(targetValue);
  386. }
  387. })();
  388.  
  389. $('body').prepend($('<div class="Masklayer" style="background: #fff;width: 10090px;height: 10080px;z-index: -999;position: fixed;top: 0px;left: 0px; opacity:0.4;">'))
  390. var Output = function() {
  391.  
  392. var obj = new Image();
  393. /**
  394. * 输出背景
  395. */
  396. if (getVariable('CustomizeURLChecked') == true) {
  397. obj.src = getVariable('CustomizeUrlValueChecked')
  398. } else {
  399. if (getVariable('RandomPicturesChecked') == true) {
  400. obj.src = GroupList[getVariable('picGroupSelectValue')].ImgList[parseInt(Math.random() * getVariable('len') + 1)]
  401. } else {
  402. obj.src = GroupList[getVariable('picGroupSelectValue')].ImgList[getVariable('PictureURLIndex')];
  403. }
  404. }
  405. /**
  406. * 输出纯色背景
  407. */
  408. if (getVariable('PureColorBackgroundChecked') == true) {
  409. $('body')[0].style.backgroundColor = getVariable('CustomBackgroundCode')
  410. $('body')[0].style.backgroundImage = ''
  411. } else {
  412. obj.onload = function() {
  413. $('body')[0].style.backgroundImage = 'url(' + this.src + ')'
  414. $('body')[0].style.backgroundColor = ''
  415. console.log(getVariable('PictureURLIndex') + '/' + getVariable('len'))
  416. }
  417. }
  418. /**
  419. * 清除侧栏
  420. */
  421. if (getVariable('SideColumnChecked') == true) {
  422. $('div#content_right,div#rhs[jscontroller],aside[aria-label],div#right[class="right"],div#rcnt>div:nth-child(2)').hide()
  423. } else {
  424. $('div#content_right,div#rhs[jscontroller],aside[aria-label],div#right[class="right"],div#rcnt>div:nth-child(2)').show()
  425. }
  426. /**div#rhs
  427. * 清除广告
  428. */
  429. if (getVariable('advertisingChecked') == true) {
  430. setInterval(function() { $('.new-pmd.c-container[data-ecimtimesign],div[class="result c-container"],#bottomads,div#center_col>#taw').hide() }, 1000)
  431. } else {
  432. $('.new-pmd.c-container[data-ecimtimesign]').show()
  433. }
  434.  
  435. /**
  436. * 设置背景透明
  437. */
  438. $('.Masklayer')[0].style.opacity = getVariable('BackgroundTransparencyNumberValue')
  439.  
  440. /**
  441. * 设置列表透明
  442. */
  443. $('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;' })
  444.  
  445. }
  446.  
  447. /**适应搜索动态刷新列表 */
  448. $(document).on('change', '#b_context li', Output())
  449.  
  450. /**
  451. * 默认调整样式
  452. */
  453. $('div#rs,span.fk,#botstuff,#b_results>.b_ans,div#promotion_adv_container,.hintBox,#leftbottomleadContainer').hide()
  454. $('h3[class="t"],h3[class="LC20lb DKV0Md"]').after('<hr/>')
  455. $('#page a,.page-inner strong').attr({ style: 'height: 36px; background: #ffffffb8;' })
  456. $('.result-molecule.new-pmd[tpl="app/page"]').css('height','73px')
  457. $('div#page').css({'background':'none','margin':'0'})
  458. setTimeout(function(){
  459. $('.result-molecule.new-pmd[tpl="app/rs"]').css('width','58%')
  460. },500)
  461.  
  462. Output()
  463.  
  464. /**
  465. * 操作板的显示/隐藏
  466. */
  467. $(document).on("click", "#CL_img", function() {
  468. $("#CL_OperationPanel").toggle(200);
  469. });
  470. /**
  471. * 自定义按钮的按下动态特效
  472. */
  473. $(document).on("mousedown", ".Button", function() {
  474. $(this).css("box-shadow", "1px 1px 1px 0px #5e8796");
  475. });
  476. /**
  477. * 自定义按钮的松开动态特效
  478. */
  479. $(document).on("mouseup", ".Button", function() {
  480. $(this).css("box-shadow", "1px 1px 3px 0px #5e8796");
  481. });
  482. /**
  483. * 背景前后切换
  484. */
  485. $(document).on('click', '#before', function() {
  486. var xn = getVariable('PictureURLIndex') ? Number(getVariable('PictureURLIndex')) - 1 : getVariable('len');
  487. xn = xn < '0' ? getVariable('len') : xn
  488. CL_LocalStorage.setItem("PictureURLIndex", String(xn))
  489. CL_LocalStorage.save()
  490. // window.location.reload();
  491. Output()
  492. })
  493. $(document).on('click', '#Rear', function() {
  494. var xn = getVariable('PictureURLIndex') ? Number(getVariable('PictureURLIndex')) + 1 : 1;
  495. console.log(picGroupSelectValue + ':' + xn + '/' + getVariable('len'))
  496. xn = xn > getVariable('len') ? '0' : xn
  497. CL_LocalStorage.setItem("PictureURLIndex", String(xn))
  498. CL_LocalStorage.save()
  499. // window.location.reload();
  500. Output()
  501. })
  502.  
  503. /**
  504. * 重置
  505. */
  506. $(document).on("click", "#Reset", function() {
  507. CL_LocalStorage.clear();
  508. CL_LocalStorage.save()
  509. window.location.reload();
  510. });
  511. /**
  512. * 保存
  513. */
  514. $(document).on("click", "#save", function() {
  515. /**
  516. * 保存数字选项的值
  517. */
  518. $.each($("select[cl-select-number]"), function(_, item) {
  519. var jqDOM = $(item);
  520. var key = jqDOM.attr("name") + "NumberValue";
  521. var value = jqDOM.val();
  522. CL_LocalStorage.setItem(key, value);
  523. });
  524. /**
  525. * 保存picGroup的值
  526. */
  527. (function() {
  528. var key = $("#pic-group-selector").attr("name") + "SelectValue";
  529. var value = $("#pic-group-selector").val();
  530. CL_LocalStorage.setItem(key, value);
  531. })();
  532. /**
  533. * 保存Checkbox的值
  534. */
  535. $.each($("#CL_OperationPanel input[type=checkbox]"), function(_, item) {
  536. var jqDOM = $(item);
  537. var key = jqDOM.attr("name") + "Checked";
  538. var value = jqDOM.prop("checked");
  539. CL_LocalStorage.setItem(key, value);
  540. });
  541. /**
  542. * 保存text的值
  543. */
  544. $.each($("#CL_OperationPanel input[type=text]"), function(_, item) {
  545. var jqDOM = $(item);
  546. var key = jqDOM[0].name + "Checked";
  547. var value = jqDOM.val();
  548. CL_LocalStorage.setItem(key, value);
  549. })
  550. /**
  551. * 保存自定义颜色代码
  552. */
  553. CL_LocalStorage.setItem("CustomBackgroundCode", $(".color-box")[0].style.backgroundColor);
  554. /**
  555. * 保存默认图片索引
  556. */
  557. var PX = CL_LocalStorage.getItem("PictureURLIndex") ? function() {} : function() { CL_LocalStorage.setItem("PictureURLIndex", '0') }
  558. PX();
  559. CL_LocalStorage.save();
  560. // window.location.reload();
  561. Output()
  562. });
  563. /**
  564. * 点击checkbox的外部,也相当于点击了checkbox内部
  565. */
  566. $(document).on("click", ".checkboxWrap", function(event) {
  567. $.each($(event.target).children("input[type=checkbox]"), function(_, item) {
  568. $(item).prop("checked", !$(item).prop("checked"));
  569. });
  570. });
  571. })();

QingJ © 2025

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