JSFiddle - React, Tailwind, and code Playground
by kougiland
HTML
<link rel="stylesheet" href="http://daneden.github.io/animate.css/animate.min.css">
<div class="container">
<div class="title1">
<h3>#01</h3>
<h2>Title One</h2>
</div>
</div>
CSS
.animated {
-webkit-animation-duration:1s;
animation-duration:1s;
-webkit-animation-fill-mode:both;
animation-fill-mode:both;
}
.title-pop {
-webkit-animation-name:pulse;
animation-name:pulse;
cursor:pointer;
}
10%,30%,50%,70%,90% {
-webkit-transform:translateX(-0px);
transform:translateX(-0px);
}
20%,40%,60%,80% {
-webkit-transform:translateX(5px);
transform:translateX(5px);
}
.container {
width: 500px;
height: 300px;
position:relative;
}
.title1 {
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
padding: 40px;
z-index: 999;
}
JavaScript
doIt();
function doIt(){
$('.title1').fadeIn('fast', function() {
$('div').addClass('animated pulse');
})
$('div').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
$('.title1').fadeOut(2000, function() {doIt();});
});
};