Greasy Fork

Greasy Fork is available in English.

Stake Blur Script

Blur Stake Logos

当前为 2025-04-15 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Stake Blur Script
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  Blur Stake Logos
// @author       Dave
// @match        *://stake.com/*
// @match        *://stake.bet/*
// @match        *://stake.ac/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
  "use strict";
  const mainBlurValue = "5px";  // Blur for SVGs and images
  const extraBlurValue = "4px"; // Blur for .back.svelte-mru6at.face-down elements

  function blurElements(node) {
    // Blur SVGs with class svelte-md2ju7, except the one with viewBox "0 0 396.11 197.92"
    node.querySelectorAll("svg.svelte-md2ju7").forEach(el => {
      if (el.getAttribute("viewBox") !== "0 0 396.11 197.92") {
        el.style.filter = `blur(${mainBlurValue})`;
      }
    });
    // Blur SVGs with specified width and height attributes
    node.querySelectorAll('svg[width="885"][height="465"]').forEach(el => {
      el.style.filter = `blur(${mainBlurValue})`;
    });
    // Blur images with alt "Stake Logo" (case sensitive)
    node.querySelectorAll('img[alt="Stake Logo"]').forEach(el => {
      el.style.filter = `blur(${mainBlurValue})`;
    });
    // Blur images with alt "stake logo" (lowercase)
    node.querySelectorAll('img[alt="stake logo"]').forEach(el => {
      el.style.filter = `blur(${mainBlurValue})`;
    });
    // Blur images with alt "Sports"
    node.querySelectorAll('img[alt="Sports"]').forEach(el => {
      el.style.filter = `blur(${mainBlurValue})`;
    });
  }

  function blurExtraElements(node) {
    node.querySelectorAll(".back.svelte-mru6at.face-down").forEach(el => {
      el.style.filter = `blur(${extraBlurValue})`;
    });
  }

  function processNode(node) {
    if (node.nodeType === Node.ELEMENT_NODE) {
      blurElements(node);
      blurExtraElements(node);
    }
  }

  processNode(document);

  const observer = new MutationObserver(mutations => {
    mutations.forEach(mutation => {
      mutation.addedNodes.forEach(node => {
        processNode(node);
      });
    });
  });
  observer.observe(document.body, { childList: true, subtree: true });

  setInterval(() => {
    processNode(document);
  }, 1000);
})();