<template>
  <div class="welcome">
    <div class="progress-container">
      <el-progress
          class="custom-progress"
          :percentage="100"
          status="exception"
          :show-text="false"
          :stroke-width="16"
          :format="format"
          :indeterminate="true"
          color="transparent"
      />
      <div class="light-particles">
        <div class="light-particle"></div>
        <div class="light-particle"></div>
        <div class="light-particle"></div>
        <div class="light-particle"></div>
      </div>
    </div>
  </div>
</template>

<script>
import $ from 'jquery'
import {format} from "echarts";

export default {
  computed: {
    format() {
      return format
    }
  },
  data() {
    return {
      marginTop: $(window).height() / 2
    }
  },
  mounted() {
    var that = this;
    setTimeout(function () {
      that.$emit("loaddingend", "")
    }, 1000);
  }
}
</script>

<style>
.welcome {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #0a0a0a; /* 背景色 */
}

.progress-container {
  position: relative; /* 相对定位 */
  width: 300px;
  text-align: center;
  background-color: #212121; /* 容器背景色 */
  border-radius: 20px; /* 容器圆角 */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); /* 容器阴影 */
  padding: 40px; /* 内边距 */
}

.custom-progress .el-progress-bar__inner {
  border-radius: 20px; /* 进度条圆角 */
  background: linear-gradient(to right, #53a9ff, #68e9ff); /* 渐变背景 */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2); /* 进度条阴影 */
  transition: width 0.5s ease-in-out; /* 添加过渡效果 */
  position: relative; /* 相对定位 */
}

.light-particles {
  position: absolute; /* 绝对定位 */
  top: -20px; /* 距离进度条顶部一点点 */
  left: 0;
  width: 100%;
  height: calc(100% + 20px); /* 光粒容器高度比进度条高度多一点，使得光粒漂浮在进度条之上 */
  overflow: hidden;
}

.light-particle {
  position: absolute; /* 绝对定位 */
  width: 5px;
  height: 5px;
  background-color: rgba(255, 255, 255, 0.5); /* 光粒颜色 */
  border-radius: 50%; /* 光粒圆角 */
  animation: moveParticle 3s infinite; /* 光粒运动动画 */
}

@keyframes moveParticle {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(200%, 200%);
  }
}
</style>
