// ==UserScript== // @name 壁纸背景+Live2D看板娘+毒鸡汤-油猴中文网 // @namespace https://bbs.tampermonkey.net.cn/ // @version 0.6.0 // @description 油猴中文网壁纸背景+Live2D看板娘+毒鸡汤!老二次元了~!!! // @description 0.5.0 新增图片切换按钮,复制当前背景图片链接按钮(右侧边)!在弹出页点 “总是允许此域名” 否则无法正常使用此脚本! // @description 0.6.0 修改导航栏样式,修改部分字体颜色,更换鸡汤文api!在弹出页点 “总是允许此域名” 否则无法正常使用此脚本! // @author 张仨 // @match https://bbs.tampermonkey.net.cn/* // @exclude https://bbs.tampermonkey.net.cn/search.php?mod=* // @exclude https://bbs.tampermonkey.net.cn/home.php?mod=space&do=* // @supportURL https://bbs.tampermonkey.net.cn/forum.php?mod=viewthread&tid=1173&extra=page%3D1 // @homepageURL https://bbs.tampermonkey.net.cn/forum.php?mod=viewthread&tid=1173&extra=page%3D1 // @run-at document-start // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant GM_addStyle // @grant GM_setClipboard // @require https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js // ==/UserScript== /* く__,.ヘヽ.    / ,ー、 〉 \ ', !-─‐-i / /´ /`ー'    L//`ヽ、 Live2D 看板娘 /  /,  /|  ,  ,    ', イ  / /-‐/ i L_ ハ ヽ!  i レ ヘ 7イ`ト  レ'ァ-ト、!ハ|  | !,/7 '0'   ´0iソ|   | |.从"  _   ,,,, / |./   | レ'| i>.、,,__ _,.イ /  .i  | レ'| | / k_7_/レ'ヽ, ハ. | | |/i 〈|/  i ,.ヘ | i | .|/ / i:   ヘ!  \ | kヽ>、ハ   _,.ヘ、   /、! !'〈//`T´', \ `'7'ーr' レ'ヽL__|___i,___,ンレ|ノ ト-,/ |___./ 'ー'  !_,.:*******************************/ /* * .::::. * .::::::::. * ::::::::::: FUCK YOU * ..:::::::::::' * '::::::::::::' * .:::::::::: * '::::::::::::::.. * ..::::::::::::. * ``:::::::::::::::: * ::::``:::::::::' .:::. * ::::' ':::::' .::::::::. * .::::' :::: .:::::::'::::. * .:::' ::::: .:::::::::' ':::::. * .::' :::::.:::::::::' ':::::. * .::' ::::::::::::::' ``::::. * ...::: ::::::::::::' ``::. * ```` ':. ':::::::::' ::::.. * '.:::::' ':'````.. */ /*** * _ooOoo_ * o8888888o * 88" . "88 * (| -_- |) * O\ = /O * ____/`---'\____ * . ' \\| |// `. * / \\||| : |||// \ * / _||||| -:- |||||- \ * | | \\\ - /// | | * | \_| ''\---/'' | | * \ .-\__ `-` ___/-. / * ___`. .' /--.--\ `. . __ * ."" '< `.___\_<|>_/___.' >'"". * | | : `- \`.;`\ _ /`;.`/ - ` : | | * \ \ `-. \_ __\ /__ _/ .-` / / * ======`-.____`-.___\_____/___.-`____.-'====== * `=---=' * * ............................................. * 佛祖保佑 永无BUG */ /*** * 佛曰: * 写字楼里写字间,写字间里程序员; * 程序人员写程序,又拿程序换酒钱。 * 酒醒只在网上坐,酒醉还来网下眠; * 酒醉酒醒日复日,网上网下年复年。 * 但愿老死电脑间,不愿鞠躬老板前; * 奔驰宝马贵者趣,公交自行程序员。 * 别人笑我忒疯癫,我笑自己命太贱; * 不见满街漂亮妹,哪个归得程序员? */ //CS样式 GM_addStyle(` #comiis_nv, .comiis_nvbox, #comiis_nv.comiis_nvs{ background: rgba(0,191,255,0.2) !important; } .comiis_logo{ display: none !important; } #mn_Nbbc3{ display: none !important; } #mn_F2{ display: none !important; } #mn_F68{ display: none !important; } #mn_N2bea{ display: none !important; } #mn_forum{ display: none !important; } .kmuser span{ color: #0471fb; } #diymsg1{ color: #0471fb; } #comiis_sousuo_menu{ background: rgba(0,191,255,0.5); } .lk{ border-radius: 25px; background-color: rgba(255,255,255,0.9); } #online{ border-radius: 25px; } #category_{ border-radius: 25px; overflow: hidden; } .bmw{ border-radius: 13.5px; } .bm_h{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15px; border-radius: 7px; } .comiis_fl_g{ border: 0px solid #fff; } .widthauto{ opacity: 0.9; } .comiis_irswfbox{ border-radius: 25px; opacity: 0.8; } .comiis_irbox{ border-radius: 25px; background-color: rgba(255,255,255,0.9); } .bm lk{ background-color: rgba(255,255,255,0.9); } #online{ background-color: rgba(255,255,255,0.9); } .flg{ background-color: rgba(255,255,255,0.9); } #wp .a_t{ background-color: rgba(255,255,255,0.9); border-radius: 7px; overflow: hidden; } #pt{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15px; border-radius: 7px; } .tl{ background-color: rgba(255,255,255,0.9); overflow: hidden; } .comiis_listinfo{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15px; border-radius: 7px; } .topico{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15px; border-radius: 7px; } .scrolltopa{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15px; border-radius: 7px; } .returnboard{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15px; border-radius: 7px; } .comiis_vrx{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15px; border-radius: 7px; } .pls{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15px; border-radius: 7px; } #fastpostform{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15px; border-radius: 7px; } .replyfast{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15; border-radius: 7px; } .returnlist{ background-color: rgba(255,255,255,0.9); margin-top: 10px !important; padding: 0px 15px; border-radius: 7px; } .class_1 span{ position: fixed; right: 0px; width: 33px; height: 66px; font-family: cursive; color: rgba(f, f, f, .8); opacity: .5; background: rgba(0, 0, 0, .5); border-radius: 2px; margin-top: -53px; z-index: 999; text-align: center; cursor: pointer; } .psa_1{ top: 50%; font-size: 24px; line-height: 66px; } .psa_1:hover { background: rgba(0, 0, 0, .8); color: #fff; } .btn_1{ top: 40%; color: #fff; font-size: 15px; } #nv_forum{ background-image: url(https://tva3.sinaimg.cn/large/0076R7yAgy1fq8ds6c448j31hc0u016f.jpg); background-repeat: no-repeat; background-position: top; background-attachment: fixed; background-size: cover; } .menu_1 { position: fixed; display: flex; z-index: 999; top: 10px; left: 18.5%; list-style: none; } .menu_1 li { width: 120px; height: 50px; -webkit-transition: background-position-x 0.9s linear; transition: background-position-x 0.9s linear; text-align: center; } .menu_1 li a { font-size: 20px; color: #0471fb; text-decoration: none; -webkit-transition: all 0.45s; transition: all 0.45s; } .menu_1 li:hover { background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEi%0D%0AIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhs%0D%0AaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB3aWR0%0D%0AaD0iMzkwcHgiIGhlaWdodD0iNTBweCIgdmlld0JveD0iMCAwIDM5MCA1MCIgZW5hYmxlLWJhY2tn%0D%0Acm91bmQ9Im5ldyAwIDAgMzkwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHBhdGggZmlsbD0i%0D%0Abm9uZSIgc3Ryb2tlPSIjZDk0ZjVjIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLW1pdGVybGlt%0D%0AaXQ9IjEwIiBkPSJNMCw0Ny41ODVjMCwwLDk3LjUsMCwxMzAsMAoJYzEzLjc1LDAsMjguNzQtMzgu%0D%0ANzc4LDQ2LjE2OC0xOS40MTZDMTkyLjY2OSw0Ni41LDI0My42MDMsNDcuNTg1LDI2MCw0Ny41ODVj%0D%0AMzEuODIxLDAsMTMwLDAsMTMwLDAiLz4KPC9zdmc+Cg=="); -webkit-animation: line 1s; animation: line 1s; } .menu_1 li:hover a { color: #d94f5c; } .menu_1 li:not(:last-child) { margin-right: 30px; } @-webkit-keyframes line { 0% { background-position-x: 390px; } } @keyframes line { 0% { background-position-x: 390px; } } `) unsafeWindow.onload = function () { 'use strict'; //跨域请求鸡汤文(首页) GM_xmlhttpRequest({ method: "GET", responseType: "json", url: "https://api.oddfar.com/yl/q.php", onload: function (e) { let Quotations = (e.responseText) console.log(Quotations); var ele = document.getElementById("diymsg1"); ele.innerHTML = Quotations; } }) //使用脚本加载css资源 let script = document.createElement('link'); script.setAttribute('rel', 'stylesheet'); script.setAttribute('type', 'text/css'); script.href = "https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"; document.documentElement.appendChild(script); //document.getElementById('wp').style.backgroundColor="#ccffff"; //列表白色 let table = document.querySelector('tbody') if (!table) { table.style.backgroundColor = 'white' } var a, b; a = document.createElement("a"); b = document.querySelector("body"); b.appendChild(a); a.innerHTML = `
复制背景链接 >
` document.querySelector('.psa_1').onclick = function () { GM_xmlhttpRequest({ method: "GET", responseType: "blob", url: "https://www.dmoe.cc/random.php", onload: function (xhr) { var url = (xhr.finalUrl) document.querySelector('#nv_forum').style.backgroundImage = 'url(' + url + ')'; } }) document.querySelector('.btn_1').innerHTML = "复制背景链接"; } var beijing = document.querySelector('#nv_forum'); /* *用css方式插入背景图片刷新网页不会有空白期,但标签中不显示导致无法复制 *用js方式插入背景图片刷新网页有空白期,但标签中会显示style属性 *所以这里用js方式再次插入同一张背景图片,不会冲突 */ beijing.style.backgroundImage = "url('https://tva3.sinaimg.cn/large/0076R7yAgy1fq8ds6c448j31hc0u016f.jpg')"; //点击复制背景链接 document.querySelector('.btn_1').onclick = function () { var bk = beijing.style.backgroundImage; //用split()方法分割标签中的图片链接 var url = bk.split('("')[1].split('")')[0]; if (bk) { GM_setClipboard(url); document.querySelector('.btn_1').innerHTML = "复制成功"; } else { alert('复制失败,请刷新网页!') } } } /* 网上搜集目前可用的api接口,自行更换即可!(也可换成自己喜欢的图片地址) https://api.sunweihu.com/api/bing1/api.php(必应每日) https://api.isoyu.com/bing_images.php(必应每日) https://api.sunweihu.com/api/sjbz/api.php(二次元) https://api.mtyqx.cn/api/random.php(二次元动漫) https://api.ixiaowai.cn/api/api.php(二次元动漫) https://api.ixiaowai.cn/gqapi/gqapi.php(高清壁纸) https://www.dmoe.cc/random.php(樱花动漫) https://api.yimian.xyz/img(eee.dog) https://img.paulzzh.com/touhou/random(东方Project) https://cdn.seovx.com/?mom=302(古风美图二次元) https://api.mz-moe.cn/img.php(二次元) https://api.btstu.cn/sjbz/api.php(美女) https://acg.sx/images(后宫动漫)打开比较慢 http://api.btstu.cn/sjbz/?lx=dongman(新浪动漫) http://api.btstu.cn/sjbz/?lx=meizi(新浪美女) */ /* 单张 http://p9.qhimg.com/bdm/0_0_100/t01f6209e46426b4a20.jpg http://p8.qhimg.com/bdm/0_0_100/t0194901bf698944743.jpg http://p5.qhimg.com/bdm/0_0_100/t017de839fb7d29de98.jpg http://p9.qhimg.com/bdm/0_0_100/t0188bce72a198ea128.jpg http://p5.qhimg.com/bdm/0_0_100/t01d186c769a0c36588.jpg */