Luogu-Blue&Green

洛谷主题全局应用-绿与蓝

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Luogu-Blue&Green
// @homepage     https://greasyfork.org/zh-CN/scripts/422148-luogu-blue-green
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  洛谷主题全局应用-绿与蓝
// @author       Zhetengtiao
// @match        *://www.luogu.com.cn/*
// @grant        none
// ==/UserScript==

function payload()//将背景为白色的main变为绿与蓝的渐变 与https://www.luogu.com.cn/theme/design/39543主题一致
{
    document.querySelector('main[style="background-color: rgb(239, 239, 239);"]').style="background: linear-gradient(270deg, rgb(54, 173, 221), rgb(60, 215, 137));";//新版原生方法
    //$('main[style="background-color: rgb(239, 239, 239);"]').css({"background":"linear-gradient(270deg, rgb(54, 173, 221), rgb(60, 215, 137))"});//旧版jquery方法
}
window.onload=function(){
    payload();//页面加载完毕运行一次
    setTimeout(function(){
        payload();
    }, 2000);//运行后2秒后再运行一次
};