【CSS】How to overlay a color on an image and slide the color sideways after the animation of the upward moving line and the downward moving line to fade out(Demo page)

※Please check using Developer tools

Sponsored links

CSS

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

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

.list:after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  bottom:0;
  left:0;
  width: 100%;
  height: 100%;
  background: #55310e;
  z-index: 1;
  opacity: 1;
}
.list.active:after {
  opacity: 0;
  transition: all 0.5s ease-out 2.0s;
}

.list li {
  position: relative;
  width: 20%;
  height: 0;
  overflow: hidden;
  border-right: 1px solid #fff;
  transition: all 0.5s ease-out 1s;
  z-index: 2;
}

.list li:nth-child(2n) {
  height: 100%;
  transform: translateY(100%);
}
.list li:last-child {
  border-right:none;
}

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

.list.active {
  opacity: 0;
  transition: all 0.5s ease-out 2.4s;
}

.list.active li {
  height: 100%;
}
.list.active li:nth-child(2n) {
  transform: translateY(0);
}

.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");
});