跳到正文

个人记录

氢洛谷

Accepted123约 18 分钟
原文
文章信息与版本

文章信息

发布
2025年10月6日
收录
2026年1月6日
更新
2026年11月5日
篇幅
约 18 分钟

版本

  1. v1当前

氢洛谷插件

代码
// ==UserScript==
// @name          氢洛谷
// @namespace     http://userstyles.org
// @description	  洛谷美化
// @author        0And1Story
// @homepage      https://userstyles.org/styles/174057
// @run-at        document-start
// @version       0.20190922030246
// ==/UserScript==
(function() {var css = "";
if (false || (new RegExp("^https://www\\.luogu(\\.org|\\.com\\.cn)/(?!blog).*$")).test(document.location.href))
	css += [
		".main-container .lfe-body {",
		"    background-image: url(https://s1.ax1x.com/2018/02/25/9w99XR.jpg);",
		"    background-repeat: no-repeat;",
		"    background-size: cover;",
		"    background-position: center;",
		"    background-attachment: fixed;",
		"}",
		"",
		"#app > .lfe-body > a {",
		"    color: rgb(55, 152, 255) !important;",
		"    height: 3.7em;",
		"    margin-top: 3px;",
		"}",
		"#app > .lfe-body > a > .icon {",
		"    line-height: 2.4em;",
		"    font-size: 20px;",
		"    width: 100%;",
		"    margin: 0 !important;",
		"    transition: all 0.3s ease;",
		"}",
		"#app > .lfe-body > a > .text {",
		"    opacity: 0;",
		"    margin-top: -1em;",
		"    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;",
		"}",
		"",
		".am-input-group {",
		"    transition: box-shadow .15s ease;",
		"    border: none;",
		"    border-radius: .5rem !important;",
		"}",
		".am-form-field {",
		"    border: none;",
		"    border-radius: .5rem !important;",
		"    box-shadow: 0 1px 3px rgba(50, 50, 93, .15), 0 1px 0 rgba(0, 0, 0, .02);",
		"}",
		".am-form-field:focus {",
		"    box-shadow: 0 4px 6px rgba(50, 50, 93, .08), 0 1px 3px rgba(0, 0, 0, .05) !important;",
		"}",
		".am-input-group-sm > .am-form-field,",
		".am-input-group-sm > .am-input-group-btn > .am-btn,",
		".am-input-group-sm > .am-input-group-label {",
		"    font-size: 1.35rem!important;",
		"}",
		".am-input-group-label {",
		"    background: transparent;",
		"    border: none;",
		"}",
		".am-input-group-danger,",
		".am-input-group-primary {",
		"    box-shadow: none;",
		"}",
		".am-input-group-danger > .am-input-group-label,",
		".am-input-group-primary > .am-input-group-label {",
		"    border-radius: .5rem !important;",
		"    outline: none !important;",
		"    letter-spacing: .05em;",
		"    transition: all .15s ease;",
		"    box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08);",
		"    color: #fff !important;",
		"    margin-bottom: 6px;",
		"    height: 33.4px;",
		"}",
		".am-input-group-danger > .am-input-group-label:hover,",
		".am-input-group-primary > .am-input-group-label:hover {",
		"    box-shadow: 0 7px 14px rgba(50, 50, 93, .1), 0 3px 6px rgba(0, 0, 0, .08);",
		"}",
		".am-input-group-danger > .am-input-group-label:active,",
		".am-input-group-primary > .am-input-group-label:active {",
		"    box-shadow: none;",
		"}",
		".am-input-group-danger > .am-input-group-label {",
		"    border-color: #f5365c;",
		"    background-color: #ec0c38;",
		"}",
		".am-input-group-primary > .am-input-group-label {",
		"    border-color: #5e72e4;",
		"    background-color: #5e72e4;",
		"    border-radius: .5rem !important;",
		"}",
		"textarea {",
		"    box-shadow: 0 1px 3px rgba(50, 50, 93, .15), 0 1px 0 rgba(0, 0, 0, .02);",
		"    border: none !important;",
		"}",
		"textarea:focus {",
		"    box-shadow: 0 4px 6px rgba(50, 50, 93, .08), 0 1px 3px rgba(0, 0, 0, .05) !important;",
		"}",
		".lg-input-title {",
		"    margin-bottom: 5px;",
		"    border-radius: 5px;",
		"    border-color: #ddd;",
		"}",
		"",
		"#topbar-search-text {",
		"    border-radius: .5rem 0 0 .5em !important;",
		"}",
		"#topbar-search {",
		"    border-radius: 0 .5rem .5em 0 !important;",
		"    border-color: #5e72e4;",
		"    background-color: #5e72e4;",
		"}",
		"",
		".lg-article,",
		".lg-summary,",
		".lg-article-sub {",
		"    transition: all .15s ease;",
		"    box-shadow: 0 5px 15px rgba(50, 50, 93, .1), 0 5px 8px rgba(0, 0, 0, .07)!important;",
		"    word-wrap: break-word;",
		"    border-radius: .25rem;",
		"}",
		".lg-article:hover,",
		".lg-summary:hover,",
		".lg-article-sub:hover {",
		"    box-shadow: 0 10px 30px rgba(50, 50, 93, .1), 0 5px 15px rgba(0, 0, 0, .07)!important;",
		"}",
		"",
		".am-btn {",
		"    outline: none !important;",
		"    border: none !important;",
		"    letter-spacing: .05em;",
		"    padding: 8px 18px;",
		"    transition: all .15s ease;",
		"    box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08);",
		"    color: #fff !important;",
		"    margin-bottom: 6px;",
		"}",
		".lg-main-content.solution-block {",
		"    margin-top: 0 !important;",
		"}",
		".am-btn:hover {",
		"    box-shadow: 0 7px 14px rgba(50, 50, 93, .1), 0 3px 6px rgba(0, 0, 0, .08);",
		"    transform: translateY(-1px);",
		"}",
		".am-btn:active {",
		"    box-shadow: none;",
		"}",
		".am-btn-danger,",
		".am-btn-danger:hover,",
		".am-btn-danger:active,",
		".am-btn-danger:focus,",
		".am-btn-danger:visited {",
		"    border-color: #f5365c;",
		"    background-color: #ec0c38;",
		"}",
		".am-btn-primary,",
		".am-btn-primary:hover,",
		".am-btn-primary:active,",
		".am-btn-primary:focus,",
		"a.am-btn-primary:visited {",
		"    border-color: #5e72e4;",
		"    background-color: #5e72e4;",
		"}",
		".am-btn-success,",
		".am-btn-success:hover,",
		".am-btn-success:active,",
		".am-btn-success:focus,",
		"a.am-btn-success:visited {",
		"    border-color: #2dce89;",
		"    background-color: #2dce89;",
		"}",
		".am-btn-warning,",
		".am-btn-warning:hover,",
		".am-btn-warning:active,",
		".am-btn-warning:focus,",
		"a.am-btn-warning:visited {",
		"    border-color: #fb6340;",
		"    background-color: #fb6340;",
		"}",
		"",
		".am-badge {",
		"    border-radius: 50px !important;",
		"    padding-left: 10px;",
		"    padding-right: 10px;",
		"    padding-top: 4px;",
		"    padding-bottom: 4px;",
		"    transition: all .15s;",
		"}",
		".am-badge:hover {",
		"    transform: translateY(-1px);",
		"    box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08);",
		"}",
		".am-badge.lg-bg-red {",
		"    background-color: #f80031;",
		"}",
		".am-badge.lg-bg-orange {",
		"    background-color: #ff471d;",
		"}",
		".am-badge.lg-bg-yellow {",
		"    background-color: #ff9d09;",
		"}",
		".am-badge.lg-bg-green {",
		"    background-color: #1aae6f;",
		"}",
		".am-badge.lg-bg-bluelight {",
		"    background-color: #03acca;",
		"}",
		".am-badge.lg-bg-purple {",
		"    background-color: #8e44ad;",
		"}",
		".am-badge.lg-bg-bluedark {",
		"    background-color: #001277;",
		"}",
		".am-badge.am-badge-warning {",
		"    background-color: #fb6340;",
		"}"
	].join("\n");
if (false || (new RegExp("^https://www\\.luogu(\\.org|\\.com\\.cn)/(?!blog).*$")).test(document.location.href))
	css += [
		".lg-article {",
		"    background-color: rgba(255, 255, 255, 0.85);",
		"}",
		".lfe-form-sz-middle {",
		"    transition: 0.2s;",
		"}",
		".copy-btn:hover {",
		"    color: white !important;",
		"    background-color: rgb(52, 152, 219) !important;",
		"}",
		"a {",
		"    transition: 0.3s;",
		"}",
		".card {",
		"    transition: 0.3s;",
		"    opacity: 0.85;",
		"    border-radius: 5px;",
		"}",
		".lg-contact-right:hover {",
		"    background-color: rgba(255, 255, 255, 0);",
		"}",
		".lg-contact-right a:hover,",
		".lg-contact-right span:hover,",
		".lg-contact-left:hover {",
		"    background-color: rgba(255, 255, 255, 0);",
		"}",
		".am-table-striped>tbody>tr:nth-child(odd)>td,",
		".am-table-striped>tbody>tr:nth-child(odd)>th {",
		"    background-color: rgba(255, 255, 255, 0.7);",
		"}",
		"#app > .lfe-body > div:first-child {",
		"    background-color: rgb(55, 152, 255) !important;",
		"}",
		"#app > .lfe-body {",
		"    background-color: white !important;",
		"}",
		".popup-button {",
		"    color: rgb(55, 152, 255) !important;",
		"}",
		".lfe-caption {",
		"    border-radius: 10px !important;",
		"    transition: 0.3s;",
		"}",
		".lfe-caption:hover {",
		"    transform: translate(0, -2px);",
		"}",
		".items li {",
		"    transition: background-color 0.3s !important;",
		"}",
		".items li:hover {",
		"    background-color: rgb(55, 152, 255);",
		"    color: white;",
		"}",
		"button {",
		"    transition: 0.3s;",
		"}",
		".test-case {",
		"    border-radius: 5px;",
		"    transition: 0.3s;",
		"}",
		".test-case:hover {",
		"    transform: translate(0, -3px);",
		"}",
		"a[data-v-a580f5e6] {",
		"    padding: 0 0 !important;",
		"}"
	].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);
	}
}
})();
原文