Folding panorama animation



Folding panorama animation using HTML and CSS




 <div class="card">
  <div class="fold"></div>
  <div class="fold"></div>
  <div class="fold"></div>
  <div class="fold"></div>
  <div class="fold"></div>
</div>                    
                  
                



html {
  background: radial-gradient(at center right, #222, #000);
}

body {
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-pack: center;
          justify-content: center;
  height: 100vh;
  -webkit-animation: crunch 4s 1s ease-in-out infinite;
          animation: crunch 4s 1s ease-in-out infinite;
}
@-webkit-keyframes crunch {
  50% {
    -webkit-transform: scaleX(0.6);
            transform: scaleX(0.6);
  }
}
@keyframes crunch {
  50% {
    -webkit-transform: scaleX(0.6);
            transform: scaleX(0.6);
  }
}
.card {
  display: -webkit-box;
  display: flex;
  width: 95vw;
  height: 22.5625vw;
}

.fold {
  -webkit-box-flex: 1;
          flex: 1;
  background: url(https://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/Pittsburgh_Panorama_from_the_Duquesne_Incline.jpg/1280px-Pittsburgh_Panorama_from_the_Duquesne_Incline.jpg);
  background-size: cover;
  -webkit-animation: 4s 1s ease-in-out infinite;
          animation: 4s 1s ease-in-out infinite;
}
.fold:nth-child(1) {
  background-position: 0%;
}
.fold:nth-child(2) {
  background-position: 25%;
}
.fold:nth-child(3) {
  background-position: 50%;
}
.fold:nth-child(4) {
  background-position: 75%;
}
.fold:nth-child(5) {
  background-position: 100%;
}
.fold:first-child {
  border-radius: 2vw 0 0 2vw;
}
.fold:last-child {
  border-radius: 0 2vw 2vw 0;
}
.fold:nth-child(odd) {
  -webkit-animation-name: odd-fold;
          animation-name: odd-fold;
}
@-webkit-keyframes odd-fold {
  50% {
    -webkit-transform: skewY(15deg);
            transform: skewY(15deg);
    -webkit-filter: brightness(1.25);
            filter: brightness(1.25);
  }
}
@keyframes odd-fold {
  50% {
    -webkit-transform: skewY(15deg);
            transform: skewY(15deg);
    -webkit-filter: brightness(1.25);
            filter: brightness(1.25);
  }
}
.fold:nth-child(even) {
  -webkit-animation-name: even-fold;
          animation-name: even-fold;
}
@-webkit-keyframes even-fold {
  50% {
    -webkit-transform: skewY(-15deg);
            transform: skewY(-15deg);
    -webkit-filter: brightness(0.75);
            filter: brightness(0.75);
  }
}
@keyframes even-fold {
  50% {
    -webkit-transform: skewY(-15deg);
            transform: skewY(-15deg);
    -webkit-filter: brightness(0.75);
            filter: brightness(0.75);
  }
}