Greasy Fork is available in English.
Adds A1–E5 chess-style coordinates to Stake Mines tiles
当前为
// ==UserScript==
// @name Stake Mines – Chess Coordinates
// @namespace https://stake.us/
// @version 1.0
// @description Adds A1–E5 chess-style coordinates to Stake Mines tiles
// @match https://stake.us/casino/games/mines
// @run-at document-idle
// @grant none
// @license MIT
// ==/UserScript==
(function () {
'use strict';
const LETTERS = ['A', 'B', 'C', 'D', 'E'];
const GRID_SIZE = 5;
function addCoordinates() {
const tiles = document.querySelectorAll('button.tile[data-testid^="game-tile-"]');
if (tiles.length !== 25) return;
tiles.forEach((tile, index) => {
// Prevent duplicates
if (tile.querySelector('.chess-coord')) return;
const row = Math.floor(index / GRID_SIZE);
const col = index % GRID_SIZE;
const coord = `${LETTERS[col]}${row + 1}`;
const label = document.createElement('div');
label.className = 'chess-coord';
label.textContent = coord;
Object.assign(label.style, {
position: 'absolute',
top: '4px',
left: '6px',
fontSize: '11px',
fontWeight: '700',
color: '#ffffff',
textShadow: '0 0 3px #000',
pointerEvents: 'none',
zIndex: '10'
});
tile.style.position = 'relative';
tile.appendChild(label);
});
}
// Run repeatedly because the grid is re-rendered by Svelte
const observer = new MutationObserver(addCoordinates);
observer.observe(document.body, { childList: true, subtree: true });
addCoordinates();
})();