feat(live): add detailed runes in live game tab

This commit is contained in:
Valentin Kaelin 2020-12-19 18:49:03 +01:00
parent c1cbfd8514
commit e3ce337885
2 changed files with 27 additions and 3 deletions

View file

@ -41,7 +41,7 @@
} }
.fade-fast-enter-active, .fade-fast-leave-active { .fade-fast-enter-active, .fade-fast-leave-active {
transition: opacity .5s; transition: opacity .3s;
} }
.fade-fast-enter, .fade-fast-leave-to, .fade-fast-enter, .fade-fast-leave-to,

View file

@ -24,7 +24,11 @@
> >
<td class="py-1 pl-2 rounded-l-lg"> <td class="py-1 pl-2 rounded-l-lg">
<div class="flex items-center"> <div class="flex items-center">
<div class="flex flex-col items-center"> <div
@click="selectRunes(player)"
:class="{ 'cursor-pointer': player.perks }"
class="flex flex-col items-center runes"
>
<div <div
:style="{backgroundImage: `url('${player.runes.primaryRune}')`}" :style="{backgroundImage: `url('${player.runes.primaryRune}')`}"
class="w-6 h-6 bg-center bg-cover" class="w-6 h-6 bg-center bg-cover"
@ -180,7 +184,7 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { getSummonerLink } from '@/helpers/summoner.js' import { getSummonerLink } from '@/helpers/summoner.js'
import { ContentLoader } from 'vue-content-loader' import { ContentLoader } from 'vue-content-loader'
@ -259,7 +263,19 @@ export default {
url('https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/${championId}/${championId}000.jpg')`, url('https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/${championId}/${championId}000.jpg')`,
} }
}, },
selectRunes(player) {
if(!player.perks) {
return
}
this.displayOrHideRunes({
primaryStyle: player.perks.perkStyle,
secondaryStyle: player.perks.perkSubStyle,
selected: player.perks.perkIds
})
},
getSummonerLink, getSummonerLink,
...mapActions('cdragon', ['displayOrHideRunes']),
} }
} }
</script> </script>
@ -294,4 +310,12 @@ export default {
background-size: cover; background-size: cover;
border-radius: 0.5rem; border-radius: 0.5rem;
} }
.runes {
@apply transition-all duration-150 ease-in-out;
}
.runes:hover {
filter: brightness(1.3);
}
</style> </style>