// ==UserScript== // @name phigros in luogu // @namespace http://tampermonkey.net/ // @version 2024-07-25 // @description phigros in luogu,测试 // @author You // @match https://www.luogu.com.cn/* // @grant none // @license MIT // @downloadURL https://update.greasyfork.icu/scripts/501823/phigros%20in%20luogu.user.js // @updateURL https://update.greasyfork.icu/scripts/501823/phigros%20in%20luogu.meta.js // ==/UserScript== (function () { 'use strict'; function setName(lv, ratio) { if (typeof (ratio) == "string" && ratio[ratio.length - 1] == "%") ratio = ratio.substring(ratio, ratio.length - 1) / 100; function calclv(l, r) { if (ratio > 1) ratio = 1; return Math.floor(l + (r - l) * Math.pow((1 - ratio), 3) + 0.5); } let s = lv.innerText; if (s == "暂无评定" || s == "入门" || s == "普及−" || s == "普及/提高−" || s == "普及+/提高" || s == "提高+/省选−" || s == "省选/NOI−" || s == "NOI/NOI+/CTSC" || s.includes("EZ") || s.includes("HD") || s.includes("IN") || s.includes("AT")) { let color = lv.style.background == "" ? lv.style.color : lv.style.background; if (color == "rgb(254, 76, 97)") lv.innerText = "EZ" + (ratio == undefined ? "" : " Lv." + calclv(1, 3)); if (color == "rgb(243, 156, 17)") lv.innerText = "EZ" + (ratio == undefined ? "" : " Lv." + calclv(3, 7)); if (color == "rgb(255, 193, 22)") lv.innerText = "HD" + (ratio == undefined ? "" : " Lv." + calclv(7, 10)); if (color == "rgb(82, 196, 26)") lv.innerText = "HD" + (ratio == undefined ? "" : " Lv." + calclv(9, 12)); if (color == "rgb(52, 152, 219)") lv.innerText = "IN" + (ratio == undefined ? "" : " Lv." + calclv(12, 14)); if (color == "rgb(157, 61, 207)") lv.innerText = "IN" + (ratio == undefined ? "" : " Lv." + calclv(13, 15)); if (color == "rgb(14, 29, 105)") lv.innerText = "AT" + (ratio == undefined ? "" : " Lv." + calclv(15, 16)); if (color == "rgb(191, 191, 191)") lv.innerText = "SP" + (ratio == undefined ? "" : " Lv. ?"); } } setInterval(() => { if (location.pathname.includes("/problem/")) { if (location.pathname.includes("list")) { let tmp = document.getElementsByClassName("row"); // console.log(tmp); for (let i=0; i