Skip to content

Instantly share code, notes, and snippets.

@saadh393
Created May 16, 2022 17:11
Show Gist options
  • Save saadh393/61ab07c849c88fac547028d43a566a1a to your computer and use it in GitHub Desktop.
Save saadh393/61ab07c849c88fac547028d43a566a1a to your computer and use it in GitHub Desktop.
const strings = document.querySelectorAll(".string");
const toUpdate = ['react-redux"', 'showInterest"', 'এনরোল করুন"', 'আগ্রহী"'];
strings.forEach((string, index) => {
let text = toUpdate.shift().split("");
string.innerHTML = '"';
setTimeout(function () {
let interval = setInterval(function () {
text.length ? (string.innerHTML += text.shift()) : clearInterval(interval);
}, 100);
}, index * 1500);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment