Skip to content

Commit

Permalink
increase satisfying
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Sep 19, 2024
1 parent a56d254 commit b573e65
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions static/coffee/main/addy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -17,6 +20,9 @@ function incrementBalloonsPopped() {

if (counterEl) {
counterEl.innerText = balloonsPopped;
if (balloonsPopped > 999) {
counterEl.style.fontSize = '12px';
}
}
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b573e65

Please sign in to comment.