summaryrefslogtreecommitdiff
path: root/src/TalentBox.vue
blob: 8c980f11c6c6a71b4e2bbe092fbc1b714b9149b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
<div>
  <p class="title-box">{{ title }}</p>
  <div class="columns is-mobile">
    <div class="column is-centered">
      <hero-image :actor="entry.Actor" class="is-64x64 hero-image-slot"></hero-image>
      <span class="hero-name">{{ hero }}</span>
    </div>
    <div class="column value is-centered">
      <talent-image v-if="hasTalent" :entry="entry" :size="64"></talent-image>
      <span v-else>No Talent</span>
      <span>{{ value }}{{ label }}</span>
      <span class="type">{{ type }}</span>
    </div>
    </div>
  </div>
</template>

<style scoped>
.title-box {
  font-size: 18px;
  text-transform: uppercase;
}
.is-centered {
  display: flex;
  /* flex-align: center; */
  justify-content: center;
  align-content: center;
  align-items: center;
  flex-direction: column;
}

.hero-image-slot {
  display: inline-block;
}

.hero-image {
  /* width: 128px;
    height: 128px; */
  /* border-radius: 50%; */
  overflow: hidden;
  border: 5px solid rgba(27, 40, 56, 0.1);
}

.hero-name {
  font-size: 18px;
}

.value {
  font-size: 24px;
  text-align: center;
}
.value .type {
  position: absolute;
  bottom: 5px;
  font-size: 14px;
}
</style>


<script>
import Vue from 'vue';
import TalentImage from './TalentImage.vue';
import HeroImage from './HeroImage.vue';
import * as maps from './maps/maps';

export default Vue.component('talent-box', {
  props: ['title', 'content', 'entry', 'type', 'value', 'label'],
  computed: {
    hero() {
      return maps.getHero(this.entry.Actor);
    },
    hasTalent() {
      return maps.getTalentRarity(this.entry.Talent) != 'None';
    },
  },
  components: {
    TalentImage,
    HeroImage,
  }
});
</script>