I am editing the code. But in these codes you do not have class scaling and other classes. this code job is based on font size.
** Html **
<div id="hello"> <h1>H <span>ello</span></h1> <h1>Y <span>our</span></h1> <h1>W <span>orld</span></h1> </div>
** Css **
#hello h1 { width: 33%; font-size: 1em; text-align: center; display: inline-block; }
** Edited> Css **
#hello{ -webkit-animation: myfirst linear 12s; animation: myfirst linear 12s; } @-webkit-keyframes myfirst { 0% {padding:0} 10% {padding: 40vh 0} 50% {padding: 40vh 0} 85% {padding: 40vh 0} 100% {padding: 0} } @keyframes myfirst { 0% {padding:0} 10% {padding: 40vh 0} 50% {padding: 40vh 0} 85% {padding: 40vh 0} 100% {padding: 0} }
** jQuery **
window.onload = function() { var h1 = $('#hello h1'); h1.animate({fontSize: '5em'}, 5000, function () { h1.delay(3000); h1.animate({'font-size': '1em'}, 2000, function () { h1.children('span').fadeOut(1000); } ); } ); };
Morteza negahi
source share