跳到正文

科技·工程

旷野之息优化

Ivan422约 105 分钟
原文
文章信息与版本

文章信息

发布
2025年8月8日
收录
2025年12月12日
更新
2026年10月24日
篇幅
约 105 分钟

版本

  1. v1当前

项目介绍

通过对插件的魔改,实现洛谷野炊化。

建议浏览器:Edge 135+,没有对 manifest 2 的禁用即可。如果需要其他浏览器的可使用方法 22。

使用方式 11:下载油猴安装包,解压缩并打开浏览器扩展,打开开发者模式,然后加载解压缩的扩展,就会有一个油猴的界面。再右键点击图标打开新增脚本,直接复制进代码框,保存就获得了插件。

使用方法 22(不会获得最新的更新):直接下载插件,然后解压缩,点进去一级文件夹,会出现 Dark 和 Light 两个文件夹,直接加载解压缩的扩展(选择这两个文件夹之一)即可。

版本号:Version 5\tt Version\ 5.

亮版 Alpha\tt Alpha

首先请使用主题。

主要风格:天空蓝,#7BC0EB 颜色展示 Skyblue\color{#7BC0EB}\tt Skyblue.

使用图片:

还有一张可供替换:

点击使用 Luogu & The Legend Of Zelda [Light]\color{#7BC0EB}\texttt{Luogu \& The Legend Of Zelda [Light]}
JavaScript
// ==UserScript==
// @name          Luogu & The Legend Of Zelda [Light]
// @description	  The Legend Of Zelda - Ivan422
// @author        Ivan422
// @match         https://www.luogu.com.cn/*
// @run-at        document-start
// @version       Ver-5
// ==/UserScript==

(function() {

    var css = "";
if (false || (new RegExp("^https://www.luogu(.org|.com.cn)/(?!blog).*$")).test(document.location.href))
	css += [
		"/*luogu主站*/",
		"/*--------------------------用户自设部分--------------------------*/",
		"/*图片背景*/",
		"html > body {",
		"    background-image: url(https://cdn.luogu.com.cn/upload/image_hosting/603qm4jh.png) !important;",
		"    background-repeat: no-repeat;",
		"    background-size: cover;",
		"    background-position: center;",
		"    background-attachment: fixed;",
		"}",
		"",
		"/*----透明化----*/",
		"/*benben 讨论*/",
		".am-comment-main{",
		"    opacity:.75;",
		"}",
		"/*侧栏*/",
		"#app > .lfe-body {",
		"    background-color: rgba(110,162,206, .70) !important;",
		"}",
		"/*侧栏图标*/",
		"img[data-v-27b2cd59] {",
		"    opacity: .7;",
		"}",
		"/*记录详情 */",
		".wrapper > .test-case {",
		"    opacity: .85;",
		"}",
		"",
		".wrapper > .test-case:hover {",
		"    opacity: 1;",
		"}",
		"/*卡片*/",
		"/*主页卡片*/",
		".lg-article { ",
		"    -webkit-backdrop-filter: blur(20px) !important;",
		"    backdrop-filter: blur(20px) !important;",
		"    background: rgba(255, 255, 255, .7);",
		"}",
		".lg-article:hover{ ",
		"    background: rgba(255, 255, 255, .8);",
		"}",
		"/*普通卡片*/",
		".card{",
		"    background: rgba(255, 255, 255, .8) !important; ",
		"}",
		".card:hover{",
		"     background: rgba(255, 255, 255, .85) !important;   ",
		"}",
		"/*应用*/",
		".popup[data-v-1d675dd8] {",
		"    background-color: rgba(255, 255, 255, .55) !important;",
		"}",
		".popup[data-v-1d675dd8]:hover{",
		"    background-color: rgba(255, 255, 255, .9) !important;",
		"    ",
		"}",
		"/*用户顶栏*/",
		".user-nav[data-v-2dfcfd35] {",
		"    background: rgba(255, 255, 255, .4);",
		"}",
		"",
		".user-nav[data-v-2dfcfd35]:hover {",
		"    background: rgba(255, 255, 255, .6);",
		"}",
		"/*----------------------------------------------------------------*/",
		"/*定义*/",
		"@keyframes showAPP {",
		"    0% {",
		"        opacity: 0;",
		"        margin-left: -300px;",
		"    }",
		"",
		"    100% {",
		"        opacity: .8;",
		"        margin-left: 3px;",
		"    }",
		"}",
		"",
		"@keyframes showtop {",
		"    0% {",
		"        opacity: 0;",
		"        margin-left: -100px;",
		"    }",
		"",
		"    100% {",
		"        opacity: 1;",
		"        margin-left: 0px;",
		"    }",
		"}",
		"",
		"@keyframes showUI {",
		"    0% {",
		"        opacity: 0;",
		"        margin-top: -50px;",
		"    }",
		"",
		"    100% {",
		"        opacity: 1;",
		"        margin-top: 20px;",
		"    }",
		"}",
		"",
		"@keyframes slowshow {",
		"    0% {",
		"        opacity: 0;",
		"    }",
		"",
		"    100% {",
		"        opacity: 1;",
		"    }",
		"}",
		"",
		"@keyframes clan {",
		"    0% {",
		"        margin-left: -50px;",
		"    }",
		"}",
		"/*滚动条*/",
		"",
		"",
		"",
		"::-webkit-scrollbar-thumb {",
		"    background-color: #7BC0EB;",
		"}",
		"",
		"::-webkit-scrollbar-thumb:hover {",
		"    background-color: #7BC0EB;",
		"}",
		"::-webkit-scrollbar {",
		"    width: 5px;",
		"    height: 10px;",
		"    background-color: rgba(0, 0, 0, .12);",
		"}",
		"/*帖子、评论及奔奔*/",
		".am-comment-main{",
		"    border:0;",
		"    box-shadow:0px 0px 10px #404040bd;",
		"    transition:all .3s ease;",
		"}",
		".am-comment-main:hover{",
		"    transform:translateY(-2px);",
		"    box-shadow:0px 0px 30px #404040bd;",
		"}",
		".am-comment-main::before{",
		"    border:0px; ",
		"    background-color:#0000 !important;",
		"}",
		"/*页码*/",
		".am-pagination.am-pagination-centered > li > a{",
		"    border-radius:10px !important;",
		"    transition:all .5s ease;",
		"    box-shadow:0px 0px 10px #000;",
		"}",
		".am-pagination.am-pagination-centered > li > a:hover{",
		"    border-radius:5px !important;",
		"    transform:translateY(-2px);",
		"    box-shadow:0px 0px 5px #000;",
		"}",
		"/*奔*/",
		".feed-selector {",
		"    transition: all .2s ease;",
		"}",
		"",
		".feed-selector:hover {",
		"    border-radius: 3px !important;",
		"    box-shadow: 1px 1px 10px #000 !important;",
		"}",
		"/*顶栏,低栏*/",
		".main-container > main.lfe-body {",
		"    background: transparent !important;",
		"}",
		"",
		".background[data-v-7958fe72] {",
		"    background: transparent !important;",
		"}",
		"",
		".am-comment-main:hover{",
		"    transform:translateY(-2px);",
		"    box-shadow:0px 0px 30px #404040bd;",
		"}",
		".am-comment-main::before{",
		"    border:0px; ",
		"    background-color:#0000 !important;",
		"}",
		"/*侧栏*/",
		"",
		"#app > .lfe-body > a {",
//		"    color: #61eee9f5 !important;",
		"    height: 3.7em;",
		"    margin-top: 3px;",
		"    padding: 0 !important;",
		"}",
		"",
		"",
		"#app > .lfe-body > a:first-of-type {",
		"    margin-top: 10px !important;",
		"}",
		"",
		"#app > .lfe-body > a > .icon {",
		"    line-height: 2.4em;",
		"    font-size: 18px;",
		"    width: 100%;",
		"    margin: 0 !important;",
		"    transition: all 0.2s ease;",
		"}",
		"",
		"#app > .lfe-body > a > .text {",
		"    opacity: 0;",
		"    margin-top: -2em;",
		"    display: block;",
		"    transition: all 0.3s ease;",
		"}",
		"",
		"#app > .lfe-body > a:hover > .icon {",
		"    line-height: 1.5em;",
		"    font-size: 17px;",
		"}",
		"",
		"#app > .lfe-body > a:hover > .text {",
		"    opacity: 1;",
		"    margin-top: 0.2em;",
		"}",
		"",
		"/*提交文件*/",
		".drop[data-v-01cd4e24]{",
		"    border:0;",
		"    transition: all .4s ease;",
		"    border-radius:30px;",
		"    box-shadow:3px 3px 10px #00000080;",
		"}",
		".drop[data-v-01cd4e24]:hover{",
		"    border:0;",
		"    transform:translateY(-10px);",
		"    border-radius:30px;",
		"    box-shadow:10px 10px 30px #0000009e;",
		"}",
		"/*近期比赛*/",
		".am-panel.lg-index-contest.am-panel-danger{",
		"    border-radius:10px;",
		"    margin-left:10px;",
		"    box-shadow:1px 1px 10px #00000075;",
		"    transition:all .3s ease;",
		"}",
		".am-panel.lg-index-contest.am-panel-danger:hover{",
		"    box-shadow:1px 1px 15px #0000008f;",
		"}",
		".am-panel.lg-index-contest.am-panel-success{",
		"    border-radius:10px;",
		"    margin-left:10px;",
		"    box-shadow:1px 1px 10px #00000075;",
		"    transition:all .3s ease;",
		"}",
		".am-panel.lg-index-contest.am-panel-success:hover{",
		"    box-shadow:1px 1px 15px #0000008f;",
		"}",
		"/*最近讨论*/",
		".am-panel.lg-index-contest.am-panel-primary{",
		"    margin-left:0px;",
		"    border-radius:10px;",
		"    border:0px;",
		"    width:38rem;",
		"    box-shadow:1px 1px 10px #00000075;",
		"    transition:all .3s ease;",
		"}",
		".am-panel.lg-index-contest.am-panel-primary:hover{",
		"    box-shadow:1px 1px 15px #0000008f;",
		"}",
		"",
		"/*记录详情 */",
		".wrapper > .test-case {",
		"    border-radius:5px;",
		"    box-shadow:0px 2px 7px #6d6d6d;",
		"    transition: all 0.3s ease;",
		"}",
		"",
		".wrapper > .test-case:hover {",
		"    transform: translateY(-5px);",
		"    box-shadow:0px 3px 15px #404040;",
		"}",
		"",
		".message[data-v-21e0a7cc] {",
		"    border-radius: 10px;",
		"}",
		"/*rated*/",
		".am-badge.am-radius.lg-bg-green {",
		"    background: #00b09b;",
		"  /* fallback for old browsers */",
		"    background: -webkit-linear-gradient(to right, #FCC21A, #1A97FC);",
		"  /* Chrome 10-25, Safari 5.1-6 */",
		"    background: linear-gradient(to right, #FCC21A, #1A97FC);",
		" /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */",
		"    border-radius: 5px;",
		"    transition: all 0.3s ease;",
		"}",
		"",
		".am-badge.am-radius.lg-bg-green:hover {",
		"    transform: translateY(-2px);",
		"}",
		"/*输入框*/",
		".am-form-field {",
		"    font-weight: bold;",
		"    transition: all .2s ease;",
		"    box-shadow: 2px 2px 3px #bab9b9;",
		"    border: 0;",
		"    border-radius: 10px !important;",
		"}",
		"",
		".am-form-field:hover {",
		"    transition: all .2s ease;",
		"    box-shadow: 3px 3px 9px #bab9b9;",
		"}",
		"",
		".refined-input.input-wrap.frame[data-v-66fcc50b][data-v-8cc386e2] {",
		"    border: 0;",
		"}",
		"",
		".lfe-form-sz-middle {",
		"    font-weight: bold;",
		"    transition: all .2s ease;",
		"    box-shadow: 2px 2px 9px #bab9b9;",
		"    border: 0;",
		"    border-radius: 10px !important;",
		"}",
		"",
		".lfe-form-sz-middle:hover {",
		"    box-shadow: 2px 2px 10px #bab9b9;",
		"}",
		"",
		".refined-input.input-wrap.frame {",
		"    border: 0;",
		"}",
		"",
		".lfe-form-sz-small {",
		"    font-weight: bold;",
		"    transition: all .2s ease;",
		"    box-shadow: 2px 2px 10px #bab9b9;",
		"    border: 0;",
		"    border-radius: 10px !important;",
		"}",
		"",
		".lfe-form-sz-small:hover {",
		"    box-shadow: 2px 2px 20px #bab9b9;",
		"}",
		"/*user-header-top*/",
		".user-header-top[data-v-2424f61c][data-v-f9624136] {",
		"    margin-top: -60px !important;",
		"}",
		"",
		"/* -------------------------------- 圆角化 --------------------------------- */",
		"",
		".am-btn.am-btn-sm {",
		"    border-radius: 20px !important;",
		"}",
		"",
		".lfe-caption.tag.status-name[data-v-43a42535] {",
		"    border-radius: 20px !important;",
		"}",
		"",
		".card.padding-default {",
		"    border-radius: 20px !important;",
		"    box-shadow: 0px 0px 0px #8f8f8f;",
		"}",
		"",
		".lg-article {",
		"    animation: slowshow .5s 1;",
		"    transition: all 0.5s ease;",
		"    border-radius: 20px !important;",
		"    box-shadow: 0px 0px 0px #8f8f8f;",
		"}",
		"",
		".dropdown > .center {",
		"    border-radius: 10px !important;",
		"    box-shadow: 5px 5px 17px #525252cc;",
		"}",
		"",
		".popup[data-v-1d675dd8] {",
		"    animation: showAPP .5s 1;",
		"    box-shadow: 5px 5px 17px #8f8f8f7a;",
		"    margin-left: 3px;",
		"    width: 11.4em;",
		"    height: 13.7em;",
		"    background: #fff;",
		"    background-clip: border-box;",
		"    border-radius: 10px !important;",
		"    border: 0px solid rgba(0, 0, 0, .2);",
		"    transition:all 1s;",
		"}",
		".apps a[data-v-1d675dd8] {",
		"    padding: .3em;",
		"    color: #333;",
		"    border-radius: 99px !important;",
		"}",
		"",
		".padding-none[data-v-f9624136] {",
		"    border-radius: 30px !important;",
		"}",
		"/*用户顶栏*/",
		".user-nav[data-v-2dfcfd35] {",
		"    animation: showUI 1s 1;",
		"    transition: all .5s ease;",
		"    margin-top: 20px;",
		"    border-radius: 20px !important;",
		"}",
		"",
		"/*还是卡片*/",
		".card.problem-card.padding-default {",
		"    animation: slowshow .5s 1;",
		"    border-radius: 20px !important;",
		"    box-shadow: 0px 0px 0px #8f8f8f;",
		"}",
		"",
		".card.padding-default {",
		"    transition: all .5s ease;",
		"    border-radius: 20px !important;",
		"    box-shadow: 0px 0px 0px #8f8f8f;",
		"}",
		".inner-card{",
		"    border-radius:10px;",
		"    box-shadow: 1px 1px 10px #00000036;",
		"}",
		".card.user-header-container.padding-0 {",
		"    width: 100%;",
		"    border-radius: 20px !important;",
		"    box-shadow: 0px 0px 0px #8f8f8f;",
		"    height: 400px;",
		"}",
		".card.float-card.padding-0[data-v-f9624136]{",
		"    border-radius:30px !important;",
		"    transition:1s ease;",
		"}",
		".card.float-card.padding-0[data-v-f9624136]:hover{",
		"    border-radius:30px !important;",
		"}",
		".card.user-header-container.padding-0 > .user-header-top {",
		"    height: 320px;",
		"}",
		"",
		".select-button.lfe-form-sz-small {",
		"    border-radius: 10px !important;",
		"}",
		"",
		".progress-frame > div[data-v-47712372] {",
		"    width: 100%;",
		"    height: 100%;",
		"    background: #71BFE6",
		"  /* fallback for old browsers */",
		"    background: -webkit-linear-gradient(to right, #7BC0EB, #7BC0EB);",
		"  /* Chrome 10-25, Safari 5.1-6 */",
		"    background: linear-gradient(to right, #7BC0EB, #7BC0EB) /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */       !important;",
		"}",
		"",
		".color-default > .lfe-caption {",
		"    border-radius: 20px !important;",
		"    ",
		"}",
		"",
		".tag.color-none > .lfe-caption {",
		"    border-radius: 20px !important;",
		"    transition: all .4s;",
		"    ",
		"}",
		".tag.color-none > .lfe-caption:hover{",
		"    transform:translateY(-2px) !important;",
		"}",
		".selected[data-v-66021821] {",
		"    border-radius: 10px !important;",
		"}",
		"",
		".bottom.float-bottom {",
		"    animation: slowshow 1s 1;",
		"    margin-bottom: 4px;",
		"    border-radius: 20px !important;",
		"    z-index:999;",
		"}",
		"",
		".card.float-card.padding-0 {",
		"    border-radius: 5px !important;",
		"    box-shadow: 1px 1px 20px #5c5c5c !important;",
		"}"
	].join("\n");
if (false || (document.location.href.indexOf("https://www.luogu.com.cn/chat") == 0))
	css += [
		"/*luogu私信*/",
		".card.wrapper.padding-none{",
		"    border-radius:10px !important;",
		"    -webkit-backdrop-filter: blur(20px) !important;",
		"    backdrop-filter: blur(20px) !important;",
		"    box-shadow: 0px 0px 30px #000;",
		"}",
		".message-block.right > .message[data-v-5c0627c6]{",
		"    background-color:#7BC0EB !important;",
		"    color:#fff !important;",
		"}",
		"html > body {",
		"    background-image: url(https://cdn.luogu.com.cn/upload/image_hosting/603qm4jh.png) !important;",
		"    background-repeat: no-repeat;",
		"    background-size: cover;",
		"    background-position: center;",
		"    background-attachment: fixed;",
		"}",
		".item[data-v-4d6dca7a]:hover{",
		"    border-radius:10px;",
		"    transition: all .3s ease;",
		"    background-color:#7BC0EB !important;",
		"    color:#fff;",
		"}"
	].join("\n");
if (typeof GM_addStyle != "undefined") {
	GM_addStyle(css);
} else if (typeof PRO_addStyle != "undefined") {
	PRO_addStyle(css);
} else if (typeof addStyle != "undefined") {
	addStyle(css);
} else {
	var node = document.createElement("style");
	node.type = "text/css";
	node.appendChild(document.createTextNode(css));
	var heads = document.getElementsByTagName("head");
	if (heads.length > 0) {
		heads[0].appendChild(node);
	} else {
		// no head yet, stick it whereever
		document.documentElement.appendChild(node);
	}
}
                 var url = window.location.href;
    async function user_detail(){
        var button = document.createElement('button');
        button.textContent = '复制Md';
        button.style.position = "absolute";
        button.style.top = "100px";button.style.right = "100px";
        window.addEventListener('scroll', function() {
            var scrollY = window.scrollY;
            button.style.top = (100 + scrollY) + 'px';
        });
        button.classList.add('button-lgcm');
        button.addEventListener('click', async function() {
            var introduction = _feInstance.currentData.user.introduction;
            await navigator.clipboard.writeText(introduction);
            alert('复制成功');
        });
        document.body.appendChild(button);
    }
    async function blog(){
            var button = document.createElement('button');
            button.textContent = '复制Md';
            button.style.position = "absolute";
            button.style.top = "100px";button.style.right = "100px";
            window.addEventListener('scroll', function() {
                var scrollY = window.scrollY;
                button.style.top = (100 + scrollY) + 'px';
            });
            button.classList.add('button-lgcm');
            button.addEventListener('click', async function() {
                fetch('/api/blog/detail/' + BlogGlobals.blogID).then(res => res.json()).then(res => navigator.clipboard.writeText(res.data.Content));
                alert('复制成功');
            });
            document.body.appendChild(button);
        };
    async function contest_detail(){
        var button = document.createElement('button');
        button.textContent = '复制Md';
        button.style.position = "absolute";
        button.style.top = "100px";button.style.right = "100px";
        window.addEventListener('scroll', function() {
            var scrollY = window.scrollY;
            button.style.top = (100 + scrollY) + 'px';
        });
        button.classList.add('button-lgcm');
        button.addEventListener('click', async function() {
            var introduction = _feInstance.currentData.contest.description;
            await navigator.clipboard.writeText(introduction);
            alert('复制成功');
        });
        document.body.appendChild(button);
    };
    async function training_detail(){
        var button = document.createElement('button');
        button.textContent = '复制Md';
        button.style.position = "absolute";
        button.style.top = "100px";button.style.right = "100px";
        window.addEventListener('scroll', function() {
            var scrollY = window.scrollY;
            button.style.top = (100 + scrollY) + 'px';
        });
        button.classList.add('button-lgcm');
        button.addEventListener('click', async function() {
            var introduction = _feInstance.currentData.training.description;
            await navigator.clipboard.writeText(introduction);
            alert('复制成功');
        });
        document.body.appendChild(button);
    };
    var style = document.createElement('style');
    style.textContent = `
        .button-lgcm {
            outline:none !important;
            cursor: pointer;
            line-height: 1.25;
            position: relative;
            display: block;
            margin-left: -.0625rem;
            padding: .5rem .75rem;
            color: #fff !important;
            border: .0625rem solid #dee2e6;
            font-size: 15px;
            font-weight: unset;
            display: flex;
            min-width: 36px;
            height: 36px;
            margin: 0 3px;
            border-radius: 100px!important;
            align-items: center;
            justify-content: center;
            transition:all .3s;
            background-color: #7BC0EB;
        }
        .button-lgcm:hover {
            box-shadow: 0 7px 14px rgba(50,50,93,.1), 0 3px 6px rgba(0,0,0,.08);
            transform: translateY(-1px);
        }
        `;
    document.head.appendChild(style);
    if (url.includes('blog') && !url.includes('Admin') && !url.includes('admin')) {
        var parsedUrl = new URL(url);
        if (url.includes('org')) {
            var path = parsedUrl.pathname.split('/');
            if (path.length >= 2 && path[1] != '') {
                window.addEventListener('load', blog);
            }
        } else {
            var path = parsedUrl.pathname.split('/');
            if (path.length >= 4) {
                console.log('a');
                window.addEventListener('load', blog);
            }
        }
    }
    if (url.includes('user') && !url.includes('notification')) {
        window.addEventListener('load', user_detail);
    }
    if (url.includes('contest') && !url.includes('list') && !url.includes('edit') && !url.includes('contestId')) {
        window.addEventListener('load', contest_detail);
    }
    if (url.includes('training') && !url.includes('edit') && !url.includes('list')) {
        window.addEventListener('load', training_detail);
    }
    // 下面这个变量控制是否要修改个人主页动态中的时间为具体时间,可手动更改为 0
    const chbb = 1;

    // 下面这个函数可以关闭广告。不想关的话注释掉就行了。
    function closeDivsWithAttributes() {
        let attributeValue = '';
        var divElements = document.getElementsByTagName('div');
        for (var i = 0; i < divElements.length; i++) {
            var div = divElements[i];
            if (div.getAttribute('data-v-0a593618') === attributeValue) {
                div.remove();
            }
        }
    }
    setInterval(closeDivsWithAttributes, 250);

    function formatTime(isoDatetime) {
        const date = new Date(isoDatetime);
        const year = date.getFullYear();
        const month = (date.getMonth() + 1).toString().padStart(2, '0');
        const day = date.getDate().toString().padStart(2, '0');
        const hours = date.getHours().toString().padStart(2, '0');
        const minutes = date.getMinutes().toString().padStart(2, '0');
        const seconds = date.getSeconds().toString().padStart(2, '0');
        return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
    }

    // 更改时间显示

    function changeTimeText() {
        let timeElements = document.querySelectorAll('time[data-v-f9624136][datetime]');
        timeElements.forEach((timeElement) => {
            const datetime = timeElement.getAttribute('datetime');
            const formattedTime = formatTime(datetime);
            timeElement.textContent = formattedTime;
        });
        timeElements = document.querySelectorAll('time[data-v-65a77fa1][datetime]');
        timeElements.forEach((timeElement) => {
            const datetime = timeElement.getAttribute('datetime');
            const formattedTime = formatTime(datetime);
            timeElement.textContent = formattedTime;
        });
        timeElements = document.querySelectorAll('time[data-v-85ede732][datetime]');
        timeElements.forEach((timeElement) => {
            const datetime = timeElement.getAttribute('datetime');
            const formattedTime = formatTime(datetime);
            timeElement.textContent = formattedTime;
        });
    }

    setInterval(changeTimeText, 500);

    function extractTimeText(element) {
        const timeElement = element.querySelector('.time');
        return timeElement ? timeElement.getAttribute('title') : null;
    }

    // 更新时间文本

    function updateLastReplyText() {
        const elements = document.querySelectorAll('div[data-v-b0d342de][data-v-f9624136].row.row-space-between.bottom');
        elements.forEach((element) => {
            const linkElement = element.querySelector('a.row.content-left.title.link.color-default');
            const linkElement1 = linkElement.querySelector('div.time');
            const timeText = linkElement1.title;
            if (timeText) {
                const titleText = `最后回复于 ${timeText}`;
                if (linkElement1) {
                    linkElement1.textContent = titleText;
                }
            }
        });
        elements.forEach((element) => {
            const linkElement = element.querySelector('div.row.content-left');
            const linkElement1 = linkElement.querySelector('div.time');
            const timeText = linkElement1.title;
            if (timeText) {
                const titleText = `发表于 ${timeText}`;
                if (linkElement1) {
                    linkElement1.textContent = titleText;
                }
            }
        });
    }

    setInterval(updateLastReplyText, 500);

    function benben(){
        // 找到所有 class 为 span.lfe-caption 的元素
        var elements = document.querySelectorAll('span.lfe-caption');

        // 遍历每个元素并进行操作
        elements.forEach(function(element) {
            var temp = element.textContent;
            // 提取 title 属性中的数字
            var title = element.getAttribute('title');
            if(title){
                var numbers = title.match(/\d+/g);

                if (numbers && numbers.length >= 5) {
                    // 提取第三个数字和第四个数字
                    var thirdNumber = parseInt(numbers[2]);
                    var fourthNumber = parseInt(numbers[3]);

                    // 处理日凌晨的情况
                    if (title.includes("日凌晨")) {
                        if (fourthNumber === 12) {
                            fourthNumber = "0";
                        } else {
                            //fourthNumber = fourthNumber < 10 ? "0" + fourthNumber : fourthNumber.toString();
                        }
                    }

                    // 处理日早上、日上午、日下午、日晚上的情况
                    if (title.includes("日早上") || title.includes("日上午")) {
                        //fourthNumber = fourthNumber < 10 ? "0" + fourthNumber : fourthNumber.toString();
                    } else if (title.includes("日下午") || title.includes("日晚上")) {
                        fourthNumber += 12;
                    }

                    // 补全第二个数和第三个数并更新 text
                    var secondNumber = parseInt(numbers[1]);
                    var secondNumberStr = secondNumber < 10 ? "0" + secondNumber : secondNumber.toString();
                    var thirdNumberStr = thirdNumber < 10 ? "0" + thirdNumber : thirdNumber.toString();
                    var fourthNumberStr = parseInt(fourthNumber) < 10 ? "0" + fourthNumber : fourthNumber.toString();
                    if(fourthNumberStr=="24")fourthNumberStr="12";

                    var newText = `${numbers[0]}-${secondNumberStr}-${thirdNumberStr} ${fourthNumberStr}:${numbers[4]}`;

                    // 更新元素的 text
                    element.textContent = newText;
                    element.setAttribute('title',temp);
                }
            }
        });

    }

})();
window.addEventListener('load',function(){
    var main = document.getElementsByClassName("card padding-default");
    main = main[main.length-1];
    var maintenance = main.getElementsByTagName('div')[0];
    var introduction = main.getElementsByTagName('div')[1];
    if(maintenance.innerText!='系统维护,该内容暂不可见。') return;
    maintenance.style.display="none";
    introduction.style.display="block";
})

暗版 Beta\tt Beta(搭配 Dark Reader 使用)

首先请使用主题。

使用图片:

如果你不想用插件,你可以用人马主题,这个东西的图片:

主要风格:大师之剑配色,#8075D3 #F2874F 颜色展示 Master Sword\color{#8075D3}\tt Master\ \color{#F2874F}Sword.

点击使用 Luogu & The Legend Of Zelda [Dark]\color{#F2874F}\texttt{Luogu \& The Legend Of Zelda\ [Dark]}
JavaScript
// ==UserScript==
// @name          Luogu & The Legend Of Zelda [Dark]
// @description	  The Legend Of Zelda [Dark] - Ivan422
// @author        Ivan422
// @match         https://www.luogu.com.cn/*
// @run-at        document-start
// @version       Ver-5
// ==/UserScript==

(function() {

    var css = "";
if (false || (new RegExp("^https://www.luogu(.org|.com.cn)/(?!blog).*$")).test(document.location.href))
	css += [
		"/*luogu主站*/",
		"/*--------------------------用户自设部分--------------------------*/",
		"/*图片背景*/",
		"html > body {",
		"    background-image: url(https://cdn.luogu.com.cn/upload/image_hosting/u8c1uvhv.png) !important;",
		"    background-repeat: no-repeat;",
		"    background-size: cover;",
		"    background-position: center;",
		"    background-attachment: fixed;",
		"}",
		"",
		"/*----透明化----*/",
		"/*benben 讨论*/",
		".am-comment-main{",
		"    opacity:.75;",
		"}",
		"/*侧栏*/",
		"#app > .lfe-body {",
		"    background-color: rgba(128,117,211, .70) !important;",
		"}",
		"/*侧栏图标*/",
		"img[data-v-27b2cd59] {",
		"    opacity: .7;",
		"}",
		"/*记录详情 */",
		".wrapper > .test-case {",
		"    opacity: .85;",
		"}",
		"",
		".wrapper > .test-case:hover {",
		"    opacity: 1;",
		"}",
		"/*题目分析栏*/",
		"path.highcharts-area {",
		"    color: white;",
		"    background: white;",
		"    fill: #F2874F26;",
		"}",
		"",
		"path.highcharts-point.highcharts-color-0 {",
		"    fill: #8075D38f;",
		"}",
		"",
		"rect.highcharts-point.highcharts-color-1 {",
		"    fill: #F2874Fad;",
		"    stroke: #8075D38f;",
		"}",
		"/*卡片*/",
		"/*主页卡片*/",
		".lg-article { ",
		"    -webkit-backdrop-filter: blur(20px) !important;",
		"    backdrop-filter: blur(20px) !important;",
		"    background: rgba(255, 255, 255, .7);",
		"}",
		".lg-article:hover{ ",
		"    background: rgba(255, 255, 255, .8);",
		"}",
		"/*普通卡片*/",
		".card{",
		"    background: rgba(255, 255, 255, .8) !important; ",
		"}",
		".card:hover{",
		"     background: rgba(255, 255, 255, .85) !important;   ",
		"}",
		"/*应用*/",
		".popup[data-v-1d675dd8] {",
		"    background-color: rgba(255, 255, 255, .55) !important;",
		"}",
		".popup[data-v-1d675dd8]:hover{",
		"    background-color: rgba(255, 255, 255, .9) !important;",
		"    ",
		"}",
		"/*用户顶栏*/",
		".user-nav[data-v-2dfcfd35] {",
		"    background: rgba(255, 255, 255, .4);",
		"}",
		"",
		".user-nav[data-v-2dfcfd35]:hover {",
		"    background: rgba(255, 255, 255, .6);",
		"}",
		"/*----------------------------------------------------------------*/",
		"/*定义*/",
		"@keyframes showAPP {",
		"    0% {",
		"        opacity: 0;",
		"        margin-left: -300px;",
		"    }",
		"",
		"    100% {",
		"        opacity: .8;",
		"        margin-left: 3px;",
		"    }",
		"}",
		"",
		"@keyframes showtop {",
		"    0% {",
		"        opacity: 0;",
		"        margin-left: -100px;",
		"    }",
		"",
		"    100% {",
		"        opacity: 1;",
		"        margin-left: 0px;",
		"    }",
		"}",
		"",
		"@keyframes showUI {",
		"    0% {",
		"        opacity: 0;",
		"        margin-top: -50px;",
		"    }",
		"",
		"    100% {",
		"        opacity: 1;",
		"        margin-top: 20px;",
		"    }",
		"}",
		"",
		"@keyframes slowshow {",
		"    0% {",
		"        opacity: 0;",
		"    }",
		"",
		"    100% {",
		"        opacity: 1;",
		"    }",
		"}",
		"",
		"@keyframes clan {",
		"    0% {",
		"        margin-left: -50px;",
		"    }",
		"}",
		"/*滚动条*/",
		"",
		"",
		"",
		"::-webkit-scrollbar-thumb {",
		"    background-color: #8075D3;",
		"}",
		"",
		"::-webkit-scrollbar-thumb:hover {",
		"    background-color: #8075D3;",
		"}",
		"::-webkit-scrollbar {",
		"    width: 5px;",
		"    height: 10px;",
		"    background-color: rgba(0, 0, 0, .12);",
		"}",
		"/*帖子、评论及奔奔*/",
		".am-comment-main{",
		"    border:0;",
		"    box-shadow:0px 0px 10px #404040bd;",
		"    transition:all .3s ease;",
		"}",
		".am-comment-main:hover{",
		"    transform:translateY(-2px);",
		"    box-shadow:0px 0px 30px #404040bd;",
		"}",
		".am-comment-main::before{",
		"    border:0px; ",
		"    background-color:#0000 !important;",
		"}",
		"/*页码*/",
		".am-pagination.am-pagination-centered > li > a{",
		"    border-radius:10px !important;",
		"    transition:all .5s ease;",
		"    box-shadow:0px 0px 10px #000;",
		"}",
		".am-pagination.am-pagination-centered > li > a:hover{",
		"    border-radius:5px !important;",
		"    transform:translateY(-2px);",
		"    box-shadow:0px 0px 5px #000;",
		"}",
		"/*奔*/",
		".feed-selector {",
		"    transition: all .2s ease;",
		"}",
		"",
		".feed-selector:hover {",
		"    border-radius: 3px !important;",
		"    box-shadow: 1px 1px 10px #000 !important;",
		"}",
		"/*顶栏,低栏*/",
		".main-container > main.lfe-body {",
		"    background: transparent !important;",
		"}",
		"",
		".background[data-v-7958fe72] {",
		"    background: transparent !important;",
		"}",
		"",
		".am-comment-main:hover{",
		"    transform:translateY(-2px);",
		"    box-shadow:0px 0px 30px #404040bd;",
		"}",
		".am-comment-main::before{",
		"    border:0px; ",
		"    background-color:#0000 !important;",
		"}",
		"/*侧栏*/",
		"",
		"#app > .lfe-body > a {",
//		"    color: #61eee9f5 !important;",
		"    height: 3.7em;",
		"    margin-top: 3px;",
		"    padding: 0 !important;",
		"}",
		"",
		"",
		"#app > .lfe-body > a:first-of-type {",
		"    margin-top: 10px !important;",
		"}",
		"",
		"#app > .lfe-body > a > .icon {",
		"    line-height: 2.4em;",
		"    font-size: 18px;",
		"    width: 100%;",
		"    margin: 0 !important;",
		"    transition: all 0.2s ease;",
		"}",
		"",
		"#app > .lfe-body > a > .text {",
		"    opacity: 0;",
		"    margin-top: -2em;",
		"    display: block;",
		"    transition: all 0.3s ease;",
		"}",
		"",
		"#app > .lfe-body > a:hover > .icon {",
		"    line-height: 1.5em;",
		"    font-size: 17px;",
		"}",
		"",
		"#app > .lfe-body > a:hover > .text {",
		"    opacity: 1;",
		"    margin-top: 0.2em;",
		"}",
		"",
		"/*提交文件*/",
		".drop[data-v-01cd4e24]{",
		"    border:0;",
		"    transition: all .4s ease;",
		"    border-radius:30px;",
		"    box-shadow:3px 3px 10px #00000080;",
		"}",
		".drop[data-v-01cd4e24]:hover{",
		"    border:0;",
		"    transform:translateY(-10px);",
		"    border-radius:30px;",
		"    box-shadow:10px 10px 30px #0000009e;",
		"}",
		"/*近期比赛*/",
		".am-panel.lg-index-contest.am-panel-danger{",
		"    border-radius:10px;",
		"    margin-left:10px;",
		"    box-shadow:1px 1px 10px #00000075;",
		"    transition:all .3s ease;",
		"}",
		".am-panel.lg-index-contest.am-panel-danger:hover{",
		"    box-shadow:1px 1px 15px #0000008f;",
		"}",
		".am-panel.lg-index-contest.am-panel-success{",
		"    border-radius:10px;",
		"    margin-left:10px;",
		"    box-shadow:1px 1px 10px #00000075;",
		"    transition:all .3s ease;",
		"}",
		".am-panel.lg-index-contest.am-panel-success:hover{",
		"    box-shadow:1px 1px 15px #0000008f;",
		"}",
		"/*最近讨论*/",
		".am-panel.lg-index-contest.am-panel-primary{",
		"    margin-left:0px;",
		"    border-radius:10px;",
		"    border:0px;",
		"    width:38rem;",
		"    box-shadow:1px 1px 10px #00000075;",
		"    transition:all .3s ease;",
		"}",
		".am-panel.lg-index-contest.am-panel-primary:hover{",
		"    box-shadow:1px 1px 15px #0000008f;",
		"}",
		"",
		"/*记录详情 */",
		".wrapper > .test-case {",
		"    border-radius:5px;",
		"    box-shadow:0px 2px 7px #6d6d6d;",
		"    transition: all 0.3s ease;",
		"}",
		"",
		".wrapper > .test-case:hover {",
		"    transform: translateY(-5px);",
		"    box-shadow:0px 3px 15px #404040;",
		"}",
		"",
		".message[data-v-21e0a7cc] {",
		"    border-radius: 10px;",
		"}",
		"/*rated*/",
		".am-badge.am-radius.lg-bg-green {",
		"    background: #00b09b;",
		"  /* fallback for old browsers */",
		"    background: -webkit-linear-gradient(to right, #FCC21A, #1A97FC);",
		"  /* Chrome 10-25, Safari 5.1-6 */",
		"    background: linear-gradient(to right, #FCC21A, #1A97FC);",
		" /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */",
		"    border-radius: 5px;",
		"    transition: all 0.3s ease;",
		"}",
		"",
		".am-badge.am-radius.lg-bg-green:hover {",
		"    transform: translateY(-2px);",
		"}",
		"/*输入框*/",
		".am-form-field {",
		"    font-weight: bold;",
		"    transition: all .2s ease;",
		"    box-shadow: 2px 2px 3px #bab9b9;",
		"    border: 0;",
		"    border-radius: 10px !important;",
		"}",
		"",
		".am-form-field:hover {",
		"    transition: all .2s ease;",
		"    box-shadow: 3px 3px 9px #bab9b9;",
		"}",
		"",
		".refined-input.input-wrap.frame[data-v-66fcc50b][data-v-8cc386e2] {",
		"    border: 0;",
		"}",
		"",
		".lfe-form-sz-middle {",
		"    font-weight: bold;",
		"    transition: all .2s ease;",
		"    box-shadow: 2px 2px 9px #bab9b9;",
		"    border: 0;",
		"    border-radius: 10px !important;",
		"}",
		"",
		".lfe-form-sz-middle:hover {",
		"    box-shadow: 2px 2px 10px #bab9b9;",
		"}",
		"",
		".refined-input.input-wrap.frame {",
		"    border: 0;",
		"}",
		"",
		".lfe-form-sz-small {",
		"    font-weight: bold;",
		"    transition: all .2s ease;",
		"    box-shadow: 2px 2px 10px #bab9b9;",
		"    border: 0;",
		"    border-radius: 10px !important;",
		"}",
		"",
		".lfe-form-sz-small:hover {",
		"    box-shadow: 2px 2px 20px #bab9b9;",
		"}",
		"/*user-header-top*/",
		".user-header-top[data-v-2424f61c][data-v-f9624136] {",
		"    margin-top: -60px !important;",
		"}",
		"",
		"/* -------------------------------- 圆角化 --------------------------------- */",
		"",
		".am-btn.am-btn-sm {",
		"    border-radius: 20px !important;",
		"}",
		"",
		".lfe-caption.tag.status-name[data-v-43a42535] {",
		"    border-radius: 20px !important;",
		"}",
		"",
		".card.padding-default {",
		"    border-radius: 20px !important;",
		"    box-shadow: 0px 0px 0px #8f8f8f;",
		"}",
		"",
		".lg-article {",
		"    animation: slowshow .5s 1;",
		"    transition: all 0.5s ease;",
		"    border-radius: 20px !important;",
		"    box-shadow: 0px 0px 0px #8f8f8f;",
		"}",
		"",
		".dropdown > .center {",
		"    border-radius: 10px !important;",
		"    box-shadow: 5px 5px 17px #525252cc;",
		"}",
		"",
		".popup[data-v-1d675dd8] {",
		"    animation: showAPP .5s 1;",
		"    box-shadow: 5px 5px 17px #8f8f8f7a;",
		"    margin-left: 3px;",
		"    width: 11.4em;",
		"    height: 13.7em;",
		"    background: #fff;",
		"    background-clip: border-box;",
		"    border-radius: 10px !important;",
		"    border: 0px solid rgba(0, 0, 0, .2);",
		"    transition:all 1s;",
		"}",
		".apps a[data-v-1d675dd8] {",
		"    padding: .3em;",
		"    color: #333;",
		"    border-radius: 99px !important;",
		"}",
		"",
		".padding-none[data-v-f9624136] {",
		"    border-radius: 30px !important;",
		"}",
		"/*用户顶栏*/",
		".user-nav[data-v-2dfcfd35] {",
		"    animation: showUI 1s 1;",
		"    transition: all .5s ease;",
		"    margin-top: 20px;",
		"    border-radius: 20px !important;",
		"}",
		"",
		"/*还是卡片*/",
		".card.problem-card.padding-default {",
		"    animation: slowshow .5s 1;",
		"    border-radius: 20px !important;",
		"    box-shadow: 0px 0px 0px #8f8f8f;",
		"}",
		"",
		".card.padding-default {",
		"    transition: all .5s ease;",
		"    border-radius: 20px !important;",
		"    box-shadow: 0px 0px 0px #8f8f8f;",
		"}",
		".inner-card{",
		"    border-radius:10px;",
		"    box-shadow: 1px 1px 10px #00000036;",
		"}",
		".card.user-header-container.padding-0 {",
		"    width: 100%;",
		"    border-radius: 20px !important;",
		"    box-shadow: 0px 0px 0px #8f8f8f;",
		"    height: 400px;",
		"}",
		".card.float-card.padding-0[data-v-f9624136]{",
		"    border-radius:30px !important;",
		"    transition:1s ease;",
		"}",
		".card.float-card.padding-0[data-v-f9624136]:hover{",
		"    border-radius:30px !important;",
		"}",
		".card.user-header-container.padding-0 > .user-header-top {",
		"    height: 320px;",
		"}",
		"",
		".select-button.lfe-form-sz-small {",
		"    border-radius: 10px !important;",
		"}",
		"",
		".progress-frame > div[data-v-47712372] {",
		"    width: 100%;",
		"    height: 100%;",
		"    background: #71BFE6",
		"  /* fallback for old browsers */",
		"    background: -webkit-linear-gradient(to right, #F2874F, #F2874F);",
		"  /* Chrome 10-25, Safari 5.1-6 */",
		"    background: linear-gradient(to right, #F2874F, #F2874F) /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */       !important;",
		"}",
		"",
		".color-default > .lfe-caption {",
		"    border-radius: 20px !important;",
		"    ",
		"}",
		"",
		".tag.color-none > .lfe-caption {",
		"    border-radius: 20px !important;",
		"    transition: all .4s;",
		"    ",
		"}",
		".tag.color-none > .lfe-caption:hover{",
		"    transform:translateY(-2px) !important;",
		"}",
		".selected[data-v-66021821] {",
		"    border-radius: 10px !important;",
		"}",
		"",
		".bottom.float-bottom {",
		"    animation: slowshow 1s 1;",
		"    margin-bottom: 4px;",
		"    border-radius: 20px !important;",
		"    z-index:999;",
		"}",
		"",
		".card.float-card.padding-0 {",
		"    border-radius: 5px !important;",
		"    box-shadow: 1px 1px 20px #5c5c5c !important;",
		"}"
	].join("\n");
if (false || (document.location.href.indexOf("https://www.luogu.com.cn/chat") == 0))
	css += [
		"/*luogu私信*/",
		".card.wrapper.padding-none{",
		"    border-radius:10px !important;",
		"    -webkit-backdrop-filter: blur(20px) !important;",
		"    backdrop-filter: blur(20px) !important;",
		"    box-shadow: 0px 0px 30px #000;",
		"}",
		".message-block.right > .message[data-v-5c0627c6]{",
		"    background-color:#8075D3 !important;",
		"    color:#fff !important;",
		"}",
		"html > body {",
		"    background-image: url(https://cdn.luogu.com.cn/upload/image_hosting/u8c1uvhv.png) !important;",
		"    background-repeat: no-repeat;",
		"    background-size: cover;",
		"    background-position: center;",
		"    background-attachment: fixed;",
		"}",
		".item[data-v-4d6dca7a]:hover{",
		"    border-radius:10px;",
		"    transition: all .3s ease;",
		"    background-color:#8075D3 !important;",
		"    color:#fff;",
		"}"
	].join("\n");
if (typeof GM_addStyle != "undefined") {
	GM_addStyle(css);
} else if (typeof PRO_addStyle != "undefined") {
	PRO_addStyle(css);
} else if (typeof addStyle != "undefined") {
	addStyle(css);
} else {
	var node = document.createElement("style");
	node.type = "text/css";
	node.appendChild(document.createTextNode(css));
	var heads = document.getElementsByTagName("head");
	if (heads.length > 0) {
		heads[0].appendChild(node);
	} else {
		// no head yet, stick it whereever
		document.documentElement.appendChild(node);
	}
}
                 var url = window.location.href;
    async function user_detail(){
        var button = document.createElement('button');
        button.textContent = '复制Md';
        button.style.position = "absolute";
        button.style.top = "100px";button.style.right = "100px";
        window.addEventListener('scroll', function() {
            var scrollY = window.scrollY;
            button.style.top = (100 + scrollY) + 'px';
        });
        button.classList.add('button-lgcm');
        button.addEventListener('click', async function() {
            var introduction = _feInstance.currentData.user.introduction;
            await navigator.clipboard.writeText(introduction);
            alert('复制成功');
        });
        document.body.appendChild(button);
    }
    async function blog(){
            var button = document.createElement('button');
            button.textContent = '复制Md';
            button.style.position = "absolute";
            button.style.top = "100px";button.style.right = "100px";
            window.addEventListener('scroll', function() {
                var scrollY = window.scrollY;
                button.style.top = (100 + scrollY) + 'px';
            });
            button.classList.add('button-lgcm');
            button.addEventListener('click', async function() {
                fetch('/api/blog/detail/' + BlogGlobals.blogID).then(res => res.json()).then(res => navigator.clipboard.writeText(res.data.Content));
                alert('复制成功');
            });
            document.body.appendChild(button);
        };
    async function contest_detail(){
        var button = document.createElement('button');
        button.textContent = '复制Md';
        button.style.position = "absolute";
        button.style.top = "100px";button.style.right = "100px";
        window.addEventListener('scroll', function() {
            var scrollY = window.scrollY;
            button.style.top = (100 + scrollY) + 'px';
        });
        button.classList.add('button-lgcm');
        button.addEventListener('click', async function() {
            var introduction = _feInstance.currentData.contest.description;
            await navigator.clipboard.writeText(introduction);
            alert('复制成功');
        });
        document.body.appendChild(button);
    };
    async function training_detail(){
        var button = document.createElement('button');
        button.textContent = '复制Md';
        button.style.position = "absolute";
        button.style.top = "100px";button.style.right = "100px";
        window.addEventListener('scroll', function() {
            var scrollY = window.scrollY;
            button.style.top = (100 + scrollY) + 'px';
        });
        button.classList.add('button-lgcm');
        button.addEventListener('click', async function() {
            var introduction = _feInstance.currentData.training.description;
            await navigator.clipboard.writeText(introduction);
            alert('复制成功');
        });
        document.body.appendChild(button);
    };
    var style = document.createElement('style');
    style.textContent = `
        .button-lgcm {
            outline:none !important;
            cursor: pointer;
            line-height: 1.25;
            position: relative;
            display: block;
            margin-left: -.0625rem;
            padding: .5rem .75rem;
            color: #fff !important;
            border: .0625rem solid #dee2e6;
            font-size: 15px;
            font-weight: unset;
            display: flex;
            min-width: 36px;
            height: 36px;
            margin: 0 3px;
            border-radius: 100px!important;
            align-items: center;
            justify-content: center;
            transition:all .3s;
            background-color: #F2874F;
        }
        .button-lgcm:hover {
            box-shadow: 0 7px 14px rgba(50,50,93,.1), 0 3px 6px rgba(0,0,0,.08);
            transform: translateY(-1px);
        }
        `;
    document.head.appendChild(style);
    if (url.includes('blog') && !url.includes('Admin') && !url.includes('admin')) {
        var parsedUrl = new URL(url);
        if (url.includes('org')) {
            var path = parsedUrl.pathname.split('/');
            if (path.length >= 2 && path[1] != '') {
                window.addEventListener('load', blog);
            }
        } else {
            var path = parsedUrl.pathname.split('/');
            if (path.length >= 4) {
                console.log('a');
                window.addEventListener('load', blog);
            }
        }
    }
    if (url.includes('user') && !url.includes('notification')) {
        window.addEventListener('load', user_detail);
    }
    if (url.includes('contest') && !url.includes('list') && !url.includes('edit') && !url.includes('contestId')) {
        window.addEventListener('load', contest_detail);
    }
    if (url.includes('training') && !url.includes('edit') && !url.includes('list')) {
        window.addEventListener('load', training_detail);
    }
    // 下面这个变量控制是否要修改个人主页动态中的时间为具体时间,可手动更改为 0
    const chbb = 1;

    // 下面这个函数可以关闭广告。不想关的话注释掉就行了。
    function closeDivsWithAttributes() {
        let attributeValue = '';
        var divElements = document.getElementsByTagName('div');
        for (var i = 0; i < divElements.length; i++) {
            var div = divElements[i];
            if (div.getAttribute('data-v-0a593618') === attributeValue) {
                div.remove();
            }
        }
    }
    setInterval(closeDivsWithAttributes, 250);

    function formatTime(isoDatetime) {
        const date = new Date(isoDatetime);
        const year = date.getFullYear();
        const month = (date.getMonth() + 1).toString().padStart(2, '0');
        const day = date.getDate().toString().padStart(2, '0');
        const hours = date.getHours().toString().padStart(2, '0');
        const minutes = date.getMinutes().toString().padStart(2, '0');
        const seconds = date.getSeconds().toString().padStart(2, '0');
        return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
    }

    // 更改时间显示

    function changeTimeText() {
        let timeElements = document.querySelectorAll('time[data-v-f9624136][datetime]');
        timeElements.forEach((timeElement) => {
            const datetime = timeElement.getAttribute('datetime');
            const formattedTime = formatTime(datetime);
            timeElement.textContent = formattedTime;
        });
        timeElements = document.querySelectorAll('time[data-v-65a77fa1][datetime]');
        timeElements.forEach((timeElement) => {
            const datetime = timeElement.getAttribute('datetime');
            const formattedTime = formatTime(datetime);
            timeElement.textContent = formattedTime;
        });
        timeElements = document.querySelectorAll('time[data-v-85ede732][datetime]');
        timeElements.forEach((timeElement) => {
            const datetime = timeElement.getAttribute('datetime');
            const formattedTime = formatTime(datetime);
            timeElement.textContent = formattedTime;
        });
    }

    setInterval(changeTimeText, 500);

    function extractTimeText(element) {
        const timeElement = element.querySelector('.time');
        return timeElement ? timeElement.getAttribute('title') : null;
    }

    // 更新时间文本

    function updateLastReplyText() {
        const elements = document.querySelectorAll('div[data-v-b0d342de][data-v-f9624136].row.row-space-between.bottom');
        elements.forEach((element) => {
            const linkElement = element.querySelector('a.row.content-left.title.link.color-default');
            const linkElement1 = linkElement.querySelector('div.time');
            const timeText = linkElement1.title;
            if (timeText) {
                const titleText = `最后回复于 ${timeText}`;
                if (linkElement1) {
                    linkElement1.textContent = titleText;
                }
            }
        });
        elements.forEach((element) => {
            const linkElement = element.querySelector('div.row.content-left');
            const linkElement1 = linkElement.querySelector('div.time');
            const timeText = linkElement1.title;
            if (timeText) {
                const titleText = `发表于 ${timeText}`;
                if (linkElement1) {
                    linkElement1.textContent = titleText;
                }
            }
        });
    }

    setInterval(updateLastReplyText, 500);

    function benben(){
        // 找到所有 class 为 span.lfe-caption 的元素
        var elements = document.querySelectorAll('span.lfe-caption');

        // 遍历每个元素并进行操作
        elements.forEach(function(element) {
            var temp = element.textContent;
            // 提取 title 属性中的数字
            var title = element.getAttribute('title');
            if(title){
                var numbers = title.match(/\d+/g);

                if (numbers && numbers.length >= 5) {
                    // 提取第三个数字和第四个数字
                    var thirdNumber = parseInt(numbers[2]);
                    var fourthNumber = parseInt(numbers[3]);

                    // 处理日凌晨的情况
                    if (title.includes("日凌晨")) {
                        if (fourthNumber === 12) {
                            fourthNumber = "0";
                        } else {
                            //fourthNumber = fourthNumber < 10 ? "0" + fourthNumber : fourthNumber.toString();
                        }
                    }

                    // 处理日早上、日上午、日下午、日晚上的情况
                    if (title.includes("日早上") || title.includes("日上午")) {
                        //fourthNumber = fourthNumber < 10 ? "0" + fourthNumber : fourthNumber.toString();
                    } else if (title.includes("日下午") || title.includes("日晚上")) {
                        fourthNumber += 12;
                    }

                    // 补全第二个数和第三个数并更新 text
                    var secondNumber = parseInt(numbers[1]);
                    var secondNumberStr = secondNumber < 10 ? "0" + secondNumber : secondNumber.toString();
                    var thirdNumberStr = thirdNumber < 10 ? "0" + thirdNumber : thirdNumber.toString();
                    var fourthNumberStr = parseInt(fourthNumber) < 10 ? "0" + fourthNumber : fourthNumber.toString();
                    if(fourthNumberStr=="24")fourthNumberStr="12";

                    var newText = `${numbers[0]}-${secondNumberStr}-${thirdNumberStr} ${fourthNumberStr}:${numbers[4]}`;

                    // 更新元素的 text
                    element.textContent = newText;
                    element.setAttribute('title',temp);
                }
            }
        });

    }

})();
window.addEventListener('load',function(){
    var main = document.getElementsByClassName("card padding-default");
    main = main[main.length-1];
    var maintenance = main.getElementsByTagName('div')[0];
    var introduction = main.getElementsByTagName('div')[1];
    if(maintenance.innerText!='系统维护,该内容暂不可见。') return;
    maintenance.style.display="none";
    introduction.style.display="block";
})


原文