Update summoner emotes

This commit is contained in:
Blossomi Shymae
2024-10-11 15:51:53 -05:00
parent fde869ff6c
commit 7ad50cf42d

View File

@@ -1,40 +1,4 @@
<template>
<div class="d-flex flex-column gap-2">
<h1 class="mb-3">Summoner Emotes</h1>
<div class="input-group">
<input type="text" class="form-control bg-transparent border-light border-opacity-25" placeholder="Search" name="Search"
v-model="query"/>
</div>
<Pagination :pages="p.pages" :count="p.count" :index="p.index.value" :on-prev="p.prev" :on-next="p.next"
: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="emote in p.pages[p.index.value]" :key="emote.id">
<img :src="emote.getInventoryIcon('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">
<h5 class="card-title">{{ emote.name }}</h5>
<Badge name="identifier">{{ emote.id }}</Badge>
</div>
</div>
</div>
<Pagination :pages="p.pages" :count="p.count" :index="p.index.value" :on-prev="p.prev" :on-next="p.next"
:on-first="p.first" :on-last="p.last"/>
</div>
</template>
<script setup lang="ts"> <script setup lang="ts">
import Pagination from '../../components/Pagination.vue';
import Badge from '~/components/Badge.vue';
import useClient from '../../composables/useClient';
import useLocale from '~/composables/useLocale';
import useIsNumeric from '../../composables/useIsNumeric';
import usePagination from '../../composables/usePagination';
const { client } = useClient(); const { client } = useClient();
const { currentLocale } = useLocale(); const { currentLocale } = useLocale();
const getEmotes = async () => (await client.summonerEmotes.listAsync({locale: currentLocale.value, version: "latest"})) const getEmotes = async () => (await client.summonerEmotes.listAsync({locale: currentLocale.value, version: "latest"}))
@@ -55,6 +19,37 @@ const p = computed(() => {
else else
filtered = emotes.value.filter((x) => x.name.toLowerCase().includes(query.value.toLowerCase())); filtered = emotes.value.filter((x) => x.name.toLowerCase().includes(query.value.toLowerCase()));
return usePagination(filtered, 24); return usePagination(filtered, 100);
}) })
</script> </script>
<template>
<div class="d-flex flex-column gap-4">
<div class="d-flex justify-content-end gap-2">
<Card class="d-flex justify-content-center align-items-center me-auto">
<span>{{ emotes.length }} summoner emotes</span>
</Card>
<Pagination :pages="p.pages" :count="p.count" :index="p.index.value" :on-prev="p.prev" :on-next="p.next"
:on-first="p.first" :on-last="p.last" style="min-width: 300px;"/>
<div class="input-group" style="max-width: 400px;">
<input type="text" class="form-control border-light border-opacity-25" placeholder="Search" name="Search"
v-model="query"/>
</div>
</div>
<div class="d-flex flex-wrap justify-content-center gap-4">
<div style="width: 200px;" v-for="summonerEmote in p.pages[p.index.value]"
data-aos="zoom-out"
data-aos-duration="500">
<div class="ratio ratio-1x1 position-relative">
<img class="app-backgroud rounded" :src="summonerEmote.getInventoryIcon('latest')" loading="lazy"/>
<div class="position-absolute z-1 d-flex flex-column justify-content-end">
<div class="d-inline-flex justify-content-between bg-dark-gradient p-1 m-2 rounded-bottom">
<span>{{ summonerEmote.name }}</span>
<span>{{ summonerEmote.id }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</template>