@import "../helpers/index";

.mask-black{
  background-color: #000;
  opacity:0.8;
}

modal-disable-scroll{
  overflow: hidden !important;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  bottom:0;
  right:0;
  z-index: $z-index-modal;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0);

  &.fade{
    display: none;
  }

  &.active{
    display: block;
    background-color: rgba(0,0,0,0.8);
  }

  &.in {
    -webkit-animation: backdrop-fadeIn .3s;
    animation: backdrop-fadeIn .3s;
  }

  &.out {
    -webkit-animation: backdrop-fadeOut .3s;
    animation: backdrop-fadeOut .3s;
  }
}

.modal-container{
  display: block;
  overflow: auto;
  overflow-y: scroll;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  -webkit-overflow-scrolling: touch;
  outline: 0;
  &.fade{ opacity: 0; z-index:-1;}
  // 下降一层（用于多层弹窗）
  &.down{ opacity: 1; z-index:-1 }
  &.active{ opacity: 1; z-index: $z-index-modal;}


  & .modal-opening {
    -webkit-animation: modal-bounceIn .3s;
    animation: modal-bounceIn .3s;
  }

  & .modal-closing{
    -webkit-animation: modal-bounceOut .3s;
    animation: modal-bounceOut .3s;
    opacity: 0;
  }

  .modal-tip {
    background: $white;
    border-radius: 5px;
    color: $dark;
    top: 45vh;
    left: 50%;
    margin-left:-135px;
    position: absolute;
    width: 270px;
  }

  .modal-alert {
    background: $white;
    border-radius: 5px;
    color: $dark;
    top: 45vh;
    left: 50%;
    margin-left:-140px;
    position: absolute;
    width: 280px;
  }

  .modal-confirm {
    background: $white;
    border-radius: 5px;
    color: $dark;
    top: 45vh;
    left: 50%;
    margin-left:-140px;
    position: absolute;
    width: 280px;
  }

  .modal-head{
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    padding: 15px 0;
  }

  .modal-body{
    text-align: center;
    padding: 16px 15px;
    line-height: 150%;
    font-size: 14px;
  }
}

.modal {
  display: block;
  position: absolute;
  top: 0;
  z-index: $z-index-modal;
  overflow: hidden;
  min-height: 100%;
  width: 100%;
  background-color: $white;
}

//  pointer-events: none; 禁止事件

@-webkit-keyframes modal-bounceOut {
  20%, 25% {
    opacity: 1;
    -webkit-transform: scale3d(1.1, 1.1, 1.1);
    transform: scale3d(1.1, 1.1, 1.1);
  }

  to {
    opacity: 0;
    -webkit-transform: scale3d(.3, .3, .3);
    transform: scale3d(.3, .3, .3);
  }
}

@keyframes modal-bounceOut {
  20%, 25% {
    opacity: 1;
    -webkit-transform: scale3d(1.1, 1.1, 1.1);
    transform: scale3d(1.1, 1.1, 1.1);
  }

  to {
    opacity: 0;
    -webkit-transform: scale3d(.3, .3, .3);
    transform: scale3d(.3, .3, .3);
  }
}

@-webkit-keyframes modal-bounceIn {
  from, 70%, to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }

  0% {
    opacity: 0;
    -webkit-transform: scale3d(.3, .3, .3);
    transform: scale3d(.3, .3, .3);
  }

  70% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1);
    transform: scale3d(1.1, 1.1, 1.1);
  }

  to {
    opacity: 1;
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}

@keyframes modal-bounceIn {
  from, 70%, to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }

  0% {
    opacity: 0;
    -webkit-transform: scale3d(.3, .3, .3);
    transform: scale3d(.3, .3, .3);
  }

  70% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1);
    transform: scale3d(1.1, 1.1, 1.1);
  }

  to {
    opacity: 1;
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}

@keyframes backdrop-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes backdrop-fadeOut{
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}