@positions: center, top, left, right, bottom;
@animationPostions: {
  top: translate3d(0, -100%, 0);
  left: translate3d(-100%, 0, 0);
  right: translate3d(100%, 0, 0);
  bottom: translate3d(0, 100%, 0);
};

// 不同位置的动画使用
each(@positions,{
  .popup-fade-@{value}-active-show{
    animation: ~'popup-@{value}-fadein 0.3s forwards';
  }

  .popup-fade-@{value}-active-hide{
    animation: ~'popup-@{value}-fadeout 0.3s forwards';
  }

});

// 不同位置的动画定义
each(@animationPostions,{
  @keyframes ~'popup-@{key}-fadein' {
    0% {
      transform: @value;
      opacity: 0;
    }

    100% {
      transform: translate3d(0, 0, 0);
      opacity: 1;
    }
  }

  @keyframes ~'popup-@{key}-fadeout' {
    0% {
      transform: translate3d(0, 0, 0);
      opacity: 1;
    }

    100% {
      transform: @value;
      opacity: 0.1;
    }
  }
});

@keyframes popup-center-fadein {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes popup-center-fadeout {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(0.8);
    opacity: 0;
  }
}

@keyframes bg-fadein {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes bg-fadeout {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.container-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.container-bg-show {
  animation: bg-fadein 0.3s forwards;
}

.container-bg-hide {
  animation: bg-fadeout 0.3s forwards;
}

.container-bg {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  background: rgba(0, 0, 0, 0.4);
}

.popup-content {
  position: absolute;
  z-index: 100;
  width: 100%;
  max-width: 100%;
  height: 100%;
}

.center {
  display: flex;
  height: 100%;
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.left {
  display: flex;
  flex-direction: row;
  height: 100%;
}

.right {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  height: 100%;
}

.bottom {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
}
