viresh-ratnakar / exolve

Online interactive crossword software in JavaScript
MIT License
74 stars 15 forks source link

option to add generic text in lower left (or perhaps lower right) corner of squares #38

Closed erikstar closed 4 years ago

erikstar commented 4 years ago

Hi!

A feature request which for me should make it better with "turning words". And instead of asking for options with Arrows, I ask for a generic version...

https://fripp.changeip.org/melodikryss/melodikryss1/index_clues.html

You can see how I use the numbering corner to solve this, but actually I would prefer to have something like this:

exolve-grid: 0.0000000. 0{↳}00..0.000 .... Perhaps the down right corner is the best place...

Hope it is OK to ask for features... as I hope you already notice I think your program is excellent!

/Erik S

viresh-ratnakar commented 4 years ago

"Hope it is OK to ask for features.."

Of course! I welcome bug reports and feature requests--that's how software improves!

I will go through all the reports that you have filed and will respond as soon as I can, thanks.

Viresh

viresh-ratnakar commented 4 years ago

You can do this by adding the extra text through customizeExolve.

function addBottomLeftTurn(puz, row, col) {
  const turn = document.createElementNS('http://www.w3.org/2000/svg', 'text');
  turn.setAttributeNS(null, 'x', puz.cellLeftPos(col, puz.NUMBER_START_X));
  turn.setAttributeNS(null, 'y', puz.cellTopPos(row, puz.squareDim - 3));
  turn.setAttributeNS(null, 'class', 'xlv-cell-num');
  turn.style.fill = puz.colorScheme['light-label']
  turn.style.fontSize = puz.numberSize + 'px'
  const num = document.createTextNode('↳')
  turn.appendChild(num);
  puz.svg.appendChild(turn)
}
function customizeExolve(puz) {
  // ... other customizations
  addBottomLeftTurn(puz, 1, 0)
  addBottomLeftTurn(puz, 1, 7)
}

Similar to addBottomLeftTurn(), you can also create an addTopRightTurn().

erikstar commented 4 years ago

Very cool! thanks. I haven't tried yet. For me it almost works almost perfect with the
exolve-nodir:

j9 [↴]

#j1 [↵]
#a1 [⬑]

Even though it is up to the left... but it work