@import "../../styles/themes/variable.scss";

@font-face {
  font-family: "xh-iconfont"; /* Project id 4043926 */
  src:
    url('./font/iconfont.woff2?t=1687140360510') format('woff2'),
    url('./font/iconfont.woff?t=1687140360510') format('woff'),
    url('./font/iconfont.ttf?t=1687140360510') format('truetype');
}

@property --percent-name {
  syntax: "<percentage>";
  initial-value: 0.5turn;
  documentation: "The percentage of the circle to fill.";
}

#{$xh-prefix}-progress-circle {
  width: 62px;
  height: 62px;
  display: inline-block;
  border-radius: 50%;
  background: conic-gradient(var(--doneColor, #DDD), var(--percent, 0.25turn), var(--backgroundColor, rgba(0,0,0,0.5)) 0deg);
  position: relative;
  &:after {
    content: "";
    border-radius: 50%;
    width: 80%;
    height: 80%;
    background-color: var(--maskColor);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  &-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    display: inline-block;
    z-index: 6;
  }
  &-done {
    background-color: #FFF;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-block;
    font-family: xh-iconfont;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    text-rendering: auto;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    vertical-align: middle;
    font-size: 42px;
    color: var(--doneColor);
    background-color: transparent;
    &:before {
      content: "\e624";
    }
    z-index: 5;
    animation: finish .4s ease-in-out;
  }
  @keyframes finish {
    0% {
      transform: translate(-50%, -50%) scale(0);
    }
    50% {
      transform: translate(-50%, -50%) scale(1.3);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
    }
  }
}

