export function typingCli(element, text, callback = () => {}) {
let i = 0;
function type() {
if (i < text.length) {
const span = document.createElement('span');
span.textContent = text.charAt(i);
element.appendChild(span);
setTimeout(() => {
span.classList.add('active');
if (i > 0) {
element.children[i - 1].classList.remove('active');
}
}, 100);
i++;
setTimeout(type, 200);
} else {
setTimeout(() => {
if (i > 0) {
element.children[i - 1].classList.remove('active');
}
callback();
}, 200);
}
}
type();
}