// @author    : Adarsh Pastakia
// @version   : 5.0.0
// @copyright : 2019
// @license   : MIT

// Page animations

/* animate page transitions */
.au-leave-active:not(.ui-dialog-wrapper) {
  @include animation(viewLeave 0.15s linear);
}
.au-enter-active:not(.ui-dialog-wrapper) {
  @include animation(viewEnter 0.3s linear);
}

$dialog-anim-time: 0.3s;
.au-enter-active.ui-dialog-wrapper {
  @include animation(dialogWrapper $dialog-anim-time ease-in both);
  .ui-dialog {
    @include animation(dialogEnter $dialog-anim-time ease-out both);
  }
}

.au-leave-active.ui-dialog-wrapper {
  @include animation(dialogWrapper $dialog-anim-time ease-in both);
  .ui-dialog {
    @include animation(dialogLeave $dialog-anim-time ease-in both);
  }
}

.au-stagger {
  // 50ms will be applied between each successive enter operation
  -webkit-animation-delay: 50ms;
  animation-delay: 50ms;
}

.ui-anim--spin::before,
.ui-anim--spin path {
  @include animation(spinner 2s linear infinite);
}

.ui-anim--loader::before,
.ui-anim--loader path {
  @include animation(spinner 1s cubic-bezier(1, -0.5, 1, 0.5) infinite);
}

/* animation definitions */
@include keyframes(viewEnter) {
  0% {
    opacity: 0;
  }
  51% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@include keyframes(viewLeave) {
  to {
    opacity: 0;
  }
}

/* animation definitions */
@include keyframes(dialogEnter) {
  from {
    @include transform(scale(0.7));
    opacity: 0;
  }
}
@include keyframes(dialogLeave) {
  to {
    @include transform(scale(0.7));
    opacity: 0;
  }
}
@include keyframes(dialogWrapper) {
  from {
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}

@include keyframes(spinner) {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.animate-fade-in {
  &.au-enter {
    opacity: 0;
  }
  &.au-enter-active {
    animation: FadeIn 1s;
  }
}

.animate-fade-out {
  &.au-leave-active {
    animation: FadeOut 1s;
  }
  &.au-left {
    opacity: 0;
  }
}

.no-animation {
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}
