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鈥檒l 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 a虁 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 a虁 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

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

2 participants