<template>
  <div class="ScreenBlocker">
    <slot />
  </div>
</template>

<script lang="ts">
import { Prop, Vue } from 'vue-property-decorator';

export default class ScreenBlocker extends Vue {
  @Prop({ default: () => false })
  readonly isShown?: boolean;
}
</script>

<style lang="scss">
.ScreenBlocker {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;

  &::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: currentColor;
    opacity: 0.5;
    z-index: -1;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}
</style>
