summaryrefslogtreecommitdiff
path: root/src/HeroImage.vue
blob: e3d3163ed6a713fcee71a46fe8600f111993b8dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<template>
  <figure class="image">
    <img :src="`/dist/assets/hero-icons/${hero.toLowerCase()}.jpg`"
         :style="round? 'border-radius: 50%' : ''"
         :alt="hero"
         :title="hero">
  </figure>
</template>

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

export default Vue.component('hero-image', {
  props: [ 'actor', 'round' ],
  computed: {
    hero: function() {
      return maps.getHero(this.actor);
    },
  },
});
</script>