diff --git a/src/components/home/Liquid/index.vue b/src/components/home/Liquid/index.vue index 6151d51..f05bb8e 100644 --- a/src/components/home/Liquid/index.vue +++ b/src/components/home/Liquid/index.vue @@ -10,8 +10,10 @@ const props = defineProps({ }, }) const solutionStyle = computed(() => { - const difference = props.data.capacityUsed / props.data.capacityTotal - const process = 100 - (difference * 100) + const difference = (props.data.capacityTotal - props.data.capacityUsed) / props.data.capacityTotal + console.log(difference) + const process = 100 - difference * 100 + console.log(process) const filter = difference > 0.4 ? 'hue-rotate(270deg) saturate(100) brightness(81%)' : difference > 0.1 ? 'hue-rotate(150deg) saturate(100)' : 'hue-rotate(120deg) saturate(100)' return { 'filter': filter, @@ -19,7 +21,7 @@ const solutionStyle = computed(() => { } }) -const percentage = computed(() => Number((props.data.capacityUsed / props.data.capacityTotal).toFixed(2)) * 100) +const percentage = computed(() => Number(((props.data.capacityTotal - props.data.capacityUsed) / props.data.capacityTotal).toFixed(2)) * 100)