vjudge+background

啥都没优化,就是让vjudge变得更好看了

目前為 2023-08-15 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         vjudge+background
// @namespace    vjudge-plus-v2
// @version      1.5
// @description  啥都没优化,就是让vjudge变得更好看了
// @author       axototl (original by Suntra)
// @match        https://vjudge.net/
// @match        https://vjudge.net/*
// @noframes
// @icon         https://vjudge.net/favicon.ico
// @run-at       document-body
// @license      AGPLv3
// @grant        GM_addStyle
// @grant        GM_registerMenuCommand
// @grant        GM_getValue
// @grant        GM_setValue
// @run-at       document-end
// ==/UserScript==

(function() {
    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);
        window.alert("设置成功,刷新生效");
        location.reload();
    });
    // if(window.location.href.match(/\/problem\/description\/[^\/]+$/)) {
    //     console.log("error!!!");
    //     GM_addStyle(
    //         "dd {background-color: rgba(255,255,255,70%) !important;border-radius: 0.25rem !important;}"
    //     );
    // } else
    {
        GM_addStyle("body {background: #f0f0f0 url("+back+") no-repeat center top fixed;background-size: 100% 100%;-moz-background-size: 100% 100%;}");
        document.body.innerHTML = "<nav style='height: 60px'></nav>" + document.body.innerHTML;
    }

    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%;}"+
        "::-webkit-scrollbar {display: none;}"+
        "#prob-ads {display: none;}"+
        "#img-support {display: none;}"+
        ".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;}"+
        "a:focus, a:hover {color: #ff4c8c;text-decoration: underline;}"
    );

    document.querySelector("body > div.body-footer").innerHTML += '<p style="color: #3fb98b">Theme powered by vjudge+background (original by <a href="https://github.com/dffxd-suntra/vjudge-plus">vjudge+</a>)</p>';
})();