// Animations
// See https://github.com/vbenjs/vue-vben-admin/blob/main/src/design/transition/fade.less
// --------------------------------------------------

// --------------------------------------------------
// Quasar notification
// CSS: https://github.com/quasarframework/quasar/blob/dev/ui/src/plugins/notify/Notify.sass
// --------------------------------------------------
.q-notification {
  //animation: unset !important;
  //transition: unset !important;
}

.o-animation-top, .o-animation-center {
  animation: pop-in 0.25s ease forwards !important;

  &.q-notification[class*="leave-to"] {
    animation: pop-out 0.25s ease !important;
  }
  &.q-notification[class*="leave-active"] {
    top: unset !important;
  }
}


.o-animation-top-right {
  animation: slide-in-right 0.35s cubic-bezier(.25,.8,.25,1) forwards !important;

  &.q-notification[class*="leave-to"] {
    animation: slide-out-right 0.3s ease !important;
  }
  &.q-notification[class*="leave-active"] {
    top: unset !important;
  }
}

// --------------------------------------------------
// slide right
// --------------------------------------------------
@keyframes slide-in-right {
  0% {
    opacity: 0;
    transform: translateX(80px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slide-out-right {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(80px) scale(0.95);
  }
}

// --------------------------------------------------
// pop
// --------------------------------------------------
@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pop-out {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}


// --------------------------------------------------
// Fade
// --------------------------------------------------
.fade-transition {
  &-enter-active,
  &-leave-active {
    transition: opacity 0.2s ease-in-out;
  }

  &-enter-from,
  &-leave-to {
    opacity: 0;
  }
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.2s ease-in-out;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

// --------------------------------------------------
// Fade Slide
// --------------------------------------------------
.fade-slide-leave-active,
.fade-slide-enter-active {
  transition: all 0.3s;
}

.fade-slide-enter-from {
  transform: translateX(-30px);
  opacity: 0;
}

.fade-slide-leave-to {
  transform: translateX(30px);
  opacity: 0;
}

// --------------------------------------------------
// Fade Scale
// --------------------------------------------------
.fade-scale-leave-active,
.fade-scale-enter-active {
  transition: all 0.28s;
}

.fade-scale-enter-from {
  transform: scale(1.2);
  opacity: 0;
}

.fade-scale-leave-to {
  transform: scale(0.8);
  opacity: 0;
}

// --------------------------------------------------
// Fade Top
// --------------------------------------------------
.fade-top-enter-active,
.fade-top-leave-active {
  transition: opacity 0.2s, transform 0.25s;
}

.fade-top-enter-from {
  transform: translateY(8%);
  opacity: 0;
}

.fade-top-leave-to {
  transform: translateY(-8%);
  opacity: 0;
}

// --------------------------------------------------
// Fade Bottom
// --------------------------------------------------
.fade-bottom-enter-active,
.fade-bottom-leave-active {
  transition: opacity 0.25s, transform 0.3s;
}

.fade-bottom-enter-from {
  transform: translateY(-10%);
  opacity: 0;
}

.fade-bottom-leave-to {
  transform: translateY(10%);
  opacity: 0;
}

// --------------------------------------------------
// KeyFrames
// --------------------------------------------------
@keyframes slideInBottom {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes zoomIn {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes zoomOut {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.5);
    opacity: 0;
  }
}
