"Reveal Animation"
Bootstrap 4.1.1 Snippet by ALIMUL AL RAZY

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <br> <div class="has-animation animation-ltr" data-delay="10"> <p class="bigger">Reveal Animation </p> </div> <br> <br> <div class="has-animation animation-rtl" data-delay="1000"> <p class="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> <br> <br> <br> <br> <div class="has-animation animation-rtl" data-delay="2000"> <img src="https://placeimg.com/640/480/nature" width="600" /> </div>
body { font-family: 'Montserrat', sans-serif; text-align: center; } div { display: inline-block; } .bigger { margin: 0; font-size: 60px; font-weight: 800; padding: 20px; text-transform: uppercase; color: #202020; display: inline-block; position: relative; } .text { max-width: 600px; width: 100%; line-height: 24px; text-align: left; color: #404040; padding: 20px; } .text.txt-center { text-align: center; } .text a { color: #0fe4d2; } .has-animation { position: relative; } .has-animation p, .has-animation img { opacity: 0; } .has-animation.animate-in p, .has-animation.animate-in img { animation: textHidden 0.1s 1.1s forwards; } .has-animation.animate-in:before, .has-animation.animate-in:after { content: ''; position: absolute; top: 0; right: 0; height: 100%; z-index: 10; } .has-animation.animate-in:before { background-color: teal; } .has-animation.animate-in:after { background-color: yellowgreen; animation-delay: .5s; } .has-animation.animation-ltr.animate-in:before { animation: revealLTR 1.8s ease; } .has-animation.animation-ltr.animate-in:after { animation: revealLTR 1s .6s ease; } .has-animation.animation-rtl.animate-in:before { animation: revealRTL 1.8s ease; } .has-animation.animation-rtl.animate-in:after { animation: revealRTL 1s .6s ease; } @keyframes revealRTL { 0% { width: 0; right: 0; } 65% { width: 100%; right: 0; } 100% { width: 0; right: 100%; } } @keyframes revealLTR { 0% { width: 0; left: 0; } 65% { width: 100%; left: 0; } 100% { width: 0; left: 100%; } } @keyframes textHidden { 0% { opacity: 0; } 100% { opacity: 1; } }
$(document).ready(function() { $('.has-animation').each(function(index) { $(this).delay($(this).data('delay')).queue(function(){ $(this).addClass('animate-in'); }); }); });

Related: See More


Questions / Comments:

Great animation, but I have one question. If the css snippet is used in animate.css, is there a way to make it triggered on scroll, because I have it very down at the website and it automatically does the animation when I open the page.

Stavrevski () - 5 years ago - Reply 0