Built for every way you
.typed-words {
color: #00a2e8;
}
.typed-words::after {
content: “|”;
display: inline;
animation: blink 1s infinite;
}
@keyframes blink {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
(function () {
const words = [“design.”, “sell.”, “operate.”, “own.”];
const typingSpeed = 150;
const deletingSpeed = 75;
const delayBetweenWords = 1500;
const delayBeforeTyping = 300;
function init() {
const elements = document.querySelectorAll(“.typed-words”);
elements.forEach((element) => {
let wordIndex = 0;
let charIndex = 0;
let isDeleting = false;
function type() {
if (!element) return;
const currentWord = words[wordIndex];
if (isDeleting) {
element.textContent = currentWord.substring(0, charIndex – 1);
charIndex–;
if (charIndex === 0) {
isDeleting = false;
wordIndex = (wordIndex + 1) % words.length;
setTimeout(type, delayBeforeTyping);
return;
}
} else {
element.textContent = currentWord.substring(0, charIndex + 1);
charIndex++;
if (charIndex === currentWord.length) {
isDeleting = true;
setTimeout(type, delayBetweenWords);
return;
}
}
setTimeout(type, isDeleting ? deletingSpeed : typingSpeed);
}
setTimeout(type, 500);
});
}
if (document.readyState === “loading”) {
document.addEventListener(“DOMContentLoaded”, init);
} else {
init();
}
})();
Built for every
way you
.typed-words {
color: #00a2e8;
}
.typed-words::after {
content: “|”;
display: inline;
animation: blink 1s infinite;
}
@keyframes blink {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
(function () {
const words = [“design.”, “sell.”, “operate.”, “own.”];
const typingSpeed = 150;
const deletingSpeed = 75;
const delayBetweenWords = 1500;
const delayBeforeTyping = 300;
function init() {
const elements = document.querySelectorAll(“.typed-words”);
elements.forEach((element) => {
let wordIndex = 0;
let charIndex = 0;
let isDeleting = false;
function type() {
if (!element) return;
const currentWord = words[wordIndex];
if (isDeleting) {
element.textContent = currentWord.substring(0, charIndex – 1);
charIndex–;
if (charIndex === 0) {
isDeleting = false;
wordIndex = (wordIndex + 1) % words.length;
setTimeout(type, delayBeforeTyping);
return;
}
} else {
element.textContent = currentWord.substring(0, charIndex + 1);
charIndex++;
if (charIndex === currentWord.length) {
isDeleting = true;
setTimeout(type, delayBetweenWords);
return;
}
}
setTimeout(type, isDeleting ? deletingSpeed : typingSpeed);
}
setTimeout(type, 500);
});
}
if (document.readyState === “loading”) {
document.addEventListener(“DOMContentLoaded”, init);
} else {
init();
}
})();
Get Demo
















