forked from avi/signalelsewhere
Save point: Scene 3 recruitment text types faster (20-50ms), incubator stays calm
This commit is contained in:
@@ -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);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user