您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Applies custom styling to Chess.com board components.
您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
- // ==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);