TM - FM skills color scheme

Football Manager 2007 colors

目前為 2024-11-06 提交的版本,檢視 最新版本

// ==UserScript==
// @name         TM - FM skills color scheme
// @version      1.1
// @license MIT
// @description  Football Manager 2007 colors
// @author       Haydar - FC Marcimenium
// @match        https://trophymanager.com/players/*
// @grant        none
// @namespace https://gf.qytechs.cn/users/1392085
// ==/UserScript==

// it works on single player page

setInterval(function(){
$('.skill_table img[src$="/pics/star_silver.png"]').replaceWith('19');
$('.skill_table img[src$="/pics/star.png"]').replaceWith('20');

$('.hover img[src$="/pics/star_silver.png"]').replaceWith('19');
$('.hover img[src$="/pics/star.png"]').replaceWith('20');

$("td.skill").attr("style", "unset");

(function() {
    'use strict';

    function find_color(br){
       switch(br){
           case 1:
           case 2:
           case 3:
           case 4:
           case 5:
               return "darkgrey"
               break;
           case 6:
               return "grey"
               break;
           case 7:
           case 8:
           case 9:
               return "lightgrey"
           case 10:
           case 11:
           case 12:
               return "#f7fca3"
               break;
           case 13:
           case 14:
           case 15:
               return "yellow"
               break;
           case 16:
           case 17:
           case 18:
               return "#fea12a"
           case 19:
           case 20:
               return "#ff7f24"
               break;
           default:
               return ""
       }
    }

    //Get the Table cells for the skills in both pages
    var td = $("td.align_center, td.skill > div")

    td.each(function() {
        var color = find_color(parseInt($(this).text())); // Parse the text content as an integer
        $(this).css("color", color).removeClass("subtle"); // Apply color style to the element and remove class
        $(this).css("font-weight", "bold").css("text-shadow", "0 0 1px #000");

        // Get the original text
    var originalText = $(this).text();

        if($(this).hasClass("one_up") || $(this).hasClass("d_arrow_up"))
        {
            // Create the SVG element with dark red color
            var svg = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="vertical-align: middle;" viewBox="0 4 20 24" width="8" height="18"><path fill-rule="evenodd" clip-rule="evenodd" stroke="#006400" stroke-linejoin="round" d="M4 23L12 17L20 23 M4 13L12 7L20 13" stroke-width="4"></path></svg>';

            // Append the original text and SVG to the <td>
            $(this).html(originalText + svg).removeClass("one_up").addClass("d_arrow_up");
        }

        else if($(this).hasClass("part_up") || $(this).hasClass("s_arrow_up"))
        {
            // Create the SVG element with dark red color
            svg = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="vertical-align: middle;" viewBox="0 4 20 24" width="8" height="18"><path fill-rule="evenodd" clip-rule="evenodd" stroke="#309430" stroke-linejoin="round" d="M4 18L12 12L20 18" stroke-width="4"></path></svg>';

            // Append the original text and SVG to the <td>
            $(this).html(originalText + svg).removeClass("part_up").addClass("s_arrow_up");
        }

        else if($(this).hasClass("part_down") || $(this).hasClass("s_arrow_down"))
        {
            // Create the SVG element with dark red color
            svg = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="vertical-align: middle;" viewBox="0 4 20 24" width="8" height="18"><path fill-rule="evenodd" clip-rule="evenodd" stroke="#BB3030" stroke-linejoin="round" d="M4 12L12 18L20 12" stroke-width="4"></path></svg>';

            // Append the original text and SVG to the <td>
            $(this).html(originalText + svg).removeClass("part_down").addClass("s_arrow_down");
        }

        else if($(this).hasClass("one_down") || $(this).hasClass("d_arrow_down"))
        {
            // Create the SVG element with dark red color
            svg = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="vertical-align: middle;" viewBox="0 4 20 24" width="8" height="18"><path fill-rule="evenodd" clip-rule="evenodd" stroke="#8B0000" stroke-linejoin="round" d="M4 17L12 23L20 17 M4 7L12 13L20 7" stroke-width="4"></path></svg>';

            // Append the original text and SVG to the <td>
            $(this).html(originalText + svg).removeClass("one_down").addClass("d_arrow_down");
        }

        else
        {
            // Create the empty SVG element to align the other cells
            svg = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="vertical-align: middle;" viewBox="0 4 20 24" width="8" height="18"><path fill-rule="evenodd" clip-rule="evenodd" stroke="transparent" stroke-linejoin="round" d="" stroke-width="4"></path></svg>';

            // Append the original text and SVG to the <td>
            $(this).html(originalText + svg);
        }

        $(this).children("svg").css("filter", "drop-shadow(0 0 1px #000)");
    });

})();
}, 500)

QingJ © 2025

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