【CSS】How to implement an animation that divides the color superimposed on the image into 5 parts and slides downward from the left in order(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;
  transition: all 0.4s 0s linear;
  transform-origin:center top;
  transform: translateY(0)
}
.list li:nth-child(2) span { transition: all 0.4s 0.1s linear; }
.list li:nth-child(3) span { transition: all 0.4s 0.2s linear; }
.list li:nth-child(4) span { transition: all 0.4s 0.3s linear; }
.list li:nth-child(5) span { transition: all 0.4s 0.4s linear; }

.list.active li span {
  transform: translateY(100%)
}

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

JavaScript

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