作者用来替代stylish的自适应洛谷替换背景插件
// ==UserScript==
// @name 洛谷调背景插件
// @namespace 洛谷调背景插件
// @version 1.0
// @description 作者用来替代stylish的自适应洛谷替换背景插件
// @author LiuTianyou
// @match https://www.luogu.com.cn/*
// @grant none
// @license GPL-v3.0
// ==/UserScript==
window.back = "https://cdn.luogu.com.cn/upload/image_hosting/b9ifd7ye.png";
setInterval(function(){ //修复:背景图片缺失问题
//修复:div不存在而错误终止脚本的情况
document.querySelector('body').style=`background: url(${window.back}) fixed center;background-size: cover;`;
if(document.querySelector('main[style="background-color: rgb(239, 239, 239);"]') != null)
document.querySelector('main[style="background-color: rgb(239, 239, 239);"]').style="opacity: 0.9;";
if(document.querySelector('div[style="background: linear-gradient(90deg, rgb(35, 37, 38), rgb(65, 67, 69)); filter: blur(0px) brightness(100%);"]') != null)
document.querySelector('div[style="background: linear-gradient(90deg, rgb(35, 37, 38), rgb(65, 67, 69)); filter: blur(0px) brightness(100%);"]').style="opacity: 0.9;";
if(document.querySelector('div[style="background: rgb(51, 51, 51); filter: blur(0px) brightness(100%);"]') != null)
document.querySelector('div[style="background: rgb(51, 51, 51); filter: blur(0px) brightness(100%);"]').style="opacity: 0.9;";
if(document.querySelector('div[class="mdui-panel mdui-panel-gapless"]') != null)
document.querySelector('div[class="mdui-panel mdui-panel-gapless"]').style="opacity: 0.9;";
if(document.querySelector("div[data-v-0a593618]") != null){
document.querySelector("div[data-v-0a593618]").remove();
}
},100);