ufo-no-item.vue 1.68 KB
<template>
  <div class="no-item">
    <div class="no-item-bg">
      <div class="no-item-bg-top"></div>
      <div class="no-item-bg-bottom"></div>
    </div>
    <p>{{ tip }}</p>
  </div>
</template>

<script>
export default {
  name: "UfoNoItem",
  props: {
    tip: String
  }
};
</script>

<style lang="scss" scoped>
.no-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 8rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  .no-item-bg {
    position: relative;
    width: 186px;
    height: 242px;
    background-size: 100% 100%;

    &-top {
      position: absolute;
      width: 100%;
      height: 100%;
      left: 0;
      top: 0;
      z-index: 2;
      background-image: url("~statics/image/order/ufo-empty-top.png");
      background-size: 100% 100%;
      animation: animateUFO 3s linear infinite;
    }

    &-bottom {
      position: absolute;
      width: 100%;
      height: 100%;
      left: 0;
      top: 0;
      z-index: 1;
      background-image: url("~statics/image/order/ufo-empty-bottom.png");
      background-size: 100% 100%;
      animation: animateLight 3s linear infinite;
    }
  }

  p {
    color: #999;
    line-height: 32px;
  }
}

@keyframes animateUFO {
  0% {
    transform: translateY(0px);
  }

  25% {
    transform: translateY(10px);
  }

  50% {
    transform: translateY(0px);
  }

  75% {
    transform: translateY(10px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes animateLight {
  0% {
    transform: skewX(0deg);
  }

  25% {
    transform: skewX(10deg);
  }

  50% {
    transform: skewX(0deg);
  }

  75% {
    transform: skewX(-10deg);
  }

  100% {
    transform: skewX(0deg);
  }
}
</style>