2019-11-14 20:22:01 +00:00
|
|
|
<template>
|
2020-11-14 17:28:39 +00:00
|
|
|
<div
|
|
|
|
|
:class="oneRow ? 'ml-2 items-center' : 'items-2-rows flex-wrap'"
|
|
|
|
|
class="flex"
|
|
|
|
|
>
|
2020-02-13 19:16:13 +00:00
|
|
|
<Tooltip v-for="(item, index) in items" :key="index">
|
2019-11-14 20:22:01 +00:00
|
|
|
<template v-slot:trigger>
|
|
|
|
|
<div
|
2020-11-14 17:28:39 +00:00
|
|
|
:style="{ backgroundImage: itemLink(item) }"
|
|
|
|
|
:class="[
|
|
|
|
|
oneRow ? 'ml-2px w-6 h-6' : 'ml-1 w-8 h-8',
|
|
|
|
|
{ 'cursor-pointer': item !== null },
|
|
|
|
|
]"
|
2020-06-11 18:55:39 +00:00
|
|
|
class="bg-center bg-cover rounded-md bg-blue-1000"
|
2019-11-14 20:22:01 +00:00
|
|
|
></div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="item !== null" v-slot:default>
|
2020-06-11 18:55:39 +00:00
|
|
|
<div class="flex max-w-md p-2 text-xs text-left text-white select-none">
|
2019-11-14 20:22:01 +00:00
|
|
|
<div
|
2020-11-14 17:28:39 +00:00
|
|
|
:style="{ backgroundImage: itemLink(item) }"
|
2020-06-11 18:55:39 +00:00
|
|
|
class="flex-shrink-0 w-12 h-12 ml-1 bg-center bg-cover rounded-md bg-blue-1000"
|
2019-11-14 20:22:01 +00:00
|
|
|
></div>
|
|
|
|
|
<div class="ml-2 leading-none">
|
|
|
|
|
<div class="text-base">{{ item.name }}</div>
|
|
|
|
|
<div class="mt-1">
|
|
|
|
|
<span class="text-blue-200">Price:</span>
|
2020-11-14 17:28:39 +00:00
|
|
|
<span class="ml-1 text-sm font-semibold text-yellow-500">{{
|
|
|
|
|
item.price
|
|
|
|
|
}}</span>
|
2019-11-14 20:22:01 +00:00
|
|
|
</div>
|
2020-11-14 17:28:39 +00:00
|
|
|
<div
|
|
|
|
|
v-html="item.description"
|
|
|
|
|
class="mt-1 font-light text-blue-200 item-description"
|
|
|
|
|
></div>
|
2019-11-14 20:22:01 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2020-02-13 19:16:13 +00:00
|
|
|
</Tooltip>
|
2019-11-14 20:22:01 +00:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2020-02-13 19:16:13 +00:00
|
|
|
import Tooltip from '@/components/Common/Tooltip.vue'
|
2019-11-14 20:22:01 +00:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
2020-02-13 19:16:13 +00:00
|
|
|
Tooltip
|
2019-11-14 20:22:01 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
props: {
|
|
|
|
|
oneRow: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false
|
|
|
|
|
},
|
|
|
|
|
items: {
|
|
|
|
|
type: Array,
|
|
|
|
|
required: true
|
|
|
|
|
}
|
2020-11-14 17:28:39 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
itemLink(item) {
|
|
|
|
|
if (!item) {
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Fix to still make work the old items links (before season 11)
|
|
|
|
|
const originalUrl = item.image
|
|
|
|
|
const newUrl = originalUrl.includes('/global/default/assets/items/') ? originalUrl : originalUrl.replace('latest', '10.22')
|
|
|
|
|
return `url('${newUrl}')`
|
|
|
|
|
}
|
2019-11-14 20:22:01 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.items-2-rows {
|
|
|
|
|
width: 7rem;
|
|
|
|
|
height: 4.5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> stats {
|
|
|
|
|
color: #fff;
|
|
|
|
|
line-height: 1.25;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> br + br {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> stats br {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> unique,
|
|
|
|
|
.item-description >>> passive,
|
|
|
|
|
.item-description >>> active {
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
display: block;
|
|
|
|
|
margin-top: 0.5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> font {
|
|
|
|
|
color: #63b3ed;
|
|
|
|
|
}
|
|
|
|
|
</style>
|