Skip to content

hide difficulty of Luogu problem by lnw143

Details

Authorlnw143

LicenseNo License

Categorywww.luogu.com.cn

Created

Updated

Size3.2 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Hide the difficulty of Luogu problems.

Notes

Userstyle doesn't have notes.

Source code

/* ==UserStyle==
@name         hide difficulty of Luogu problem
@version      20240622.17.17
@namespace    https://userstyles.world/user/lnw143
@description  Hide the difficulty of Luogu problems.
@author       lnw143
@license      No License
@preprocessor stylus
@var checkbox presetEnable "使用预设" 1
@var select preset "预设" ["'暂无评定'", "'入门'*", "'普及−'", "'普及/提高−'", "'普及+/提高'", "'提高+/省选−'", "'省选/NOI−'", "'NOI/NOI+/CTSC'", "'🤣'"]
@var text     difficultyText   "自定义难度显示文字"   "'入门'"
@var color    difficultyColor  "自定义难度显示颜色"   rgb(254, 76, 97)
==/UserStyle== */
@-moz-document url-prefix("https://www.luogu.com.cn/"),
url-prefix("https://www.luogu.com/") {
	:root {
		if(presetEnable) {
			if(preset=="暂无评定") {
				--difficulty-text: "暂无评定";
				--difficulty-color: rgb(191, 191, 191);
			}
			else if(preset=="入门") {
				--difficulty-text: "入门";
				--difficulty-color: rgb(254, 76, 97);
			}
			else if(preset=="普及−") {
				--difficulty-text: "普及−";
				--difficulty-color: rgb(243, 156, 17);
			}
			else if(preset=="普及/提高−") {
				--difficulty-text: "普及/提高−";
				--difficulty-color: rgb(255, 193, 22);
			}
			else if(preset=="普及+/提高") {
				--difficulty-text: "普及+/提高";
				--difficulty-color: rgb(82, 196, 26);
			}
			else if(preset=="提高+/省选−") {
				--difficulty-text: "提高+/省选−";
				--difficulty-color: rgb(52, 152, 219);
			}
			else if(preset=="省选/NOI−") {
				--difficulty-text: "省选/NOI−";
				--difficulty-color: rgb(157, 61, 207);
			}
			else if(preset=="NOI/NOI+/CTSC") {
				--difficulty-text: "NOI/NOI+/CTSC";
				--difficulty-color: rgb(14, 29, 105);
			}
			else if(preset=="🤣") {
				--difficulty-text: "不是哥们你做题看难度啊";
				--difficulty-color: linear-gradient(to right, rgb(254, 76, 97), rgb(243, 156, 17), rgb(255, 193, 22), rgb(82, 196, 26), rgb(52, 152, 219), rgb(157, 61, 207), rgb(14, 29, 105));
			}
		}
		else {
			--difficulty-text: difficultyText;
			--difficulty-color: difficultyColor;
		}
	}

	a[href*="problem/list?difficulty"] span {
		display: none;
	}
	a[href*="problem/list?difficulty"] {
		pointer-events: none;
	}
	a[href*="problem/list?difficulty"]:before {
		content: var(--difficulty-text);
		background: var(--difficulty-color);
		-webkit-background-clip: text;
		-webkit-text-fill-color: transparent;
		font-weight: bold;
	}
	a[href*="problem/list?difficulty"]:after,
	span:has(> a[href*="problem/list?difficulty"]):before {
		if(presetEnable && preset=="🤣") {
			content: "🤣";
			font-weight: bold;
		}
	}

	.header .difficulty {
		cursor: not-allowed;
	}
	.difficulty a span {
		display: none;
	}
	.difficulty a {
		pointer-events: none;
	}
	.difficulty a:before {
		if(presetEnable && preset=="🤣") {
			content: "🤣";
			background: var(--difficulty-color);
		}
		else {
			content: var(--difficulty-text);
			background: var(--difficulty-color);
		}
		color: rgb(255, 255, 255);

		display: inline-block;
		padding: 0 8px;
		box-sizing: border-box;
		font-weight: 400;
		line-height: 1.5;
		border-radius: 2px;
		font-size: 0.875em;
	}
}

Reviews

No reviews yet.