Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to display coordinate on every square #301

Merged
merged 21 commits into from
May 1, 2024

Conversation

unicolored
Copy link
Contributor

Hello!

I'm Gilles. This is my first PR, inspired by an old electronic chess game.
Capture d’écran 2024-05-01 à 10 46 15

This enhancement introduces a feature to display coordinates on every square, which can help with visual learning and quicker square identification.
Capture d’écran 2024-05-01 à 11 20 22

Key Features:

  • New coordinatesOnSquares option in HeadlessState, defaults to false.
  • Compatible with both white and black orientations.
  • Coordinates adjust based on the ranksPosition to display on the top left or right side of the squares.

Demo:

      Chessground(document.getElementById('board-4'), {
        orientation: 'black',
        coordinatesOnSquares: true,
        ranksPosition: 'left'
      });
      Chessground(document.getElementById('board-5'), {
        orientation: 'white',
        coordinatesOnSquares: true
      });

Testing:

I've tested this feature across various board configurations and verified that the coordinates adjust correctly with changes in size, orientation and ranksPosition.

Looking forward yo your feedback 😊

src/wrap.ts Outdated Show resolved Hide resolved
@ornicar
Copy link
Collaborator

ornicar commented May 1, 2024

Nice, thanks!

@ornicar ornicar merged commit d115014 into lichess-org:master May 1, 2024
2 checks passed
@ornicar
Copy link
Collaborator

ornicar commented May 1, 2024

9.1.0 published

@EvanCarroll
Copy link

I see the option "Coordinates on every square" in the trainer. But I don't have the setting on lichess.com under Preferences -> Display.
I would expect to find it here https://lichess.org/account/preferences/display

Can we get this added there too. I'd love to use this to learn the coordinates in live games.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants