您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
为vJudge设置背景
当前为
// ==UserScript== // @name vjudge+background // @namespace vjudge-plus-v2 // @version 1.8.3 // @description 为vJudge设置背景 // @author axototl (original by Suntra) // @match https://vjudge.net/* // @noframes // @icon https://vjudge.net/favicon.ico // @license AGPLv3 or later // @grant GM_addStyle // @grant GM_registerMenuCommand // @grant GM_getValue // @grant GM_setValue // @run-at document-idle // ==/UserScript== // license text: https://www.gnu.org/licenses/agpl-3.0.txt function reloader() { if (!navigator.onLine) { alert("离线状态,无法重加载,修改无法即刻生效"); return; } alert("设置成功,刷新生效"); location.reload(); } (function() { //在基于 Blink 浏览器上检测是否为正常返回 if (navigator.userAgent.includes("Chrome") && performance.getEntries()[0].responseStatus != 200) return; // 设置背景 let back = GM_getValue("background", "https://cdn.luogu.com.cn/images/bg/fe/Day_And_Night_1.jpg"); GM_registerMenuCommand("设置背景URL", () => { back = window.prompt("请输入背景URL", back); GM_setValue("background", back); reloader(); }); let col = GM_getValue("col", "#b93e3e"); const tes = /^#([0-9a-f]{3,4}|[0-9a-f]{6})$/i; function getColor(t) { do { tmp = window.prompt("请输入颜色的Hexcode\n(比如#b93e3e)\n建议选择背景主色调的反差色", t); } while (!tes.test(t)); return t; } GM_registerMenuCommand("设置文字颜色", () => { GM_setValue("col", getColor(col)); reloader(); }); let collink = GM_getValue("collink", "#ff4c8c"); GM_registerMenuCommand("设置链接背景颜色", () => { GM_setValue("collink", getColor(collink)); reloader(); }); document.body.innerHTML = "<div style='height: 60px'></div>" + document.body.innerHTML; // 防止顶栏和页面内容重叠 // User defined style GM_addStyle("body {background: url("+back+") no-repeat center top fixed;background-size: 100% 100%;-moz-background-size: 100% 100%;color: "+col+";}"+ "a:focus, a:hover {color: "+collink+";text-decoration: underline;}"); // Global Style GM_addStyle( ".navbar {border-radius:0rem;background-color: rgba(0,0,0,65%) !important;position: fixed;top: 0;left: 0;z-index: 1000;width: 100%;}"+ "scrollbar-width: none"+ "#prob-ads {display: none;}"+ // 屏蔽广告 "#img-support {display: none;}"+ // 屏蔽 sponsor 栏广告 ".card, .list-group-item, .btn-secondary, .page-link, .page-item.disabled .page-link, .dropdown-menu {background-color: rgba(255,255,255,65%);}"+ ".modal-content {background-color: rgba(255,255,255,90%);}"+ ".form-control {background-color: rgba(255,255,255,50%);}"+ ".tab-content {background-color: rgba(255,255,255,50%);border: 2px solid #eceeef;border-radius: 0.25rem;padding: 20px;}"+ "table {background-color: rgba(255,255,255,70%);border-radius: 0.25rem;}" ); document.querySelector("body > div.body-footer").innerHTML += '<p style="color: #3fb98b">Theme powered by vjudge+background (original by <a href="https://greasyfork.org/scripts/448801">vjudge+</a>)</p>'; })();