2
I’m in a tremendous difficulty, I made a small freshness for when entering the site the text shows the same when typing alone with keyframe.
Doubt:
How can I skip line in my text without the keyframe reading too, for example "
", i.e., the text would come out like this: "my text 'br>my text |" all together and with the tag br.
function typeWrite(elemento){
const textoArray = elemento.innerHTML.split('');
elemento.innerHTML = ' ';
textoArray.forEach(function(letra, i){
setTimeout(function(){
elemento.innerHTML += letra;
}, 75 * i)
});
}
const titulo = document.querySelector('.titulo-principal');
typeWrite(titulo);
.titulo-principal{
}
.titulo-principal:after{
content: '|';
margin-left: 5px;
opacity: 1;
animation: pisca .7s infinite;
}
@keyframes pisca{
0%, 100%{
opacity: 1;
}
50%{
opacity: 0;
}
}
<p class="titulo-principal">Meu texto br> Meu Texto</p>
did not understand... you want to display as if the text is being typed only with css, no javascript?
– Leandro Angelo
The code I quoted, already prints similar when someone is "typing". The doubt is skip line. If I put a <br> it prints the <br>.
– JeanAlves
present the javascript part as well
– Leandro Angelo
I edited, sorry. I forgot that part. Javascript is above
– JeanAlves