Bunyabetu Rate Colorizer

OMCの分野別レートに色を付けるスクリプト

目前為 2024-12-27 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Bunyabetu Rate Colorizer
// @namespace    https://gf.qytechs.cn/
// @version      1.1.1.1.1
// @description  OMCの分野別レートに色を付けるスクリプト
// @author       noppi
// @match        https://onlinemathcontest.com/users/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // 色付けのルール(レート範囲ごとに色を指定)
    const colorRules = [
        { min: 3600,  color: '#ffd700' }, // 金 (Gold)
        { min: 3200,  color: '#c0c0c0' }, // 銀 (Silver)
        { min: 2800,  color: '#ff0000' }, // 赤 (Red)
        { min: 2400,  color: '#ff8000' }, // 橙 (Orange)
        { min: 2000,  color: '#c0c000' }, // 黄 (Yellow)
        { min: 1600,  color: '#0000ff' }, // 青 (Blue)
        { min: 1200,  color: '#00c0c0' }, // 水 (Light Blue)

        { min: 0,     color: '#000000' }  // 黒 (Black)
    ];

    // 分野別レートが含まれているテーブルの<td>要素を取得
    const rateCells = document.querySelectorAll("#rating-container table td");

    // 各レートに色を付ける
    rateCells.forEach(cell => {
        const rate = parseInt(cell.textContent.trim(), 10); // 数値として取得

        if (!isNaN(rate)) { // レートが数値の場合
            const rule = colorRules.find(r => rate >= r.min); // 該当するルールを検索
            if (rule) {
                cell.style.color = rule.color; // 該当する色を適用
                cell.style.fontWeight = 'bold'; // 太字を適用(必要に応じて削除)
            }
        }
    });
})();

QingJ © 2025

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