Skip to content

cursor for grab/drag #64

Description

@eyaler

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions