Save point: Scene 3 recruitment text types faster (20-50ms), incubator stays calm

This commit is contained in:
avi
2026-05-09 21:03:00 -05:00
parent c3dceb0229
commit 7d248f5f13

View File

@@ -593,7 +593,7 @@
}, 500); }, 500);
} }
function typeCalmly(elem, text, callback) { function typeCalmly(elem, text, callback, minDelay, maxDelay) {
let i = 0; let i = 0;
const total = text.length; const total = text.length;
@@ -605,7 +605,9 @@
elem.textContent += text[i]; elem.textContent += text[i];
i++; i++;
const progress = i / total; const progress = i / total;
const delay = 70 + progress * progress * 130; const dMin = minDelay || 70;
const dMax = maxDelay || 130;
const delay = dMin + progress * progress * (dMax - dMin);
setTimeout(typeChar, delay); setTimeout(typeChar, delay);
} }
typeChar(); typeChar();
@@ -767,7 +769,7 @@
}, 30); }, 30);
}); });
}, 3000); }, 3000);
}); }, 20, 50);
}); });
}, 2000); }, 2000);
}); });