.in, .out {
  -webkit-animation-timing-function: ease-in-out;
  -webkit-animation-fill-mode: both;
  -webkit-transform: perspective(800);
  -webkit-animation-duration: .7s;
  -webkit-transform-style: preserve-3d;
}

.out {
  -webkit-animation-name: swapouttoleft;
}
.in {
  -webkit-animation-name: swapinfromright;
}
.out.reverse {
  -webkit-animation-name: swapouttoright;
}
.in.reverse {
  -webkit-animation-name: swapinfromleft;
}


@-webkit-keyframes swapouttoright {
  0% {
    -webkit-transform: translate3d(0px, 0px, 0px) rotateY(0deg);
    -webkit-animation-timing-function: ease-in-out;
  }
  50% {
    -webkit-transform: translate3d(-180px, 0px, -400px) rotateY(20deg);
    -webkit-animation-timing-function: ease-in;
    opacity: 0.8;
  }
  100% {
      -webkit-transform:  translate3d(0px, 0px, -800px) rotateY(70deg);
      opacity: 0;
  }
}

@-webkit-keyframes swapouttoleft {
  0% {
    -webkit-transform: translate3d(0px, 0px, 0px) rotateY(0deg);
    -webkit-animation-timing-function: ease-in-out;
  }
  50% {
    -webkit-transform:  translate3d(180px, 0px, -400px) rotateY(-20deg);
    -webkit-animation-timing-function: ease-in;
    opacity: 0.8;
  }
  100% {
    -webkit-transform: translate3d(0px, 0px, -800px) rotateY(-70deg);
    opacity: 0;
  }
}

@-webkit-keyframes swapinfromright {
  0% {
    -webkit-transform: translate3d(0px, 0px, -800px) rotateY(70deg);
    -webkit-animation-timing-function: ease-out;
  }
  50% {
    -webkit-transform: translate3d(-180px, 0px, -400px) rotateY(20deg);
    -webkit-animation-timing-function: ease-in-out;
  }
  100% {
    -webkit-transform: translate3d(0px, 0px, 0px) rotateY(0deg);
  }
}

@-webkit-keyframes swapinfromleft {
  0% {
    -webkit-transform: translate3d(0px, 0px, -800px) rotateY(-70deg);
    -webkit-animation-timing-function: ease-out;
  }
  50% {
    -webkit-transform: translate3d(180px, 0px, -400px) rotateY(-20deg);
    -webkit-animation-timing-function: ease-in-out;
  }
  100% {
    -webkit-transform: translate3d(0px, 0px, 0px) rotateY(0deg);
  }
}
