JSFiddle - React, Tailwind, and code Playground
HTML
<div class="intro-wrapper">
<div class="os-phrases" id="os-phrases">
<h2>Hello...</h2>
<h2>I'm Draven Xarcell Vestatt</h2>
<h2>I Provide</h2>
<h2>Organzied Creative Services</h2>
<h2>Through</h2>
<h2>Xarcell Studios</h2>
</div>
</div>
CSS
.intro-wrapper { background: #222; height: 400px; width: 400px; }
.os-phrases h2 {
font-family: 'Dosis', 'Lato', sans-serif;
font-size: 70px;
font-weight: 200;
width: 100%;
overflow: hidden;
text-transform: uppercase;
padding: 0;
margin: 0;
position: absolute;
top: 0;
left: 0;
letter-spacing: 14px;
text-align: center;
}
.os-phrases h2,
.os-phrases h2 > span {
height: 100%;
/* Centering with flexbox */
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: center;
-moz-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-moz-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
.os-phrases h2 > span {
margin: 0 15px;
}
.os-phrases h2 > span > span {
display: inline-block;
-webkit-perspective: 1000px;
-moz-perspective: 1000px;
perspective: 1000px;
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
transform-origin: 50% 50%;
}
.os-phrases h2 > span > span > span {
display: inline-block;
color: hsla(0,0%,0%,0);
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform: translate3d(0,0,0);
-moz-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
-webkit-animation: OpeningSequence 5.2s linear forwards;
-moz-animation: OpeningSequence 5.2s linear forwards;
animation: OpeningSequence 5.2s linear forwards;
}
.os-phrases h2:nth-child(2) > span > span > span {
-webkit-animation-delay: 5s;
-moz-animation-delay: 5s;
animation-delay: 5s;
}
.os-phrases h2:nth-child(3) > span > span > span {
-webkit-animation-delay: 10s;
-moz-animation-delay: 10s;
animation-delay: 10s;
}
.os-phrases h2:nth-child(4) > span > span > span {
-webkit-animation-delay: 15s;
-moz-animation-delay:...
JavaScript
(function(b){function c(g,h,d,i){var e=g.text().split(h),f="";if(e.length){b(e).each(function(j,k){f+='<span class="'+d+(j+1)+'">'+k+"</span>"+i});g.empty().append(f)}}var a={init:function(){return this.each(function(){c(b(this),"","char","")})},words:function(){return this.each(function(){c(b(this)," ","word"," ")})},lines:function(){return this.each(function(){var d="eefec303079ad17405c889e092e105b0";c(b(this).children("br").replaceWith(d).end(),d,"line","")})}};b.fn.lettering=function(d){if(d&&a[d]){return a[d].apply(this,[].slice.call(arguments,1))}else{if(d==="letters"||!d){return a.init.apply(this,[].slice.call(arguments,0))}}b.error("Method "+d+" does not exist on jQuery.lettering");return this}})(jQuery);
$(document).ready(function() {
$("#os-phrases > h2").lettering('words').children("span").lettering().children("span").lettering();
});