JSFiddle - React, Tailwind, and code Playground
by fenderistic
HTML
<div id="intro1"></div>
CSS
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
display: table
}
#intro1 {
display: table-cell;
text-align: center;
vertical-align: middle;
font-family:'Press Start 2P', cursive;
font-size: 80px;
}
JavaScript
var index = 0;
var text = 'Hardcode';
// Here you can put in the text you want to make it type.
var f = setTimeout(function () {
type()
}, 1000);
function type() {
document.getElementById('intro1').innerHTML += text.charAt(index);
index += 1;
if(index!==text.length){
var t = setTimeout(function () {
type()
}, 200);
}
// The time taken for each character here is 100ms. You can change it if you want.
}