summaryrefslogtreecommitdiff
path: root/src/HeroSearchBox.vue
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2018-05-21 13:09:05 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2018-12-13 16:59:33 +0100
commitaea0fa999fd09951835b2d74c53137624f46929e (patch)
tree3d806b7b5c5dd8b95fd07d6f3402d2231cf981d4 /src/HeroSearchBox.vue
parent73e2c234f2f52357b21fd9fe9b956eeabb8ddc62 (diff)
downloadbrokentalents-aea0fa999fd09951835b2d74c53137624f46929e.tar.gz
brokentalents-aea0fa999fd09951835b2d74c53137624f46929e.zip
major redesign
Diffstat (limited to 'src/HeroSearchBox.vue')
-rw-r--r--src/HeroSearchBox.vue63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/HeroSearchBox.vue b/src/HeroSearchBox.vue
deleted file mode 100644
index a2ec4a9..0000000
--- a/src/HeroSearchBox.vue
+++ /dev/null
@@ -1,63 +0,0 @@
-<template>
- <div class="box">
- <b-field label="Hero">
- <b-input v-model="hero"></b-input>
- </b-field>
-
- <b-table :data="heroReport"
- :default-sort="['Count', 'desc']"
- :default-sort-directon="'desc'"
- :mobile-cards="false">
- <template slot-scope="props">
- <b-table-column field="Actor" label="Hero" sortable>
- {{ getHero(props.row.Actor) }}
- </b-table-column>
-
- <b-table-column field="Talent" label="Talent">
- <div style="display: flex; align-items: center; justify-content: space-between;">
- <span>{{ getTalentName(props.row.Talent) }}</span>
- <talent-image :entry="props.row" :size="48"></talent-image>
- </div>
- </b-table-column>
-
- <b-table-column field="Winner" label="Win Rate" sortable numeric>
- <template v-if="!!props.row.Winner">
- {{ Math.round(100 * props.row.Winner) }}%
- </template>
- </b-table-column>
- </template>
- </b-table>
- </div>
-</template>
-
-<script>
-import Vue from 'vue';
-import TalentImage from './TalentImage.vue';
-import * as maps from './maps/maps';
-
-export default Vue.component('hero-search-box', {
- props: [ 'reportService' ],
- data: function() {
- return {
- hero: maps.getHero(this.reportService.getTopPick('casual_aral').Actor),
- totalPicks: this.reportService.getTotalPicks('casual_aral'),
- getHero: maps.getHero,
- getTalentName: maps.getTalentName,
- };
- },
- computed: {
- heroReport: function() {
- return this.reportService.getReport('casual_aral')
- .filter((entry) => maps.getHero(entry.Actor).includes(this.hero));
- },
- totalHeroPicks: function() {
- return this.heroReport
- .map((entry) => entry.Count)
- .reduce((agg, cur) => agg + cur, 0);
- },
- },
- components: {
- TalentImage,
- },
-});
-</script>