Change sadness threshold to streak <= 2

This commit is contained in:
2026-07-10 13:49:03 +05:30
parent cdf50ed99c
commit 96cf5f6dc1
2 changed files with 8 additions and 3 deletions

View File

@@ -359,8 +359,8 @@
function play(){
clearTimeout(countTimer); clearTimeout(moodTimer); cancelAnimationFrame(countRAF); stopFw();
const target=parseTarget();
const sad = target<5;
const t = sad ? 0 : Math.min(1, Math.log10(Math.max(target,5)/5)/3); // 5→0 … 5000+→1
const sad = target<=2;
const t = sad ? 0 : Math.min(1, Math.log10(Math.max(target,3)/3)/3); // 5→0 … 5000+→1
// set mood + intensity
stage.classList.remove('play','happy','sad','tier1','tier2','tier3'); body.classList.remove('sad');
@@ -376,7 +376,7 @@
numEl.textContent='0';
void stage.offsetWidth; stage.classList.add('play');
const sadS = Math.max(0, Math.min(1, (4 - target) / 3)); // 1→1 (most), 4→0 (least)
const sadS = Math.max(0, Math.min(1, (3 - target) / 3)); // 1→1 (most), 4→0 (least)
if(reduce.matches){ numEl.textContent=target.toLocaleString(); if(sad){ setTimeout(()=>sadFaces(sadS),0);} return; }
moodTimer=setTimeout(()=> sad ? sadFaces(sadS) : celebrate(t), 2650);