JSFiddle - React, Tailwind, and code Playground
by cherryflavourpez
HTML
<div class="content">
<h1>Hi there! My name is Jeff.</h1>
<h2>And I create cool stuff.</h2>
</div>
CSS
.content h1 {
background:white;
opacity:0.7;
white-space:nowrap;
overflow:hidden;
border-right: 3px solid black;
-webkit-animation: typing 2s steps(26, end),
blink-caret 1s step-end 2s;
-moz-animation: typing 2s steps(26, end),
blink-caret 1s step-end 2s;
}
.content h2 {
background:white;
opacity:0.7;
white-space:nowrap;
overflow:hidden;
border-right: 3px solid black;
-webkit-animation: typing 2s steps(26, end),
blink-caret 1s step-end infinite;
-webkit-animation-delay:3s;
-webkit-animation-fill-mode:both;
-moz-animation: typing 2s steps(26, end),
blink-caret 1s step-end infinite;
-moz-animation-delay:3s;
-moz-animation-fill-mode:both;
}
@-webkit-keyframes typing {
from { width: 0; }
to { width:400px; }
}
@-moz-keyframes typing {
from { width: 0; }
to { width:400px; }
}
@-webkit-keyframes blink-caret {
from, to { border-color: transparent }
50% { border-color: black }
}
@-moz-keyframes blink-caret {
from, to { border-color: transparent }
50% { border-color: black }