I am trying to add typewriter effect to some text on a webpage, however, it is not working as intended. Since this question is about animation I have given small video (only 5-6 sec) links bellow.
- How do I make that cursor stop from going further than it needs to be ? See Here
- This animation starts as soon as I open the website, but this section in in the middle of the webpage so the user is not able to see that animation.See here
- This does not adjust itself, when viewed it mobile. So what should I do so that it automatically get smaller with small screen (keeping the whole text in the same line). See here
.pcb-text p {
font-size: 60px;
animation: type-writer-effect 3s steps(56), blink-caret 0.85s step-end infinite;
overflow: hidden;
white-space: nowrap;
margin: 0 auto;
border-right: .12em solid orange;
/ width: 28ch;
}
@keyframes type-writer-effect {
0% {
text-align: center;
width: 0ch;
}
100% {
width: 28ch;
}
}
/* The typewriter cursor effect */
@keyframes blink-caret {
from,
to {
border-color: transparent
}
50% {
border-color: orange;
}
}
<div class="pcb-text">
<div class="text-center">
<p>Physics, Chemistry, Biology.</p>
</div>
</div>