From b573e65293765c1ae42f561687e737bac79ec284 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Thu, 19 Sep 2024 10:10:19 -0700 Subject: [PATCH] increase satisfying --- static/coffee/main/addy.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/static/coffee/main/addy.js b/static/coffee/main/addy.js index df6d76e..aa4c469 100644 --- a/static/coffee/main/addy.js +++ b/static/coffee/main/addy.js @@ -5,6 +5,9 @@ document.body.appendChild(effectsContainer); let counterEl = null +const defaultDoubleRate = 0.25 +let doubleRate = defaultDoubleRate + function incrementBalloonsPopped() { let balloonsPopped = localStorage.getItem('balloonsPopped'); if (balloonsPopped === null) { @@ -17,6 +20,9 @@ function incrementBalloonsPopped() { if (counterEl) { counterEl.innerText = balloonsPopped; + if (balloonsPopped > 999) { + counterEl.style.fontSize = '12px'; + } } } @@ -287,6 +293,14 @@ VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV`); setTimeout(() => { popEffect.remove(); }, 300); + + + if (Math.random() < doubleRate) { + createBalloon(); + doubleRate = defaultDoubleRate + } else { + doubleRate *= 1.3 + } } // Function to create a single confetti