Minimalistic FMP

A new and modern look to FMP

// ==UserScript==
// @name         Minimalistic FMP
// @license      MIT
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  A new and modern look to FMP
// @author       FC Cortadura / Selo
// @match        https://footballmanagerproject.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=footballmanagerproject.com
// @grant        GM_addStyle
// ==/UserScript==


(function() {

    const observer = new MutationObserver((mutations, obs) => {
        const fmpSearch = document.querySelector('.fmp-search');

        if (fmpSearch && fmpSearch.parentElement?.parentElement) {
            const abuelo = fmpSearch.parentElement.parentElement;
            if (abuelo.tagName === 'DIV') {
                abuelo.id = 'search-button-container';

                const flexElement = abuelo.parentElement;
                flexElement.style.order = -1;

                const textDiv = abuelo.querySelector('.text');
                if (textDiv) {
                    textDiv.textContent = '';
                }

                obs.disconnect();
            }
        }
    });

    const observer2 = new MutationObserver((mutations, obs) => {
        const buttons = document.querySelectorAll('#matches-footer .fmpbtn');
        if (buttons.length >= 2) {
            buttons[0].innerHTML = '<i class="sidenav-icon fmp-icons fmp-cup"></i>';
            buttons[1].innerHTML = '<i class="sidenav-icon fmp-icons fmp-cup"></i>';
            obs.disconnect();
        }
    });


    observer.observe(document.body, {
        childList: true,
        subtree: true
    });



    const target = document.querySelector('#search-button-container .text');

    if (target) {
        target.remove();
    }


   document.querySelectorAll('.dropdown-divider').forEach(el => el.remove());

    const url = window.location.href;

    switch(url){
        case "https://footballmanagerproject.com/Team/Home":

           observer2.observe(document.body, {
               childList: true,
               subtree: true
            });
            GM_addStyle(`


                    .d-flex .fixmatch td.logo img{
                      height: 40px;
                      max-width: 56px;
                    }

                    .d-flex .fixmatch .stadium{
                      line-height: 5px;
                    }

                    .d-flex .fixmatch .team{
                       font-size: 1.2em;
                    }


                    .d-flex .fixmatch td.sep {
                       font-size: 30px;
                       font-weight: 200;
                    }

                    .d-flex .fixmatch td.sep a {
                       color: var(--font-color);
                    }

                    .d-flex .fixmatch .small-shirt{
                      font-size: 40px;
                    }

                    .d-flex .fixmatch .small-shirt .shield-back{
                      margin-right: -40px;
                    }

                    #main-dflex{
                     display: grid !important;
                     grid-template-columns: 2fr 2fr 2fr 1.5fr;
                     grid-template-areas:
                           "events matches matches forum"
                           "events matches matches forum"
                           "structures notes supporters forum";
                     }

                    .box:has(#agendaItem){
                       grid-area: events;
                    }

                    .box:has(#last-matches){
                       grid-area: matches;
                    }

                    .box:has(#structures){
                       grid-area: structures;
                    }

                    .box:has(#lastNatPosts){
                       grid-area: forum;
                    }

                    .box:has(#federationItem){
                       display: none;
                    }


                    .box:has(#supportersItem){
                       grid-area: supporters;
                    }

                    .box:has(#notesItem){
                       grid-area: notes;
                    }

                     .d-flex .header .lheader{
                     display: none;
                     }


            `)
            break;

    }

})();

GM_addStyle(`


   /*** VARIABLES SECTION ***/

  :root{
    --main-color: #1b380d; /* Pine Green */
    --hover-color: #496e36;
    --font-color: #e6d9ae; /* Bone White */
    --bright-background-color: #c3d1be /* Green White */

  }



   /*** VARIABLES END ***/


   /*** NAVBAR SECTION ***/

    .dropdown:hover .dropdown-menu{
        display: unset;
        position: absolute;
        right: 0;
    }

   .fmp-navbar-theme{
     color: #e6d9ae;

   }

   #nav-right{
    box-shadow: 0 0 10px #0007;
    padding: 5px;
    background-color: #1b380d;
    border-radius: 10px;
   }

   #nav-right-right{
     margin-left: 30px !important;
   }


   #search-button-container{
     display: flex;
     align-items: center;
     background-color: var(--main-color);
     border: 2px solid #e6d9ae;
     border-radius: 25px;
     padding: 5px 8px;
     box-sizing: border-box;
     width: 80px;
     transition: width 0.3s ease;
   }

   #search-button-container:hover, .fmp-search:focus {
     width: 160px;
   }

   #search-button-container .icon{
     background: transparent;
     border: none;
     outline: none;
     flex: 1;
     padding: 4px;
    }

   .fmp-search{
     right: 0;
   }

   .fmp-navbar-acolor{
     color: var(--font-color);
   }

    #search-button-container .icon {
       text-align: right;
     }

     #layout-navbar{
       position: sticky !important;
       top: 0 !important;
       z-index: 70;
      }

      #layout-navbar{
        box-shadow: 0 4px 50px #0008;
        border-bottom: 5px solid var(--main-color);
      }


     #layout-navbar-collapse .dropdown-menu .dropdown-item, #layout-navbar-collapse .dropdown-menu{
       background-color: var(--main-color);
       color: var(--font-color);
      }


     .dropdown-menu-end[data-bs-popper], .dropdown:hover .dropdown-menu-end{
        right: 0;
        left: -180px;
      }

      .dropdown-divider{
         border: none;
      }


      #layout-navbar-collapse .dropdown-menu .dropdown-item:hover{
         background-color: var(--hover-color) !important;

       }


       #layout-navbar-collapse .dropdown-menu .dropdown-item{
          margin-bottom: 3px;
       }

      #layout-navbar-collapse .dropdown-menu .dropdown-item .text:hover{
         background-color: var(--hover-color) !important;
      }


      .navbar-season{
        color: var(--font-color);
      }

      /*** NAVBAR ENDS ***/

     /*** SIDENAV SECTION ***/

     .sidebar-logo .manager-name{
        text-align: center;
        margin-top: 5px;
     }

     .sidebar-logo .manager-name, .sidebar-logo .team-name{
        color: var(--font-color);
     }

     .sidebar-logo .logo{
       margin: 5px 10px;
     }

      #layout-sidenav{
        display: block;
      }

      .sidenav-inner{
        position: sticky;
        top: 0;
      }

      .sidenav-inner > .sidebar-logo{
         border-bottom: 1px solid #55b93666;
         width: 100%;
         height: 15vh;
      }

      /*** SIDENAV ENDS ***/

      .layout-wrapper, .layout-inner, .layout-container, .sidenav-vertical{
        overflow: visible !important;
      }

      .body{
        background: url(../images/grassbkg.png);
      }


    /*** MAIN ***/

    .d-flex .fixmatch.unpl{
      background: linear-gradient(45deg, #2b2929, #565555);
    }

    .d-flex a{
       color: var(--font-color);
    }



    `);

QingJ © 2025

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