<template>
  <div id="loadering_small" class="" v-if="isBusy">
    <div class="content">
      <div id="loader">
        <div id="dot1" class="dot"></div>
        <div id="dot2" class="dot"></div>
        <div id="dot3" class="dot"></div>
        <div id="dot4" class="dot"></div>
      </div>
      <h4 class="loadmessage">正在工作，请等待！</h4>
    </div>
  </div>
</template>

<script>
export default {
  title: 'busy',
  props: ['isBusy'],
  data() {
    return {
      isBusy: false
    }
  }
}
</script>

<style>
#loadering_small {
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 9999;
  display: flex;
  text-align: center;
  margin: 15% auto;
  flex-direction: column;
  position: relative;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
}

#loader {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  height: auto;
}

.dot {
  height: 20px;
  width: 20px;
  border-radius: 10px;
  display: inline-block;
  position: relative;
  margin-left: 2em;
}

.bg-white {
  height: 100%;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.8);
}

#dot1 {
  background: #ea4335;
  animation-name: dotloader;
  animation-duration: 1s;
  animation-delay: 0.1s;
  animation-iteration-count: infinite;
}

#dot2 {
  background: #34a853;
  animation-name: dotloader;
  animation-duration: 1s;
  animation-delay: 0.2s;
  animation-iteration-count: infinite;
}

.content {
  top: 50%;
  position: relative;
}

#dot3 {
  background: #4285f4;
  animation-name: dotloader;
  animation-duration: 1s;
  animation-delay: 0.3s;
  animation-iteration-count: infinite;
}

#dot4 {
  background: #fbbc05;
  animation-name: dotloader;
  animation-duration: 1s;
  animation-delay: 0.4s;
  animation-iteration-count: infinite;
}

#loader h4 {
  width: 100%;
  text-align: center;
}

.loadmessage {
  text-align: center;
  margin-left: 2em;
}

@keyframes dotloader {
  0% {
    top: 0px;
  }
  15% {
    top: 10px;
  }
  30% {
    top: 0px;
  }
  100% {
    top: 0px;
  }

}
</style>
