Skip to content

Commit

Permalink
create parent element and change class name
Browse files Browse the repository at this point in the history
  • Loading branch information
BSmick6 committed May 8, 2024
1 parent 8521b9c commit d04042c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/wrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ export function renderWrap(element: HTMLElement, s: HeadlessState): Elements {
const ranksPositionClass = s.ranksPosition === 'left' ? ' left' : '';

if (s.coordinatesOnSquares) {
const rankN: (i: number) => number = s.orientation === 'white' ? i => i + 1 : i => 8 - i;
files.forEach((f, i) =>
container.appendChild(
// const rankN: (i: number) => number = s.orientation === 'white' ? i => i + 1 : i => 8 - i;
const coordsContainer = createEl('coords-container')
container.appendChild(coordsContainer)
files.forEach(f =>
coordsContainer.appendChild(
renderCoords(
ranks.map(r => f + r),
'squares rank' + rankN(i) + orientClass + ranksPositionClass,
'ranks' + orientClass + ranksPositionClass,
),
),
);
Expand Down

0 comments on commit d04042c

Please sign in to comment.