You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You could do something like this for a typing animation effect:
function type(words, delay, callback) {
for(let i = 0; i <= words.length; i++) {
let timeoutDelay = delay * (i + 1);
setTimeout(() => callback(words.slice(0, i)), timeoutDelay);
}
}
Callback is a function that takes a string as an argument. It'll be called with the progress of the typing. You can use this callback to update your UI.
Idea inspired by the awesome suggestion from @pirijan here.
The text was updated successfully, but these errors were encountered: