treningisportowe

treningisportowe.pl — ukrywa niektóre treningi i elementy

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         treningisportowe
// @namespace    http://tampermonkey.net/
// @version      2025-06-24
// @description  treningisportowe.pl — ukrywa niektóre treningi i elementy
// @author       pow
// @match        https://www.treningisportowe.pl/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=treningisportowe.pl
// @grant        none
// ==/UserScript==

// W chromie w opcjach rozszerzenia trzeba zaznaczyć: "Zezwalaj na skrypty użytkownika"
(function() {
    'use strict';

    // Ukrywanie na widoku dnia
    document.querySelectorAll('h3').forEach(el => {
        const text = el.textContent.toLowerCase();
        if (
            text.includes('plus') ||
            text.includes('kobiet') ||
            text.includes('wprowadzenie') ||
            text.includes('ustawienia') ||
            text.includes('liga') ||
            text.includes('nauka')
        ) {
            const next = el.nextElementSibling;
            el.remove();
            if (next && next.tagName.toLowerCase() === 'div') {
                next.remove();
            }
        }
    });

    // Ukrywanie na widoku miesiąca
    Array.from(document.querySelectorAll(".training a")).forEach(n => {
        if (
            n.innerText.includes('Plus') ||
            n.innerText.includes('Kobiet') ||
            n.innerText.includes('Nauka') ||
            n.innerText.includes('Ustawienia') ||
            n.innerText.includes('Liga') ||
            n.innerText.includes('Wprowadzenie')
        ) {
            n.parentNode.style.display = 'none';
        }
    });

    // Drobne poprawki wyglądu
    document.querySelectorAll("[id^='arrow_open_']").forEach(el => el.style.display = 'none');
    document.body.style.backgroundImage = 'none';
    document.querySelector('.logo_container')?.style.setProperty('display', 'none');
    document.querySelector('.big_title')?.style.setProperty('display', 'none');
    const tab = document.querySelector('#tab_ct_2 table');
    if (tab && document.querySelector('#column_bg')) {
        document.querySelector('#column_bg').style.minHeight = tab.offsetHeight + 'px';
    }

    document.querySelectorAll('.training a').forEach(link => {

        link.innerHTML = link.innerHTML.replace(/BARSKA/gi,
                                                match => `<span style="background-color: #156B50FF; color: white;">${match}</span>`);
        link.innerHTML = link.innerHTML.replace(/BRACI ZAŁUSKICH/gi,
                                                match => `<span style="background-color: #1E71ABFF; color: white;">${match}</span>`);
        link.innerHTML = link.innerHTML.replace(/BANACHA/gi,
                                                match => `<span style="background-color: #004CA2FF; color: white;">${match}</span>`);
        link.innerHTML = link.innerHTML.replace(/STAFFA/gi,
                                                match => `<span style="background-color: #B59884FF; color: white;">${match}</span>`);
        link.innerHTML = link.innerHTML.replace(/SKARŻYŃSKIEGO/gi,
                                                match => `<span style="background-color: #A85A32FF; color: white;">${match}</span>`);

    });


})();