Blacket Rainbow Background

Rainbow background on main containers, profile containers, and body only, keeps UI elements readable

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Blacket Rainbow Background
// @version      1.9
// @description  Rainbow background on main containers, profile containers, and body only, keeps UI elements readable
// @author       monkxy#0001
// @match        https://*.blacket.org/*
// @grant        none
// @namespace https://greasyfork.org/users/1479014
// ==/UserScript==

(function () {
  const rainbowURL = "https://blacket.org/content/rainbow.webp";

  const rainbowCSS = `
    body, html,
    [class*="styles__background"],
    [class*="styles__app"],
    [class*="styles__container"],
    [class*="styles__modal"],
    [class*="styles__page"],
    [class*="styles__root"],
    [class*="styles__sidebar"],
    [class*="styles__topStatsContainer"],
    [class*="styles__statsContainer"],
    [class*="styles__bottomStatsContainer"],
    [class*="styles__statContainer"],
    #app,

    /* Added to cover both the roomSwitcher and other profile containers */
    #roomSwitcher.styles__profileContainer___CSuIE-camelCase,
    div.styles__profileContainer___CSuIE-camelCase[role="button"][tabindex="0"] {
      background-image: url('${rainbowURL}') !important;
      background-size: cover !important;
      background-repeat: no-repeat !important;
      background-position: center center !important;
      background-attachment: fixed !important;
      background-color: black !important;
      color: white !important;
    }

    /* UI elements get solid backgrounds to remain readable */
    textarea, input, select, button {
      background-image: none !important;
      background-color: rgba(0,0,0,0.85) !important;
      color: white !important;
      border-color: white !important;
    }
  `;

  const style = document.createElement("style");
  style.id = "blacket-rainbow-bg-profile-containers";
  style.textContent = rainbowCSS;
  document.head.appendChild(style);
})();