Lichess Grab Cursor

Changes the cursor to a grab hand when hovering over pieces and to a grabbing hand when dragging pieces.

// ==UserScript==
// @name         Lichess Grab Cursor
// @namespace    https://lichess.org/
// @version      1.0
// @description  Changes the cursor to a grab hand when hovering over pieces and to a grabbing hand when dragging pieces.
// @author       ObnubiladO
// @match        https://lichess.org/*
// @icon         https://webref.ru/assets/images/css/cursor/grab.png
// @grant        none
// @run-at       document-start
// @license      GPL-3.0-or-later
// ==/UserScript==

(function() {
    'use strict';

    // Define the custom CSS
    const customCSS = `
    /* Change cursor to grab when hovering over manipulable pieces */
    .manipulable cg-board {
        cursor: grab !important;
    }

    /* Change cursor to grabbing when a piece is being dragged */
    .manipulable cg-board:has(piece.dragging) {
        cursor: grabbing !important;
    }
    `;

    // Function to inject CSS into the page
    function addGlobalStyle(css) {
        const style = document.createElement('style');
        style.type = 'text/css';
        style.appendChild(document.createTextNode(css));
        document.head.appendChild(style);
    }

    // Inject the custom CSS
    addGlobalStyle(customCSS);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址