Design to
.animating-cursor {
color: #23b9d1;
animation: blink 0.5s infinite;
display: inline-block;
width: 0;
}
|
let wordArray = ['Code', 'React', 'React Native'];
let flag = 1;
$(document).ready(function() {
changeValue(wordArray[0],0, 1);
});
function changeValue(word, index, flag, rest) {
if(index == word.length + 1) {
if((word == 'React')){
word = 'React Native';
changeValue(word, 5, 1, 1);
} else {
flag = -1;
setTimeout(function() { changeValue(word,index - 1, flag, 1) }, 500);
}
} else if(index == -1) {
flag = 1;
changeWord(word);
} else {
$('.suffix-text').get(0).innerHTML = word.substr(0, index);
setTimeout(function() {
changeValue(word,index + flag, flag)
}, rest ? 75 : 150);
}
}
function changeWord(word) {
let index = wordArray.findIndex((arrayWord) => {
return word == arrayWord
});
let newIndex = index + 1;
if(newIndex == wordArray.length) {
newIndex = 0;
}
changeValue(wordArray[newIndex], 0, 1)
}
#designcode
Beautiful, Readable & Production-ready Code
Designing & Building an app with BuilderX
Teams & Share via link
Sketch to React Native!
Flex Layout
Component Export
Component Library
Icons for every need
What our users are saying
Starter template
Stay up-to-date with BuilderX news
Start using BuilderX
Share
BuilderX with your team