in chess.com for example you have the 'grab' cursor when hovering your pieces and 'grabbing' cursor while grabbing. would be nice to have this as a default or easy option.
otherwise you can do:
.dragging-4a6c1 {
cursor: grabbing;
}
function onMouseenterSquare(evt, domEvt) {
if (evt.piece?.startsWith(playerColorLetter))
myBoard.style.cursor = 'grab'
}
function onMouseleaveSquare(evt, domEvt) {
myBoard.style.cursor = 'auto'
}
as well as myBoard.style.cursor = 'auto' for the onDrop snapback
additional logic is needed to take into account whether it's the player's turn.
in chess.com for example you have the 'grab' cursor when hovering your pieces and 'grabbing' cursor while grabbing. would be nice to have this as a default or easy option.
otherwise you can do:
as well as
myBoard.style.cursor = 'auto'for the onDrop snapbackadditional logic is needed to take into account whether it's the player's turn.