mirror of
https://github.com/BlossomiShymae/clean-cuts.git
synced 2025-12-06 10:10:47 +01:00
Add overview for TFT map skins
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<span class="badge text-bg-dark border text-dark-emphasis fw-normal d-flex align-items-center gap-2 bg-transparent bg-blur-4 border-light border-opacity-25">
|
||||
<MaterialIcon :size="24" :name="name" />
|
||||
<span class="badge text-bg-dark border text-dark-emphasis fw-normal d-flex align-items-center gap-2 bg-transparent bg-blur-4 border-light border-opacity-25"
|
||||
style="min-height: 32px;">
|
||||
<span class="fw-bold" v-if="label">{{ label }}</span>
|
||||
<MaterialIcon v-if="name" :size="24" :name="name" />
|
||||
<slot></slot>
|
||||
</span>
|
||||
</template>
|
||||
@@ -9,7 +11,8 @@
|
||||
import MaterialIcon from './MaterialIcon.vue';
|
||||
|
||||
defineProps<{
|
||||
name: string
|
||||
name?: string;
|
||||
label?: string;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
:on-first="p.first" :on-last="p.last"/>
|
||||
|
||||
<div class="d-flex flex-wrap justify-content-around gap-2">
|
||||
<div class="card bg-transparent bg-screen border-light border-opacity-25" style="max-width: 140px; width: 140px;"
|
||||
v-for="tftMapSkin in p.pages[p.index.value]" :key="tftMapSkin.itemId">
|
||||
<div class="d-inline-flex align-items-stretch justify-content-stretch" v-for="tftMapSkin in p.pages[p.index.value]" :key="tftMapSkin.itemId">
|
||||
<NuxtLink class="text-decoration-none" :to="`/tft-map-skins/overview/${tftMapSkin.itemId}`">
|
||||
<div class="card h-100 bg-transparent bg-screen border-light border-opacity-25" style="max-width: 140px; width: 140px;">
|
||||
<img :src="tftMapSkin.getLoadoutsIcon('latest')" loading="lazy" onerror="this.onerror = null; this.src='/clean-cuts/img/error.png';" />
|
||||
|
||||
<div class="card-body d-flex flex-column justify-content-end">
|
||||
@@ -20,6 +21,8 @@
|
||||
<Badge name="identifier">{{ tftMapSkin.itemId }}</Badge>
|
||||
</div>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Pagination :pages="p.pages" :count="p.count" :index="p.index.value" :on-prev="p.prev" :on-next="p.next"
|
||||
|
||||
39
pages/tft-map-skins/overview/[id].vue
Normal file
39
pages/tft-map-skins/overview/[id].vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<h1 class="display-4 pb-2 mb-3 border-bottom border-light border-opacity-25 border-4">{{ tftMapSkin.name }}</h1>
|
||||
|
||||
<div class="d-flex flex-wrap gap-3 mb-3">
|
||||
<Badge label="Content ID:">{{ tftMapSkin.contentId }}</Badge>
|
||||
<Badge label="Item ID:">{{ tftMapSkin.itemId }}</Badge>
|
||||
<Badge label="Group Name:">{{ tftMapSkin.groupName }}</Badge>
|
||||
<Badge label="Group ID:">{{ tftMapSkin.groupId }}</Badge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-sm-12 d-flex justify-content-center align-items-center">
|
||||
<img :src="tftMapSkin.getLoadoutsIcon('latest')" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Badge from '~/components/Badge.vue';
|
||||
import useClient from '~/composables/useClient';
|
||||
import useLocale from '~/composables/useLocale';
|
||||
import { TftMapSkin } from '~/core/models';
|
||||
|
||||
const route = useRoute();
|
||||
const id = route.params.id as unknown;
|
||||
|
||||
const { client } = useClient();
|
||||
const { currentLocale } = useLocale();
|
||||
const getTftMapSkins = async () => await client.tftMapSkins.listAsync({ locale: currentLocale.value, version: "latest"});
|
||||
|
||||
const tftMapSkins = ref(await getTftMapSkins());
|
||||
watch(currentLocale, async() => {
|
||||
tftMapSkins.value = await getTftMapSkins();
|
||||
});
|
||||
|
||||
const tftMapSkin = computed(() => tftMapSkins.value.find((x) => x.itemId == id) || new TftMapSkin({}));
|
||||
</script>
|
||||
Reference in New Issue
Block a user