Skip to content

Commit

Permalink
Added seperate and impr
Browse files Browse the repository at this point in the history
  • Loading branch information
charandeepsinghb committed Nov 13, 2023
1 parent 2aa766d commit 2590121
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@
<label>Justify</label>
<input type="checkbox" onclick="changeJustify(event.target.checked)">
</div>
<div>
<label>Seperate</label>
<input type="checkbox" onclick="changeSeperate(event.target.checked)">
</div>
<div>
<label>Word space:</label>
<div>
Expand Down Expand Up @@ -205,10 +209,10 @@
<div>
<label>Column width:</label>
<div>
<button onpointerdown="continuousEmitterStart(increaesDecreaseColumnWidth, -2, 20)"
<button onpointerdown="continuousEmitterStart(increaesDecreaseColumnWidth, -0.5, 20)"
onpointerup="continuousEmitterStop(increaesDecreaseColumnWidth)"
onpointerleave="continuousEmitterStop(increaesDecreaseColumnWidth)">-</button>
<button onpointerdown="continuousEmitterStart(increaesDecreaseColumnWidth, 2, 20)"
<button onpointerdown="continuousEmitterStart(increaesDecreaseColumnWidth, 0.5, 20)"
onpointerup="continuousEmitterStop(increaesDecreaseColumnWidth)"
onpointerleave="continuousEmitterStop(increaesDecreaseColumnWidth)">+</button>
<input id="currentColumnWidth" min="1" max="100" type="number" value="100"
Expand Down
10 changes: 10 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,13 @@ function increaesDecreaseLineHeight(increaseDecreaseValue) {
setInputValue(newNumberLineHeight, 'currentLineHeight');
baniSection.style.lineHeight = newNumberLineHeight;
}

/*********************** Seperate line *************************/

function changeSeperate(isOn) {
if (isOn) {
baniSection.innerHTML = baniSection.innerHTML.replaceAll(/(?!.{0,30}<br>)(?!<br>)/g, '॥<br data-mybreak="true">');
return;
}
baniSection.innerHTML = baniSection.innerHTML.replaceAll('॥<br data-mybreak="true">', '॥');
}

0 comments on commit 2590121

Please sign in to comment.