// ==UserScript== // @name 壁纸背景+Live2D看板娘+毒鸡汤-油猴中文网 // @namespace https://bbs.tampermonkey.net.cn/ // @version 0.7.1 // @description 油猴中文网壁纸背景+Live2D看板娘+毒鸡汤!老二次元了~!!! // @description 0.5.0 新增图片切换按钮,复制当前背景图片链接按钮(右侧边)!在弹出页点 “总是允许此域名” 否则无法正常使用此脚本! // @description 0.6.0 修改导航栏样式,修改部分字体颜色,更换鸡汤文api!在弹出页点 “总是允许此域名” 否则无法正常使用此脚本! // @description 0.7.1 新增脚本开关功能设置(右上角),打开设置开启更多功能(默认关闭),右下角新增性感女神组件(与另一脚本合并)!在弹出页点 “总是允许此域名” 否则无法正常使用此脚本! // @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_setValue // @grant GM_getValue // @grant GM_addStyle // @grant GM_xmlhttpRequest // @grant GM_setClipboard // ==/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 */ GM_addStyle(` .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; } #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%; overflow:auto; list-style: none; } .menu_1 li { width: 115px; height: 50px; margin: auto; -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; } @-webkit-keyframes line { 0% { background-position-x: 390px; } } @keyframes line { 0% { background-position-x: 390px; } } #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); } .col-md{ position: fixed; width: 178px; height: 320px; top: 50px; right: -178px; z-index: 99999; color: #fff; transition: 0.5s; background: rgba(0, 0, 0, 0.5); } .col-md p{ text-align: center; background: rgba(0, 0, 0, 0.3); } .margin-r { margin-left: 10px; margin-right: 10px; vertical-align: top; line-height: 1.6; } .el-switch, .el-switch-style, .el-switch-style:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .el-switch { display: inline-block; margin-left: 10px; font-size: 100%; height: 1.6em; position: relative; } .el-switch .el-switch-style { height: 1.6em; left: 0; background: #C0CCDA; -webkit-border-radius: 0.8em; border-radius: 0.8em; display: inline-block; position: relative; top: 0; -webkit-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out; width: 3em; cursor: pointer; } .el-switch .el-switch-style:before { display: block; content: ''; height: 1.4em; position: absolute; width: 1.4em; background-color: #fff; -webkit-border-radius: 50%; border-radius: 50%; left: 0.1em; top: 0.1em; -webkit-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out; } .el-switch>input[type="checkbox"] { display: none; } .el-switch>input[type="checkbox"]:checked+.el-switch-style { background-color: #20a0ff; } .el-switch>input[type="checkbox"]:checked+.el-switch-style:before { left: 50%; } .cancel { position: absolute; display: inline-block; font-size: 26px; color: #fff; width: 20px; height: 20px; top: -12px; right: 5px; z-index: 999999; cursor: pointer; } .ion-ios-gear{ position: fixed; z-index: 99999; top: 10px; right: 10px; color: #0471fb; font-size: 15px; cursor: pointer; } `) unsafeWindow.onload = function () { 'use strict'; //document.getElementById('wp').style.backgroundColor="#ccffff"; //列表白色 let table = document.querySelector('tbody') if (!table) { table.style.backgroundColor = 'white' } //脚本设置按钮与控件面板 var a, b, s; a = document.createElement("div"); s = document.createElement('script'); b = document.querySelector("body"); b.appendChild(a); a.innerHTML = `  脚本设置
×

更多功能


看板娘
鸡汤文
性感女神组件
背景切换与复制组件

开关功能需刷新后才会生效


PS: 背景与导航栏加入开关判定会出现空白期,所以暂只设定以上四个开关功能

