//
// loader.scss
// Theme component
//

body > div.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  width: 100%;
  height: 100%;
  background: $loader-bg;
  z-index: 9999;
  opacity: 0;
  transition: opacity $loader-animation-time ease;
  overflow: hidden;
  pointer-events: none;
}

body:not(.loaded) > div.loader {
  opacity: 1;
}

body:not(.loaded) {
  overflow: hidden;
}

body.loaded > div.loader {
  animation: hideLoader $loader-animation-time linear $loader-animation-time forwards;
}

@keyframes hideLoader {
  0% {
    width: 100%;
    height: 100%;
  }
  100% {
    width: 0;
    height: 0;
  }
}
