In this example, I use two images aligned vertically and a text below that has its message appear from left to right with a border-right. Everything works just fine but as I reload the page again and again, I have a feeling that the border is not always 4px but gets thinned sometimes through the animation. Does it happen indeed and how could I fix it? Thanks
.d1 {
background-color: #333;
padding: 2%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
/* DEMO-SPECIFIC STYLES */
.typewriter {
color: #fff;
font-family: "Electrolize";
font-size: 25px;
overflow: hidden; /* Ensures the content is not revealed until the animation */
white-space: nowrap; /* Keeps the content on a single line */
letter-spacing: .15em; /* Adjust as needed */
animation-delay: 1s;
animation-duration: 6s;
animation-fill-mode: both;
animation-name: spin1;
}
@keyframes spin1 {
0% {max-width: 0px; border-right: 0px;}
1% {max-width: 0px; border-right: 4px solid #7CDD26;}
99% {max-width: 100%; border-right: 4px solid #7CDD26;}
100% {max-width: 100%; border-right: none}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href='https://fonts.googleapis.com/css?family=Electrolize' rel='stylesheet'>
<title>
Test
</title>
</head>
<body>
<div class="d1">
<img src="https://www.gravatar.com/avatar/4581a99fa5793feaeff38d989a1524c6?s=48&d=identicon&r=PG">
<img src="https://www.gravatar.com/avatar/4581a99fa5793feaeff38d989a1524c6?s=48&d=identicon&r=PG">
<div class="typewriter">TEST1 TEST2 TEST3 TEST4 TEST5 TEST6</div>
</div>
</body>
</html>