Permalink
Browse files

fix deck details color curve

  • Loading branch information...
Manuel-777 committed Jan 27, 2019
1 parent 43c2a62 commit b308bf65b9136fecb3f8dd4211ee9d15bfadc499
Showing with 22 additions and 17 deletions.
  1. +8 −12 window_main/deck_details.js
  2. +14 −5 window_main/index.css
@@ -44,23 +44,19 @@ function deckManaCurve(deck) {
let numbers = $('<div class="mana_curve_numbers"></div>');
manaCounts.forEach((cost, i) => {
let total = cost[0];

let gradient = '';
let manaTotal = cost.reduce(add, 0) - total;
let _start = 0;
let _end = 0;

let curve_column = $(`<div style="height: ${total/curveMax*100}%;" class="mana_curve_column"><div class="mana_curve_number">${total > 0 ? total : ''}</div></div>`);
orderedManaColors.forEach((mc, ind) => {
if (ind < 5 && cost[ind+1] > 0) {
_end = Math.round(cost[ind+1] / manaTotal * 100);

if (gradient !== '') gradient += ',';
gradient += mc+' '+_start+'%, '+mc+' '+_end+'%';

_start = _end;
}
let h = Math.round(cost[ind+1] / manaTotal * 100);
let col = $(`<div style="height: ${h}%; background-color: ${mc};" class="mana_curve_column_color"></div>`);
col.appendTo(curve_column);
}
});

curve.append($(`<div class="mana_curve_column" style="height: ${total/curveMax*100}%; background-image: linear-gradient(${gradient})">${(total > 0 ? total : '')}</div>`))
curve_column.appendTo(curve);

numbers.append($(`<div class="mana_curve_column_number"><div style="margin: 0 auto !important" class="mana_s16 mana_${i}"></div></div>`))
})

@@ -899,20 +899,29 @@ a:hover {
border-bottom: 2px solid rgba(250, 229, 210, 0.8);
width: 100%;
}

.mana_curve_column {
text-align: center;
font-size: 16px;
text-shadow: 3px 3px 3px #000000ad;
font-family: Beleren;
color: #fae5d2;
justify-content: space-around;
width: 1000px;
width: -webkit-fill-available;
flex-direction: column;
margin: 0px 2px;
display: flex;
flex-direction: column;
background-color: rgba(250, 229, 210, 0.8);
}

.mana_curve_number {
opacity: 1;
position: relative;
height: 0px;
top: calc(50% - 8px);
text-align: center;
font-size: 16px;
text-shadow: 3px 3px 3px #000000ad;
font-family: Beleren;
}

.mana_curve_numbers {
display: flex;
align-items: flex-end;

0 comments on commit b308bf6

Please sign in to comment.