// ==UserScript== // @name 搜索页面美化 // @version 2.5 // @description 支持的搜索引擎有1.百度;2.搜狗;3.谷歌;4.必应。 可自由切换背景 // @author CalendarLi // @match *://www.google.com/search?* // @match *://www.google.com.hk/search?* // @match *://cn.bing.com/search?* // @match *://www.baidu.com/s?* // @match *://www.sogou.com/web?* // @grant GM_log // @connect google.com // @connect baidu.com // @require http://cdn.staticfile.org/jquery/2.0.0/jquery.min.js // @namespace https://github.com/ // @downloadURL none // ==/UserScript== $(function(){ if($('.AC-MENU_Btn').length!=0&&!$($('.container-label.baidu input')[0]).is(':checked')){ console.log('开启了AC-baidu脚本') $('body').prepend('') }else{ console.log('未开启AC-baidu脚本') //$('#content_left').attr({style:' background: #f0f8ff94;padding-left: 35px; margin-left: 140px; width: 585px;'}) $('body').prepend('') $('#res').attr({style:'background: #f0f8ff94;width: 680px;padding: 10px 35px;margin-top: 10px;'}) $('#main').attr({style:'width: 680px;padding: 10px 35px;margin-top: 10px;margin-bottom: 20px;'}) } $('.container-label.baidu input').on('click',function(){ console.log('AC-baidu脚本切换') if(this.value == '0'){ console.log('AC-baidu脚本切换为原始模式') $('#content_left').attr({style:' background: #f0f8ff94; margin-left: 140px; width: 585px; padding-left: 35px;'}) }else{ console.log('非原始模式') $('#content_left').removeAttr('style') } }) }) $(function(){ var Anime=[ 'https://upyun.calendarli.com/Anime/063f89738882f07b08aaebaeaff23510.jpg', 'https://upyun.calendarli.com/Anime/1fa0ed09fe6ef8a09b114ba40b8c22f3.jpg', 'https://upyun.calendarli.com/Anime/5bc35d75b52b852d12544b7d8c1b88c6.jpg', 'https://upyun.calendarli.com/Anime/11fed6086ab5ee4cd24989a2a816db77.jpg', 'https://upyun.calendarli.com/Anime/2261e9ba9daeccc5d2e9d235bb5e20b1.jpg', 'https://upyun.calendarli.com/Anime/44ffdc1e475e5374f7d080b2e1617114.jpg', 'https://upyun.calendarli.com/Anime/55c024df52c2d98ec186bcec889b1fab.jpg', 'https://upyun.calendarli.com/Anime/773186d9b3b7072964573fbeb91c4a5c.jpg', 'https://upyun.calendarli.com/Anime/84627ff4644ee9bb3838f43bd1cf808e.jpeg', 'https://upyun.calendarli.com/Anime/97df6b36ec9e6c924f9075a40452fe26.jpg', 'https://upyun.calendarli.com/Anime/acf57c383d119b6cc8d92b1a77d47878.jpg', 'https://upyun.calendarli.com/Anime/b2e4b4e787b190a18522154564c5d510.jpg', 'https://upyun.calendarli.com/Anime/cc31ab7a6d4ad922b32313cb7297862c.jpeg', 'https://upyun.calendarli.com/Anime/dfeb5880917bec18684be6f49cf86d70.jpg', 'https://upyun.calendarli.com/Anime/e19b3d082f6a6274464d5f886736ea37.jpg', 'https://upyun.calendarli.com/Anime/e28f681cec0e89ec135333fa9e813242.jpg', 'https://upyun.calendarli.com/Anime/f9c6ee1426014073aeb190c5e83a1ba1.jpg' ] var landscape=[ 'https://upyun.calendarli.com/landscape/150909a21756042f3a38e0db3d47c2c5.jpg', 'https://upyun.calendarli.com/landscape/4940e494d71f9400a85f63288cefe8de.jpeg', 'https://upyun.calendarli.com/landscape/d5603970a58c68cb2e758f8e4924487a.jpeg', 'https://upyun.calendarli.com/landscape/db27f9d0e53d7571926c05faf63ce9a0.jpg' ] // 设置cookie值 function setCookie(cname,cvalue,exdays){ var d = new Date(); d.setTime(d.getTime()+(exdays*24*60*60*1000)); var expires = "expires="+d.toGMTString(); document.cookie = cname + "=" + cvalue + "; " + expires; } //读取cookie值 function getCookie(cname){ var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i') //百度 $('body').prepend('
'); $('body').prepend('
动漫
自然风景
') $('body').prepend('

背景透明度

保存
') $('.nums_text,.search_tool_tf,.c-gap-left,.num-tips').attr({style:'color: #477553;'}) $('#rs,.fk i').remove() $('.fk strong,#page strong,.page-inner a').attr({style:'background: none;'}) $('#page strong .pc').attr({style:'background: aliceblue;'}) $('.s_tab_inner').attr({style:'padding-top: 12px;'}) //必应 $('div#b_content').attr({style:'position: relative;'}) $('#b_results>li.b_ad').remove() //Google if($('#appbar,.yg51vc')){ $('#appbar,.yg51vc,#hdtb').attr({style:'background: #ffffff9e;'}) } if($('.Xeztj ')){ $('.Xeztj ,.YSlUOe,.MGqjK').attr({style:'background: #ffffff8f;'}) } if($('.Nxb87')){ $('.Nxb87').attr({style:'padding-top: 10px;'}) } if($('#botstuff')){ $('#botstuff').remove() } checkCookie() // 点击上一张的函数 $('#previous').on('click',function(){ //读取下标并转为数字类型 var PictureTheSubscript=Number(getCookie('PictureTheSubscript')) //读取分组 var PicturesGrouping=getCookie("PicturesGrouping"); var pi=PictureTheSubscript-1 //读取当前分组的数组下标 PicturesGrouping=='Anime'?len=Anime.length-1:len=landscape.length-1; // 当下标为0并点击上一张时回到数组的最后一位 if(01||al<0){ console.log('输入错误') alert('请输入0-1之间的透明度数值') }else{ setCookie('opacity',al,'1') checkCookie(); } }) })