【CSS】Animation that slides the color over the image like a curtain(Lateral direction) | Demo page

※Please check using Developer tools

Sponsored links

CSS

.block {
  position: relative;
  display: block;
  width: 768px;
  line-height: 0;
  margin: 50px auto 0;
}

.block img {
  width: 100%;
}

.block:after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: #55310e;
  transition: width 1.5s cubic-bezier(0.25, 1, 0.25, 1);
}

.active.block:after {
  width: 0;
}

@media screen and (max-width:640px){
  .block {
    width: 100%;
  }
}
  

JavaScript

$(window).on('load', function(){
  $(".block").addClass("active");
});