Remove <600k toe teams + perf imporvements
This commit is contained in:
@@ -59,19 +59,8 @@ $(function () {
|
|||||||
var matches = data.results[0].result.response.results;
|
var matches = data.results[0].result.response.results;
|
||||||
var matchesArray = [];
|
var matchesArray = [];
|
||||||
|
|
||||||
// @TODO should move everything below to the build process
|
|
||||||
// speed things up a little
|
|
||||||
for (match in matches) {
|
for (match in matches) {
|
||||||
var thisMatch = matches[match];
|
matchesArray.push(matches[match]);
|
||||||
// add enemy total power to match data
|
|
||||||
var power = 0;
|
|
||||||
var attackerTeam = thisMatch.defBattle.attackers;
|
|
||||||
for (titan in attackerTeam) {
|
|
||||||
power += attackerTeam[titan].power;
|
|
||||||
}
|
|
||||||
thisMatch.enemypower = power;
|
|
||||||
|
|
||||||
matchesArray.push(thisMatch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var orderedMatches = matchesArray.sort(function (a, b) {
|
var orderedMatches = matchesArray.sort(function (a, b) {
|
||||||
@@ -79,6 +68,7 @@ $(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
toe.matches = orderedMatches;
|
toe.matches = orderedMatches;
|
||||||
|
console.log(toe.matches);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
// Modules
|
// Modules
|
||||||
"modules/wrapper",
|
"modules/wrapper",
|
||||||
"modules/buttons",
|
"modules/buttons",
|
||||||
|
"modules/titan_thumbs",
|
||||||
"modules/war",
|
"modules/war",
|
||||||
"modules/hamburger",
|
"modules/hamburger",
|
||||||
"modules/header",
|
"modules/header",
|
||||||
@@ -27,4 +28,4 @@
|
|||||||
|
|
||||||
// Print
|
// Print
|
||||||
"base/print"
|
"base/print"
|
||||||
;
|
;
|
||||||
|
|||||||
29
_assets/sass/modules/_titan_thumbs.scss
Normal file
29
_assets/sass/modules/_titan_thumbs.scss
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
[data-titan-thumb] {
|
||||||
|
display: inline-block;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
background: $black;
|
||||||
|
border-radius: 50%;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin: 1px;
|
||||||
|
border: 1px solid #666;
|
||||||
|
background-size: cover;
|
||||||
|
|
||||||
|
&.thumb--large {
|
||||||
|
width: 46px;
|
||||||
|
height: 46px;
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$titans: 0, 1, 2, 3;
|
||||||
|
$elements: 400, 401, 402;
|
||||||
|
|
||||||
|
@each $element in $elements {
|
||||||
|
@each $titan in $titans {
|
||||||
|
$id: #{$element}#{$titan};
|
||||||
|
[data-titan-thumb="#{$id}"] {
|
||||||
|
background-image: url("../img/Titans/#{$id}.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: .2px;
|
letter-spacing: .2px;
|
||||||
display: block;
|
display: block;
|
||||||
padding: 3px 12px;
|
padding: 3px 16px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
margin: 0 5px;
|
margin: 0 5px;
|
||||||
box-shadow: 0 0 0 1px #eee;
|
box-shadow: 0 0 0 1px #eee;
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
&__shortcut {
|
&__shortcut {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-left: 37px;
|
margin-left: 15px;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
width: 46px;
|
width: 46px;
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
max-width: 25%;
|
max-width: 25%;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
.thumb--large {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
max-width: 46px;
|
max-width: 46px;
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
input {
|
input {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
&:checked + img {
|
&:checked + .thumb--large {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,15 +12,11 @@
|
|||||||
<div class="toe__filters">
|
<div class="toe__filters">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="filter" value="any" v-model="filters" />
|
<input type="radio" name="filter" value="any" v-model="filters" />
|
||||||
<span>All</span>
|
<span>No Filters</span>
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<input type="radio" name="filter" value="only_gt_600k" v-model="filters" />
|
|
||||||
<span>> 600k</span>
|
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="filter" value="misses" v-model="filters" />
|
<input type="radio" name="filter" value="misses" v-model="filters" />
|
||||||
<span>< 50 points</span>
|
<span>Misses</span>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="filter" value="only_lords" v-model="filters" />
|
<input type="radio" name="filter" value="only_lords" v-model="filters" />
|
||||||
@@ -33,7 +29,7 @@
|
|||||||
<li v-for="titan in titans">
|
<li v-for="titan in titans">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" :value="titan" v-model="selectedTitans" />
|
<input type="checkbox" :value="titan" v-model="selectedTitans" />
|
||||||
<img :src="'../assets/img/Titans/'+ titan + '.png'" />
|
<span class="thumb--large" :data-titan-thumb="titan" />
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -64,12 +60,11 @@
|
|||||||
v-for="(match, index) in matches"
|
v-for="(match, index) in matches"
|
||||||
v-bind:class="{missed : match.defenceScoreEarned < 50}"
|
v-bind:class="{missed : match.defenceScoreEarned < 50}"
|
||||||
|
|
||||||
v-show="
|
v-if="
|
||||||
!selectedTitans.length &&
|
!selectedTitans.length &&
|
||||||
(
|
(
|
||||||
(filters == 'any' && match.enemypower < 1000000) ||
|
(filters == 'any' && match.enemypower < 1000000) ||
|
||||||
(filters == 'only_lords' && match.enemypower > 1000000) ||
|
(filters == 'only_lords' && match.enemypower > 1000000) ||
|
||||||
(filters == 'only_gt_600k' && match.enemypower > 600000 && match.enemypower < 1000000) ||
|
|
||||||
(filters == 'misses' && match.enemypower < 1000000 && match.defenceScoreEarned < 50)
|
(filters == 'misses' && match.enemypower < 1000000 && match.defenceScoreEarned < 50)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -79,7 +74,6 @@
|
|||||||
(
|
(
|
||||||
(filters == 'any' && match.enemypower < 1000000) ||
|
(filters == 'any' && match.enemypower < 1000000) ||
|
||||||
((filters == 'only_lords') && (match.enemypower > 1000000)) ||
|
((filters == 'only_lords') && (match.enemypower > 1000000)) ||
|
||||||
((filters == 'only_gt_600k') && (match.enemypower > 600000) && (match.enemypower < 1000000)) ||
|
|
||||||
((filters == 'misses') && match.enemypower < 1000000 && (match.defenceScoreEarned < 50))
|
((filters == 'misses') && match.enemypower < 1000000 && (match.defenceScoreEarned < 50))
|
||||||
)"
|
)"
|
||||||
>
|
>
|
||||||
@@ -88,16 +82,16 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<img
|
<span
|
||||||
v-for="(titan, index) in match.defBattle.attackers"
|
v-for="(titan, index) in match.defBattle.attackers"
|
||||||
:title="'Totem level ' + titan.elementSpiritLevel + ', ' + titan.elementSpiritStar + '*'"
|
:title="'Totem level ' + titan.elementSpiritLevel + ', ' + titan.elementSpiritStar + '*'"
|
||||||
:src="'../assets/img/Titans/'+ titan.id + '.png'" />
|
:data-titan-thumb="titan.id" /></span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<img
|
<span
|
||||||
v-for="titan in match.defBattle.defenders[0]"
|
v-for="titan in match.defBattle.defenders[0]"
|
||||||
:src="'../assets/img/Titans/'+ titan.id + '.png'" />
|
:data-titan-thumb="titan.id" /></span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td :title="match.defBattle.userId | humanPlayer">
|
<td :title="match.defBattle.userId | humanPlayer">
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user