洛谷用户名优化 Luogu username optimize

让你的洛谷用户名变成紫色并添加管理员标签,让自己变成管理员QAQ

目前为 2019-05-19 提交的版本。查看 最新版本

// ==UserScript==
// @name         洛谷用户名优化 Luogu username optimize
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  让你的洛谷用户名变成紫色并添加管理员标签,让自己变成管理员QAQ
// @author       gandyli
// @match        https://www.luogu.org/*
// @match        http://www.luogu.org/*
// @match        https://www.luogu.org
// @match        http://www.luogu.org
// @match        https://www.luogu.org/space/show?uid=*
// @match        http://www.luogu.org/space/show?uid=*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var css = "";
if (false || (new RegExp("^((?!blog).)*https://www.luogu.org((?!blog).)*$")).test(document.location.href) || (new RegExp("^((?!blog).)*http://www.luogu.org((?!blog).)*$")).test(document.location.href) || (new RegExp("^((?!blog).)*https://www2.luogu.org((?!blog).)*$")).test(document.location.href) || (new RegExp("^((?!blog).)*http://www2.luogu.org((?!blog).)*$")).test(document.location.href))
{// 如果你使用了氩洛谷
    css += [
        "a[class^=\"lg-fg-\"][href*=\"84282\"] {",
"    color: #8e44ad !important;",
"}",
"a[class^=\"lg-fg-\"][href*=\"84282\"]:after {",
"    content:\"管理员\";",
"    display: inline-block;",
"    min-width: 10px;",
"    padding: .25em .625em;",
"    font-size: 1.2rem;",
"    font-weight: 700;",
"    color: #fff;",
"    line-height: 1;",
"    vertical-align: baseline;",
"    white-space: nowrap;",
"    background-color: #8e44ad;",
"    border-radius: 50px;",
"    margin-left: 3px;",
"    padding-left: 10px;",
"    padding-right: 10px;",
"    padding-top: 4px;",
"    padding-bottom: 4px;",
"    transition: all .15s;",
"}"
	].join("\n");
    // 如果你没有使用氩洛谷

  /* css += [
      "a[class^=\"lg-fg-\"][href*=\"84282\"] {",
"    color: #8e44ad !important;",
"}",
"a[class^=\"lg-fg-\"][href*=\"84282\"]:after {",
"    content:\"管理员\";",
"    display: inline-block;",
"    min-width: 10px;",
"    padding: .25em .625em;",
"    font-size: 1.2rem;",
"    font-weight: 700;",
"    color: #fff;",
"    line-height: 1;",
"    vertical-align: baseline;",
"    white-space: nowrap;",
"    background-color: #8e44ad;",
"    margin-left: 3px;",
"    transition: all .15s;",
"}"
      ].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);
	}
}
}})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址