From 5745f41afdc5b71b97050f1c47cf88ce43704b19 Mon Sep 17 00:00:00 2001 From: Ankit Matth <146843890+Ankit-Matth@users.noreply.github.com> Date: Mon, 1 Jan 2024 11:57:25 +0530 Subject: [PATCH] fixing minor issues... --- main.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.js b/main.js index 5c6de64..73a1cb0 100644 --- a/main.js +++ b/main.js @@ -3,15 +3,15 @@ let moreBtns = document.getElementById('moreBtns') let ansDisplay = document.getElementById('ansDisplay') function checkOverflow() { - if (ansDisplay.value.length > 16) { - ansDisplay.style.fontSize="1.2rem" + if (ansDisplay.value.length <= 16) { + ansDisplay.style.fontSize = "1.6rem"; + } else if (16 < ansDisplay.value.length && ansDisplay.value.length <= 22) { + ansDisplay.style.fontSize = "1.2rem"; + } else if (22 < ansDisplay.value.length && ansDisplay.value.length <= 33) { + ansDisplay.style.fontSize = "0.8rem"; + } else { + ansDisplay.style.fontSize = "0.6rem"; } - if (ansDisplay.value.length > 22) { - ansDisplay.style.fontSize="0.8rem" - } - if (ansDisplay.value.length > 33) { - ansDisplay.style.fontSize="0.6rem" - } } moreBtns.addEventListener('click', () => {