BottomBar for mobile navigation to tierlists

This commit is contained in:
2024-12-21 14:41:52 +01:00
parent bc8ac87225
commit 59ceb24c84
6 changed files with 45 additions and 28 deletions

View File

@@ -21,6 +21,13 @@ function handleStateChange(newState : string, newLane: number) {
const {data: stats}: {data: Ref<{patch: number, count: number}>} = await useFetch("/api/stats")
const route = useRoute()
const selected = ref("");
if(route.path.startsWith("/tierlist/")) {
const lane = route.params.lane as string
selected.value = lane
}
</script>
<template>
@@ -56,8 +63,19 @@ const {data: stats}: {data: Ref<{patch: number, count: number}>} = await useFetc
</div>
<NavTierlistList v-if="tierlistList == true" style="margin-top: 30px;" />
<div v-if="tierlistList == true" style="margin-top: 30px;">
<h2 style="padding-left: 20px; font-size: 2.4rem; margin-bottom: 10px;">Tierlist</h2>
<NuxtLink style="margin-top: 5px; margin-bottom: 5px;" v-for="(pos, i) in POSITIONS" :to="'/tierlist/' + pos">
<div :class="selected == pos ? 'sidebar-link-selected' : ''"
class="sidebar-link" style="padding-left: 35px; display: flex; align-items: center;">
<NuxtImg format="webp"
width="40" height="40"
:src="LANE_IMAGES[i]" :alt="POSITIONS_STR[i]" />
<h3 style="font-size: 2.1rem; font-weight: 200; margin-left: 10px;">{{ POSITIONS_STR[i] }}</h3>
</div>
</NuxtLink>
</div>
<div style="position: absolute; bottom: 0; margin-bottom: 10px; padding-left: 10px;">
<h3 style="font-size: 23px; font-weight: 200;">
Patch {{ stats.patch }}