mirror of
https://github.com/JimenezJC/mshj_blog.git
synced 2025-12-06 09:09:56 -05:00
14 lines
No EOL
455 B
JavaScript
14 lines
No EOL
455 B
JavaScript
const miniHeader = document.getElementById('mini-header');
|
|
const texts = ['use linux', 'i hate css', 'gpl everything', 'made with love']; // add your random text here
|
|
const text = texts[Math.floor(Math.random() * texts.length)];
|
|
let charIndex = 0;
|
|
|
|
function typeText() {
|
|
if (charIndex < text.length) {
|
|
miniHeader.textContent += text.charAt(charIndex);
|
|
charIndex++;
|
|
setTimeout(typeText, 50); // adjust the typing speed here
|
|
}
|
|
}
|
|
|
|
typeText(); |