【CSS】How to implement a curtain animation in which the color superimposed on the image is divided into 5 and slides at the same time(Demo page)

※Please check using Developer tools

Sponsored links

CSS

.block {
  position: relative;
  width: 768px;
  line-height: 0;
  overflow: hidden;
  margin: 70px auto 0;
}

.list {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: 100%;
  height: 100%;
  margin-right: -50%;
  transform: translate(-50%, -50%);
}

.list li {
  width: 20%;
  overflow: hidden;
}

.list li span {
  display: block;
  width: 100%;
  height: 100%;
  background: #55310e;
  transform: translate3d(0, 0, 0);
  transition: all 0.8s 1s cubic-bezier(0.5, 0.5, 0.5, 0.9);
}

.list.active li span {
  transform: translate3d(110%, 0, 0);
}

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

  

JavaScript

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