<template>
  <div class="quarters">
    <div class="quarter"></div>
    <div class="quarter1"></div>
    <div class="quarter2"></div>
    <div class="quarter3"></div>
    <div class="quarter4"></div>
    <div class="trans done" :style="{transform:`rotate(${processDeg}deg)`,'--boderleft':isDone ? boderleft : '5px solid #666666'}">
      <div class="quarter5"></div>
      <div class="quarter6"></div>
    </div>
    <div class="mask"></div>
    <img class="process-image" :src="require('../assets/'+image)" />
    <span
      class="zero"
      :style="{ color: !isDone ? 'rgb(255,255,255)' : 'rgb(22,41,60)' }"
      >0%</span>
    <span
      class="hundred"
      :style="{ color: isDone ? 'rgb(255,255,255)' : 'rgb(22,41,60)' }"
      >{{percent}}%</span>
  </div>
</template>

<script>
export default {
  name: "QuarterChange",
  props: ["isDone", "image","percent","processDeg"],
  data() {
    return {
      boderleft:'5px solid #91fdb9',
    };
  },
  
};
</script>

<style scoped>
.zero {
  position: absolute;
  top: 150px;
  left: -34px;
}
/* .seventy-five {
  position: absolute;
  -webkit-animation: xAxis 5s 1 cubic-bezier(0.02, 0.25, 0.25, 1) forwards;
  animation: xAxis 5s 1 cubic-bezier(0.02, 0.25, 0.25, 1) forwards;
  top: 150px;
  left: -30px;
}
.seventy-five:after {
  content: "";
  position: absolute;
  left: 20px;
  top: 1px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-left: 5px solid #91fdb9;
  border-right: 5px solid transparent;
  border-bottom: 5px solid transparent;
  -webkit-animation: yAxis 1s 1 cubic-bezier(0.02, 0.25, 0.25, 1) forwards;
  animation: yAxis 1s 1 cubic-bezier(0.02, 0.25, 0.25, 1) forwards;
}

@keyframes xAxis {
  100% {
    -webkit-transform: translateX(6px);
    transform: translateX(6px);
  }
}
@keyframes yAxis {
  100% {
    -webkit-transform: translateY(-32px);
    transform: translateY(-32px) rotate(10deg);
  }
} */

.hundred {
  position: absolute;
  top: -28px;
  left: 135px;
}
.process-image {
  position: absolute;
  width: 180px;
  height: 180px;
  top: 20%;
  left: 50%;
}
.quarters {
  height: 160px;
  width: 160px;
  position: absolute;
  z-index: 0;
  left: 40%;
  top: 40%;
  transform: translate(-50%, -50%);
}
.quarter {
  position: absolute;
  height: 160px;
  width: 160px;
  border-top-left-radius: 160px;
  border: 1px solid rgb(22, 41, 60);
  z-index: inherit;
  box-sizing: border-box;
}
.quarter1 {
  position: absolute;
  height: 150px;
  width: 150px;
  border-top-left-radius: 150px;
  border-left-width: 3px;
  border-left-style: solid;
  border-left-color: rgb(29, 59, 96);
  border-top-width: 3px;
  border-top-style: solid;
  border-top-color: rgb(29, 59, 96);
  left: 10px;
  top: 10px;
  box-sizing: border-box;
  background-image: linear-gradient(
    to bottom right,
    rgb(29, 59, 96),
    transparent,
    transparent
  );
  z-index: inherit;
}
.quarter2 {
  position: absolute;
  height: 125px;
  width: 125px;
  border-top-left-radius: 125px;
  border: 1px solid rgb(22, 41, 60);
  left: 35px;
  top: 35px;
  z-index: inherit;
  box-sizing: border-box;
}
.quarter3 {
  position: absolute;
  height: 80px;
  width: 80px;
  border-top-left-radius: 80px;
  border: 1px solid rgb(22, 41, 60);
  left: 80px;
  top: 80px;
  z-index: inherit;
  box-sizing: border-box;
}
.quarter4 {
  position: absolute;
  height: 70px;
  width: 70px;
  border-top-left-radius: 70px;
  /* border:1px solid rgb(22,41,60); */
  left: 90px;
  top: 90px;
  border-top-left-radius: 140px;
  border-left-width: 4px;
  border-left-style: solid;
  border-left-color: rgb(26, 52, 88);
  border-top-width: 4px;
  border-top-style: solid;
  border-top-color: rgb(26, 52, 88);
  box-sizing: border-box;
  /* background: rgb(22,39,57); */
  background-image: linear-gradient(
    to bottom right,
    rgb(22, 39, 57),
    transparent
  );
  z-index: inherit;
}
.done {
  transform-origin: 150px 0px;
  transition: transform 1s;
  position: relative;
}
.done:after{
  content: "";
  position: absolute;
  left: -18px;
  top: -5px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-left:var(--boderleft);
  border-right: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: rotate(-4deg);
}
.mask {
  position: absolute;
  width: 160px;
  height: 160px;
  background: rgb(10, 16, 28);
  left: 0px;
  top: 160px;
  z-index: 2;
}
.trans {
  position: absolute;
  width: 160px;
  height: 160px;
  left: 10px;
  top: 160px;
  z-index: 1;
}
.quarter5 {
  position: absolute;
  height: 150px;
  width: 150px;
  border-bottom-left-radius: 150px;
  border-bottom: 6px solid rgb(144, 253, 185);
  border-left: 6px solid rgb(144, 253, 185);
  box-sizing: border-box;
  z-index: 1;
  background: linear-gradient(to top right, rgb(64, 116, 78), transparent);
}
/* .quarter6{

    } */
</style>
