YouTube TimedReaction Adjustment

YouTubeライブ配信のTimedReaction(スタンプ)ボタンの透過&位置を微調整する

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         YouTube TimedReaction Adjustment
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  YouTubeライブ配信のTimedReaction(スタンプ)ボタンの透過&位置を微調整する
// @author       Rambo Panda
// @match        https://www.youtube.com/*
// @grant        none
// @license MIT
// ==/UserScript==


(function() {
    'use strict';

    // Reaction control panel overlayの位置調整
    var overlay = document.querySelector("#reaction-control-panel-overlay.yt-live-chat-renderer");
    if (overlay) {
        overlay.style.right = "10px";
        overlay.style.bottom = "35px";
    }

    // Collapsed buttonの透過率設定
    var collapsedButton = document.querySelector("div#collapsed-button");
    if (collapsedButton) {
        collapsedButton.style.opacity = "0.4";
    }

    // ライトテーマ用
    var lightThemeElements = document.querySelectorAll("yt-reaction-control-panel-view-model:not([is-dark-theme]) #fab-container.yt-reaction-control-panel-view-model:not([is-dark-theme])");
    lightThemeElements.forEach(function(element) {
        element.style.backgroundColor = "rgba(255, 255, 255, 0.1)";
    });

    // ダークテーマ用
    var darkThemeElements = document.querySelectorAll("yt-reaction-control-panel-view-model[is-dark-theme] #fab-container.yt-reaction-control-panel-view-model");
    darkThemeElements.forEach(function(element) {
        element.style.backgroundColor = "rgba(0, 0, 0, 0.2)";
        element.style.outline = "1px solid rgba(100, 100, 100, 0.2)";
    });
})();