Skip to content

Commit

Permalink
Fix progress bar alternating color and ignore strategies with zero po…
Browse files Browse the repository at this point in the history
…wer (snapshot-labs#607)

* Fix progress bar alternating and ignore strategies with zero power

* Remove comment

* Use opacity 20 for strategies 4 -> infinity
  • Loading branch information
samuveth authored Sep 8, 2021
1 parent 3229e3f commit b770aea
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/Ui/Progress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ const bars = computed(() =>
<div
class="w-full h-full bg-[color:var(--border-color)] absolute z-5"
></div>
<!-- TODO: Reword progress bar, for now opcity is just alternating -->
<div
v-for="(bar, i) in bars"
v-for="(bar, i) in bars.filter(b => b !== 0)"
:key="i"
:style="`width: ${parseFloat((100 / max) * bar).toFixed(3)}%;`"
class="bg-blue h-full z-10"
:class="{ 'opacity-50': i % 2 == 1 }"
class="bg-primary h-full z-10"
:class="{
'opacity-80': i === 1,
'opacity-60': i === 2,
'opacity-40': i === 3,
'opacity-20': i >= 4
}"
/>
</div>
</template>

0 comments on commit b770aea

Please sign in to comment.