Lane-dependant stats (fix #5)
This commit is contained in:
@@ -1,27 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
import { LANE_IMAGES, lanePositionToIndex } from '~/utils/cdragon';
|
||||
|
||||
defineProps<{
|
||||
championName: String
|
||||
championLanes: any
|
||||
}>()
|
||||
const emit = defineEmits<{
|
||||
stateChange: [state: String]
|
||||
stateChange: [state: String, lane: number]
|
||||
}>()
|
||||
|
||||
const state = ref("runes")
|
||||
const laneState = ref(0)
|
||||
|
||||
function handleStateChange(newState : string) {
|
||||
function handleStateChange(newState : string, newLane: number) {
|
||||
state.value = newState;
|
||||
emit('stateChange', newState)
|
||||
laneState.value = newLane;
|
||||
emit('stateChange', newState, newLane)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="sidebar-container">
|
||||
<Logo font-size="2.6rem" img-width="60" style="padding-left: 15px; padding-right: 15px; margin-top: 30px;"/>
|
||||
<h1 class="sidebar-link" style="margin-top: 30px; font-size: 2.4rem; padding-left: 20px;">{{ championName }}</h1>
|
||||
<h2 :class="'sidebar-link ' + (state == 'runes' ? 'sidebar-link-selected' : '')"
|
||||
@click="handleStateChange('runes')" style="margin-top: 10px; font-size: 1.9rem; padding-left: 35px;">Runes</h2>
|
||||
<h2 :class="'sidebar-link ' + (state == 'items' ? 'sidebar-link-selected' : '')"
|
||||
@click="handleStateChange('items')" style="margin-top: 10px; font-size: 1.9rem; padding-left: 35px;">Items</h2>
|
||||
|
||||
<div v-for="(lane, i) in championLanes">
|
||||
|
||||
<div style="display: flex; align-items: center; margin-top: 30px;">
|
||||
<h1 style="font-size: 2.4rem; padding-left: 20px;">{{ championName }}</h1>
|
||||
<img style="margin-left: 10px;" width="40" height="40" :src="LANE_IMAGES[lanePositionToIndex(lane.data)]" />
|
||||
<h2 style="margin-left: 5px; font-size: 1.8rem; font-weight: 200;">{{ lane.data.toLowerCase() }}</h2>
|
||||
</div>
|
||||
|
||||
<h2 :class="'sidebar-link ' + (state == 'runes' && laneState == i ? 'sidebar-link-selected' : '')"
|
||||
@click="handleStateChange('runes', i)" style="margin-top: 10px; font-size: 1.9rem; padding-left: 35px;">Runes</h2>
|
||||
<h2 :class="'sidebar-link ' + (state == 'items' && laneState == i ? 'sidebar-link-selected' : '')"
|
||||
@click="handleStateChange('items', i)" style="margin-top: 10px; font-size: 1.9rem; padding-left: 35px;">Items</h2>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user