开启背景切换与复制组件后打开F12控制台可查看切换前的所有 背景图片链接
` //导航栏 var c, d; c = document.createElement("div"); d = document.querySelector("body"); d.appendChild(c); c.innerHTML = ` ` var icon = document.querySelector('.ion-ios-gear'); var colmd = document.querySelector('.col-md'); var cancel = document.querySelector('.cancel'); //显示脚本控件面板 icon.onclick = function () { colmd.style.right = '0px'; } //关闭脚本控件面板 cancel.onclick = function () { colmd.style.right = '-178px'; } //全局监听,点击任何地方隐藏组件 document.addEventListener('click', () => { colmd.style.right = '-178px'; }) //阻止事件冒泡,点击组件内的区域不会触发外层的点击事件 icon.addEventListener('click', function (event) { var e = event || window.event; if (e.cancelBubble) { e.cancelBubble = true; //ie } else { e.stopPropagation(); //其他浏览器 } }) colmd.addEventListener('click', function (event) { var e = event || window.event; if (e.cancelBubble) { e.cancelBubble = true; } else { e.stopPropagation(); } }) var checkbox1 = document.querySelector('.el-1>input'); var checkbox2 = document.querySelector('.el-2>input'); var checkbox3 = document.querySelector('.el-3>input'); var checkbox4 = document.querySelector('.el-4>input'); //看板娘 checkbox1.onclick = function () { GM_setValue('checkbox1', checkbox1.checked); }; if (checkbox1.checked = JSON.parse(GM_getValue('checkbox1'))) { let script = document.createElement('script'); let link = document.createElement('link'); script.src = 'https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js'; link.setAttribute('rel', 'stylesheet'); link.setAttribute('type', 'text/css'); link.href = 'https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css'; document.documentElement.appendChild(script); document.documentElement.appendChild(link); } else { console.log('看板娘未加载...'); } //鸡汤文 checkbox2.onclick = function () { GM_setValue('checkbox2', checkbox2.checked); }; if (checkbox2.checked = JSON.parse(GM_getValue('checkbox2'))) { 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; } }) console.log('鸡汤文已加载...'); } else { console.log('鸡汤文未加载...'); }; //性感女神组件 checkbox3.onclick = function () { GM_setValue('checkbox3', checkbox3.checked); }; if (checkbox3.checked = JSON.parse(GM_getValue('checkbox3'))) { var div, body; div = document.createElement("div"); body = document.querySelector("body"); body.appendChild(div); div.innerHTML = `
` var buttonContainer = document.querySelector('.button-container'); var mobileCanvas = document.querySelector('.mobile-canvas'); var ej = document.querySelector('.ej_1'); var mask = document.querySelector('.mask_1'); var qr = document.querySelector('.qr_1'); //鼠标移入移出(底层div宽高为165px) mobileCanvas.addEventListener('mouseenter', function () { buttonContainer.classList.toggle('open'); }); mobileCanvas.addEventListener('mouseleave', function () { buttonContainer.classList.toggle('open'); }); //点击微信图标弹出二维码&笼罩层 ej.addEventListener('click', function () { mask.style.display = "block"; qr.style.display = "block"; }); //点击笼罩层隐藏二维码&笼罩层 mask.addEventListener('click', function () { mask.style.display = "none"; qr.style.display = "none"; }); console.log('性感女神已加载...'); } else { console.log('性感女神未加载...'); }; //背景切换&复制组件 checkbox4.onclick = function () { GM_setValue('checkbox4', checkbox4.checked); }; if (checkbox4.checked = JSON.parse(GM_getValue('checkbox4'))) { var e, f; e = document.createElement("div"); f = document.querySelector("body"); f.appendChild(e); e.innerHTML = `
复制背景链接 >
` var arr = []; var beijing = document.querySelector('#nv_forum'); var psa_1 = document.querySelector('.psa_1'); var btn_1 = document.querySelector('.btn_1'); beijing.style.backgroundImage = "url('https://tva3.sinaimg.cn/large/0076R7yAgy1fq8ds6c448j31hc0u016f.jpg')"; psa_1.onclick = function () { GM_xmlhttpRequest({ method: "GET", responseType: "blob", url: "https://www.dmoe.cc/random.php", onload: function (xhr) { var url = (xhr.finalUrl); arr.push(url); beijing.style.backgroundImage = 'url(' + url + ')'; console.log('第 ' + [arr.length + 1] + ' 张 :' + url); } }) btn_1.innerHTML = "复制背景链接"; }; btn_1.onclick = function () { var bk = beijing.style.backgroundImage; var url = bk.split('("')[1].split('")')[0]; if (bk) { GM_setClipboard(url); btn_1.innerHTML = "复制成功"; } else { alert('复制失败,请刷新网页!') } }; console.log('背景切换与复制组件已加载...'); console.log('首张背景图片:https://tva3.sinaimg.cn/large/0076R7yAgy1fq8ds6c448j31hc0u016f.jpg') } else { console.log('背景切换与复制组件未加载...'); }; }