LeagueStats/client/src/components/Match.vue

156 lines
3.8 KiB
Vue
Raw Normal View History

2019-03-30 22:55:48 +00:00
<template>
<li class="match bg-white shadow text-sm md:text-base" :class="data.result ? 'win' : 'lose'">
<div class="match-container">
<!-- Responsive -->
2019-08-23 14:48:16 +00:00
<div
class="flex justify-between lg:hidden text-sm text-gray-800 px-2 border-gray-300 border-b"
>
<div class="flex">
<div class="gamemode mr-1">{{ data.gamemode }}</div>
<span></span>
<div class="date ml-1">Il y a {{ data.date }}</div>
</div>
<div>
<div class="date">{{ data.time }}</div>
</div>
</div>
<div class="flex-container">
2019-08-23 14:48:16 +00:00
<div class="first col w-1/3 lg:w-1/4">
<div class="icon-and-sums flex flex-col sm:flex-row">
<div class="relative">
<img
:src="`https://ddragon.leagueoflegends.com/cdn/${$patch}/img/champion/${data.champ}.png`"
class="champion-icon mb-2px sm:mb-0 sm:mr-2px"
alt="example design"
/>
<span class="level absolute bottom-0 left-0 text-white font-bold">{{ data.level }}</span>
</div>
<div class="summonerSpells flex flex-row sm:flex-col">
<img class="spell-icon mr-2px sm:mr-0 sm:mb-2px" :src="data.firstSum" alt="Ignite" />
<img class="spell-icon" :src="data.secondSum" alt="Ignite" />
</div>
</div>
2019-08-23 14:48:16 +00:00
<span class="champion-name hidden sm:block">{{ data.champ }}</span>
2019-03-30 22:55:48 +00:00
</div>
2019-08-23 14:48:16 +00:00
<div class="second col hidden lg:block lg:w-1/4">
<div class="map">{{ data.map }}</div>
<div class="gamemode">{{ data.gamemode }}</div>
</div>
2019-03-30 22:55:48 +00:00
2019-08-23 14:48:16 +00:00
<div class="third col w-1/2 lg:w-1/4 flex-wrap md:flex-no-wrap">
<div
v-for="(item, index) in data.items"
:key="index"
:style="{background: item}"
class="item"
></div>
2019-03-30 22:55:48 +00:00
</div>
2019-08-23 14:48:16 +00:00
<div
class="fourth w-1/6 lg:w-1/4 flex-col items-center justify-center sm:flex-row sm:justify-around"
>
<div
class="score mb-2 sm:mb-0 font-bold"
>{{ data.kills }}/{{ data.deaths }}/{{ data.assists }}</div>
<div class="gold-farm text-center">
<div class="gold flex items-center justify-center mb-2 sm:mb-0">
{{ data.gold }}
<v-icon name="coins" class="h-3 ml-1 text-blue-800" />
</div>
<div class="farm flex items-center justify-center">
{{ data.minions }}
<v-icon name="skull-crossbones" class="h-3 ml-1 text-blue-800" />
</div>
</div>
2019-08-23 14:48:16 +00:00
<div class="duration-date hidden lg:block">
<div class="duration">{{ data.time }}</div>
<div class="date">{{ data.date }}</div>
</div>
2019-03-30 22:55:48 +00:00
</div>
</div>
</div>
2019-03-30 22:55:48 +00:00
</li>
</template>
<script>
2019-03-30 22:55:48 +00:00
export default {
props: {
2019-08-23 14:48:16 +00:00
data: {
type: Object,
required: true
}
2019-03-30 22:55:48 +00:00
}
}
</script>
<style scoped>
.match {
border-bottom: 1px solid #dae1e7;
margin: 16px 0;
2019-03-30 22:55:48 +00:00
}
.match .flex-container {
2019-03-30 22:55:48 +00:00
display: flex;
flex-wrap: wrap;
padding: 16px 8px;
2019-03-30 22:55:48 +00:00
}
.match.win .match-container {
2019-08-23 14:48:16 +00:00
border-left: 10px solid #48bb78;
2019-03-30 22:55:48 +00:00
}
.match.lose .match-container {
2019-08-23 14:48:16 +00:00
border-left: 10px solid #f56565;
}
2019-03-30 22:55:48 +00:00
/* First col */
.match .first {
display: flex;
flex-direction: row;
align-items: center;
}
.champion-icon {
width: 48px;
height: 48px;
display: block;
}
.match .summonerSpells {
margin: 0 8px 0 0;
}
.spell-icon {
width: 23px;
height: 23px;
display: block;
}
/* Second col */
.match .second {
text-align: left;
}
/* Third col */
.match .third {
display: flex;
}
.third .item {
width: 48px;
height: 48px;
margin: 0 2px 0 0;
}
/* Fourth col */
.match .fourth {
display: flex;
align-items: center;
}
</style>