Twitch Stream Channel Banner

Moves the broadcast information block down the page on Twitch.

当前为 2024-12-11 提交的版本,查看 最新版本

// ==UserScript==
// @name         Twitch Stream Channel Banner
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Moves the broadcast information block down the page on Twitch.
// @author       sandEulle
// @match        *://www.twitch.tv/* 
// @license      MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Функция для применения стилей
    function addCustomStyles() {
        const style = document.createElement('style');
        style.textContent = `
            /* Перемещаем блок вниз */
            .channel-root__upper-watch {
                position: fixed !important;
                bottom: 0 !important;
                left: 0 !important;
                width: 100% !important;
                z-index: 1000 !important;
                background: rgba(0, 0, 0, 0.8) !important; /* Темный полупрозрачный фон */
            }

            /* Убираем отступы */
            .channel-root__upper-watch .Layout-sc-1xcs6mc-0 {
                margin: 0 !important;
            }
        `;

        // Добавляем стили в head документа
        document.head.appendChild(style);
    }

    // Ожидание загрузки страницы перед добавлением стилей
    const observer = new MutationObserver(() => {
        if (document.querySelector('.channel-root__upper-watch')) {
            addCustomStyles();
            observer.disconnect(); // Останавливаем наблюдатель после применения изменений
        }
    });

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

QingJ © 2025

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