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">
|
2021-04-03 15:18:24 +00:00
|
|
|
<template #trigger>
|
2020-12-13 19:06:17 +00:00
|
|
|
<div class="relative">
|
|
|
|
|
<div
|
|
|
|
|
:style="{ backgroundImage: itemLink(item) }"
|
|
|
|
|
:class="[
|
|
|
|
|
oneRow ? 'ml-2px w-6 h-6' : 'ml-1 w-8 h-8',
|
|
|
|
|
{ 'cursor-pointer': item !== null },
|
|
|
|
|
]"
|
|
|
|
|
class="relative z-10 bg-center bg-cover rounded-md bg-blue-1000"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
v-if="isMythic(item)"
|
|
|
|
|
class="w-full h-full rounded-md mythic-inside"
|
|
|
|
|
></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-if="isMythic(item)"
|
|
|
|
|
class="absolute rounded-md mythic"
|
|
|
|
|
:class="oneRow ? 'mythic-sm' : 'mythic-xl'"
|
|
|
|
|
></div>
|
|
|
|
|
</div>
|
2019-11-14 20:22:01 +00:00
|
|
|
</template>
|
2021-04-03 15:18:24 +00:00
|
|
|
<template v-if="item !== null" #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">
|
2020-12-05 16:54:16 +00:00
|
|
|
<div class="text-base">{{ itemName(item.name) }}</div>
|
2019-11-14 20:22:01 +00:00
|
|
|
<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: {
|
2020-12-13 19:06:17 +00:00
|
|
|
isMythic(item) {
|
|
|
|
|
return item && item.image.includes('t4')
|
|
|
|
|
},
|
2020-11-14 17:28:39 +00:00
|
|
|
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}')`
|
2020-12-05 16:54:16 +00:00
|
|
|
},
|
|
|
|
|
itemName(name) {
|
|
|
|
|
// Remove placeholders in item names (e.g.: for Ornn items)
|
|
|
|
|
return name.replace(/%[^%]*%/, '')
|
2020-11-14 17:28:39 +00:00
|
|
|
}
|
2019-11-14 20:22:01 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2020-12-13 19:06:17 +00:00
|
|
|
.mythic {
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
195deg,
|
|
|
|
|
rgb(255, 197, 47) 0%,
|
|
|
|
|
rgb(255, 231, 146) 50%,
|
|
|
|
|
rgb(214, 128, 0) 100%
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mythic-sm {
|
|
|
|
|
top: -1px;
|
|
|
|
|
left: 1px;
|
|
|
|
|
width: calc(1.5rem + 2px);
|
|
|
|
|
height: calc(1.5rem + 2px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mythic-xl {
|
|
|
|
|
top: -2px;
|
|
|
|
|
left: 2px;
|
|
|
|
|
width: calc(2rem + 4px);
|
|
|
|
|
height: calc(2rem + 4px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mythic-inside {
|
|
|
|
|
box-shadow: rgb(26, 32, 44) 0px 0px 0px 1px inset;
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-14 20:22:01 +00:00
|
|
|
.items-2-rows {
|
|
|
|
|
width: 7rem;
|
|
|
|
|
height: 4.5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> stats {
|
2020-12-05 16:54:16 +00:00
|
|
|
@apply text-white leading-tight;
|
2019-11-14 20:22:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> br + br {
|
2020-12-05 16:54:16 +00:00
|
|
|
@apply hidden;
|
2019-11-14 20:22:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> stats br {
|
2020-12-05 16:54:16 +00:00
|
|
|
@apply block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> li {
|
|
|
|
|
@apply block mt-2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> passive {
|
|
|
|
|
@apply text-white font-normal;
|
2019-11-14 20:22:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> active {
|
2020-12-05 16:54:16 +00:00
|
|
|
@apply inline-block text-white font-bold mt-2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> unique,
|
|
|
|
|
.item-description >>> li > passive:first-child,
|
|
|
|
|
.item-description >>> rarityMythic {
|
|
|
|
|
@apply text-white font-bold block mt-2;
|
2019-11-14 20:22:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> font {
|
2020-12-05 16:54:16 +00:00
|
|
|
@apply text-blue-400;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> rules {
|
2020-12-16 20:31:36 +00:00
|
|
|
@apply inline-block mt-2 text-blue-400 italic;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-description >>> rules active {
|
|
|
|
|
@apply inline text-white font-normal;
|
2019-11-14 20:22:01 +00:00
|
|
|
}
|
2020-12-05 16:54:16 +00:00
|
|
|
</style>
|