JSFiddle - React, Tailwind, and code Playground
by Joshua Powell
HTML
<div class="parent">
<div class="slider">
<span>Some content about this image</span>
</div>
</div>
CSS
.parent {
position: relative;
width: 200px;
height: 200px;
background-image: url("http://fc01.deviantart.net/fs71/i/2011/237/8/a/fox_yawn_by_krankeloon-d47t1ut.jpg");
background-position: center;
background-size: cover;
}
.slider {
position: absolute;
left: 110%;
width: 100%;
height: 100%;
background: -webkit-linear-gradient(left, rgba(9, 146, 26, 1), rgba(9, 146, 26, 0));
background: -moz-linear-gradient(left, rgba(9, 146, 26, 1), rgba(9, 146, 26, 0));
background: -ms-linear-gradient(left, rgba(9, 146, 26, 1), rgba(9, 146, 26, 0));
transition: all 1s ease;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
overflow: hidden;
width: 0;
text-wrap: none;
}
.parent:hover .slider {
background: rgba(9, 146, 26, 1);
width: 100%;
}