JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<div class="block hidden">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
been the industry's standard dummy text ever since the 1500s, when an unknown printer took
a galley of type and scrambled it to make a type specimen book. It has survived not only
five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum
passages, and more recently with desktop publishing software like Aldus PageMaker including
versions of Lorem Ipsum.
</div>
<div class="block hidden">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
been the industry's standard dummy text ever since the 1500s, when an unknown printer took
a galley of type and scrambled it to make a type specimen book.
</div>
<div class="block hidden">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
been the industry's standard dummy text ever since the 1500s, when an unknown printer took
a galley of type and scrambled it to make a type specimen book. It has survived not only
five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
</div>
<div class="block hidden">
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</div>
<div class="block hidden">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
been the industry's standard dummy text ever since the 1500s, when an unknown printer took
a galley of type and scrambled it to make a type specimen book. It has survived not only
five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum
passages, and more...
CSS
.container {
margin: 1000px 0;
overflow: hidden;
font-family: Arial;
}
.block {
color: #fff;
margin: 350px 0;
padding: 20px 10px;
border-bottom: 1px solid #fff;
background: #4679bd;
-weblot-box-shadow: 0 10px 20px #ddd;
-moz-box-shadow: 0 10px 20px #ddd;
box-shadow: 0 10px 20px #ddd;
-webkit-transition: all 1.5s cubic-bezier(.49,.27,.04,1.34);
-moz-transition: all 1.5s cubic-bezier(.49,.27,.04,1.34);
-o-transition: all 1.5s cubic-bezier(.49,.27,.04,1.34);
transition: all 1.5s cubic-bezier(.49,.27,.04,1.34);
}
.hidden {
color: #000;
position: relative;
top: 100px;
opacity: 0;
border: 0;
background: #ccc;
-weblot-box-shadow: 50px 200px 100px #000;
-moz-box-shadow: 50px 200px 100px #000;
box-shadow: 50px 200px 100px #000;
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}
JavaScript
$(window).scroll(function() {
var view = $(window).scrollTop() + $(window).height();
$('.hidden').each(function() {
view > $(this).offset().top && $(this).removeClass('hidden');
});
});