const e = document.getElementById("edit"), r = document.getElementById("read");
const u = () => r.innerHTML = e.innerHTML.split(" ").map(w => `${w.split("").slice(0,Math.ceil(w.length/2)).join("")}${w.split("").slice(Math.ceil(w.length / 2),w.length).join("")} `).join(" ");
u();
e.addEventListener("input", u);
/* kodun orjinal halini de bırakayım da belki birinin işine yarar
const editor = document.getElementById("edit");
const reader = document.getElementById("read");
const updateContent = (e) => {
const words = editor.innerHTML.split(" ");
const edited = [];
words.forEach((word, index) => {
const wordSplit = word.split("");
const boldTo = Math.ceil(word.length / 2);
const editedWord = `${wordSplit.slice(0,boldTo).join("")}${wordSplit.slice(boldTo,word.length).join("")} `;
edited.push(editedWord);
});
reader.innerHTML = edited.join("");
}
(() => {
updateContent(); // init
editor.addEventListener("input", updateContent);
})()
*/