// this function performs a typewriter effect on an element from the HTML DOM
function TypeWriter(target, text, delay, clearText = false) {
if (target.textContent === text) {
return;
}
if (clearText) {
target.textContent = "";
}
let _delay = 0;
for (let i = 0; i < text.length; i++) {
_delay += delay;
window.setTimeout(function() {
target.textContent += text[i];
}, _delay);
}
}