mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 21:07:27 +00:00
fix(champions): background color 0 opacity if kda was Infinity
This commit is contained in:
parent
7f631d2662
commit
20b7bc08e0
1 changed files with 7 additions and 2 deletions
|
|
@ -233,8 +233,13 @@ export default {
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
bgColor(champion, rgb, stats) {
|
bgColor(champion, rgb, stats) {
|
||||||
const value = parseFloat(champion[stats])
|
const biggestValue = Math.max(
|
||||||
const biggestValue = Math.max(...this.championsToDisplay.map(c => parseFloat(c[stats])), 0)
|
...this.championsToDisplay
|
||||||
|
.filter(c => c[stats] !== Infinity)
|
||||||
|
.map(c => parseFloat(c[stats]))
|
||||||
|
, 0)
|
||||||
|
// Take the second biggest Value if it's an Infinity KDA
|
||||||
|
const value = champion[stats] === Infinity ? biggestValue : parseFloat(champion[stats])
|
||||||
const opacity = (value / biggestValue).toFixed(2)
|
const opacity = (value / biggestValue).toFixed(2)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue