【CSS】An animation implementation method that displays the image by sliding the color overlaid on the image to the left and right to open the curtain. | Demo page

※Please check using Developer tools

Sponsored links

CSS

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

.block:after,.block:before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  height: 102%;
  transition: transform 0.5s cubic-bezier(0.39, 0.575, 0.565, 1);
  background: #fff;
}

.block:before {
  width: 45%;
  left: -1%;
  transform-origin: left top;
}

.block:after {
  width: 65%;
  right: -1%;
  transform-origin: right top;
}
.active.block:before,.active.block:after {
  transform: scaleX(0);
}

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

JavaScript

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