Chess.com Game Preview Styling

Applies custom styling to Chess.com board components.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Chess.com Game Preview Styling
// @namespace    http://tampermonkey.net/
// @version      1.6
// @description  Applies custom styling to Chess.com board components.
// @author       SaberSpeed77
// @match        https://www.chess.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=chess.com
// @grant        none
// @license      MIT
// ==/UserScript==
 
const imgs = new Map([
  /* White Pieces */
  ["wp", ""],
  ["wn", ""],
  ["wb", ""],
  ["wr", ""],
  ["wq", ""],
  ["wk", ""],

  /* Black Pieces */
  ["bp", ""],
  ["bn", ""],
  ["bb", ""],
  ["br", ""],
  ["bq", ""],
  ["bk", ""],
]);

/* Background */
const background = "";

/*========= ↑ STYLE / CODE ↓ =========*/

const styleElement = document.createElement("style");
const CSS = `
*:not(svg) {
  --theme-piece-set-wp: url(${imgs.get("wp")});
  --theme-piece-set-wn: url(${imgs.get("wn")});
  --theme-piece-set-wb: url(${imgs.get("wb")});
  --theme-piece-set-wr: url(${imgs.get("wr")});
  --theme-piece-set-wq: url(${imgs.get("wq")});
  --theme-piece-set-wk: url(${imgs.get("wk")});

  --theme-piece-set-bp: url(${imgs.get("bp")});
  --theme-piece-set-bn: url(${imgs.get("bn")});
  --theme-piece-set-bb: url(${imgs.get("bb")});
  --theme-piece-set-br: url(${imgs.get("br")});
  --theme-piece-set-bq: url(${imgs.get("bq")});
  --theme-piece-set-bk: url(${imgs.get("bk")});

  --theme-board-style-image: url(${background});
}
`

styleElement.appendChild(document.createTextNode(CSS));
document.head.appendChild(styleElement);