LOL.PS主页排版

LOL.PS主页元素排版修改

// ==UserScript==
// @name         LOL.PS主页排版
// @namespace    http://tampermonkey.net/
// @version      2024-10-24
// @description  LOL.PS主页元素排版修改
// @license      Copyright © 2025 Leon. All rights reserved.
// @author       Leon
// @match        https://lol.ps/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=lol.ps
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let flag1 = true;
    let flag2 = true;
    let timer1 = setInterval(changePage, 500);
    let timer2 = null;

    function changePage() {
       if(location.pathname.startsWith('/champ') && flag1) {
          document.querySelector('body > main > div.mx-auto.my-4.w-full.flex.justify-center').style.display = 'none';

            // 召唤师技能 出门装 鞋 挪上来
           const el1 = document.getElementById('content-container');
           const elChild1 = el1.firstElementChild || el1.firstChild;
           const element1 = elChild1.removeChild(elChild1.children[5]);
           const firstChild1 = elChild1.children[0];
           elChild1.insertBefore(element1, firstChild1.nextSibling);

           // 核心装备挪上来
           const el = document.getElementById('content-container');
           const elChild = el.firstElementChild || el.firstChild;
           const element = elChild.removeChild(elChild.children[6]);
           const firstChild = elChild.children[0];
           elChild.insertBefore(element, firstChild.nextSibling);

           flag1 = false;
           flag2 = true;
       }
       else if (location.pathname === '/' && flag2) {
            flag1 = true;
            flag2 = false;

           timer2 = setTimeout(()=> {
              document.querySelector('body > main > div > div.relative.min-w-1080px.overflow-x-visible.pt-14 > div.relative.overflow-x-hidden').style.display = 'none';
              clearTimeout(timer2);
           }, 800);
        }
    }

})();