From 362b1b4b3a5c5d82cad90bf36df85892b15ba9c8 Mon Sep 17 00:00:00 2001 From: JustinOros Date: Tue, 30 Sep 2025 13:06:11 -0700 Subject: [PATCH] Reworded next level estimation text to be more inclusive for those under level 40. --- index.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 8993946..bab4b80 100644 --- a/index.html +++ b/index.html @@ -106,23 +106,26 @@ function formatDays(days) { if (days > 365) { - let years = (days / 365).toFixed(1); - return `${years} years`; + return (days / 365).toFixed(1) + ' years'; } - return `${days.toLocaleString()} days`; + return days.toLocaleString() + ' days'; } function updateExtraInfo() { let nextLevelXp = (currentLevel < xpThresholds.length) ? xpThresholds[currentLevel] : currentXp; let xpToNext = Math.max(0, nextLevelXp - currentXp); + let xpTo40 = Math.max(0, xpThresholds[39] - currentXp); // Level 40 let xpTo80 = Math.max(0, xpThresholds[79] - currentXp); let daysNext = Math.ceil(xpToNext / avgXpPerDay); + let days40 = Math.ceil(xpTo40 / avgXpPerDay); let days80 = Math.ceil(xpTo80 / avgXpPerDay); - document.getElementById('xp-per-day').textContent = avgXpPerDay.toLocaleString(); - document.getElementById('days-next').textContent = formatDays(daysNext); - document.getElementById('days-80').textContent = formatDays(days80); + const nextText = currentLevel < 40 + ? `If you average ${avgXpPerDay.toLocaleString()} XP per day, you will reach the next level in ${formatDays(daysNext)}, level 40 in ${formatDays(days40)}, and level 80 in ${formatDays(days80)}.` + : `If you average ${avgXpPerDay.toLocaleString()} XP per day, you will reach the next level in ${formatDays(daysNext)} and level 80 in ${formatDays(days80)}.`; + + document.getElementById('extra-info').innerHTML = `

${nextText} ✏️

`; } document.getElementById('calculate-btn').addEventListener('click', () => {