"Block Reveal Effect"
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 ----------> <div class="content"> <h2>This is a test</h2> <p> Lorem ipsum dolor sit amet, consectetur adipiscing 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>
body, html { background-color: #333; color: #fff; font-family: Arial; } .content { position: relative; width: 500px; margin: 0 auto; overflow: hidden; } .content:before { content: ''; position: absolute; top: 0; left: 0; transform: translateX(-100%); height: 100%; width: 100%; background-color: #fff; } .content.effect:before { animation: reveal 1s ease-in-out; animation-fill-mode: forwards; } @keyframes reveal { 0% { transform: translateX(-100%); } 50% { transform: translateX(0); } 100% { transform: translateX(100%); } }
var btn = document.querySelector('.add-effect'); var content = document.querySelector('.content'); document.addEventListener('DOMContentLoaded', function () { content.classList.add("effect"); });

Related: See More


Questions / Comments: