Refactor NavBar
This commit is contained in:
19
frontend/components/nav/Bar.vue
Normal file
19
frontend/components/nav/Bar.vue
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
defineProps<{
|
||||||
|
championName?: string
|
||||||
|
championLanes?: Array<LaneData>
|
||||||
|
}>()
|
||||||
|
const emit = defineEmits<{
|
||||||
|
stateChange: [state: string, lane: number]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NavSideBar :champion-name="championName"
|
||||||
|
:champion-lanes="championLanes"
|
||||||
|
@state-change="(s, l) => emit('stateChange', s, l)"/>
|
||||||
|
<NavBottomBar :champion-name="championName"
|
||||||
|
:champion-lanes="championLanes"
|
||||||
|
@state-change="(s, l) => emit('stateChange', s, l)"/>
|
||||||
|
</template>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { LANE_IMAGES, lanePositionToIndex, POSITIONS_STR } from '~/utils/cdragon';
|
import { LANE_IMAGES, lanePositionToIndex, POSITIONS_STR } from '~/utils/cdragon';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
championName: string
|
championName?: string
|
||||||
championLanes?: Array<LaneData>
|
championLanes?: Array<LaneData>
|
||||||
}>()
|
}>()
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ function handleStateChange(newState : string, newLane: number) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<!-- To make content have a 300px margin -->
|
||||||
|
<div class="sidebar-margin" />
|
||||||
|
|
||||||
<div class="sidebar-container">
|
<div class="sidebar-container">
|
||||||
<Logo font-size="2.6rem" img-width="60" style="padding-left: 15px; padding-right: 15px; margin-top: 30px;"/>
|
<Logo font-size="2.6rem" img-width="60" style="padding-left: 15px; padding-right: 15px; margin-top: 30px;"/>
|
||||||
|
|
||||||
@@ -49,13 +52,16 @@ function handleStateChange(newState : string, newLane: number) {
|
|||||||
.sidebar-container {
|
.sidebar-container {
|
||||||
background-color: #2B2826;
|
background-color: #2B2826;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
/* height: 100%; */
|
|
||||||
flex-shrink: 0;
|
|
||||||
|
|
||||||
margin: 0px;
|
position: fixed;
|
||||||
/* position: absolute;
|
top: 0;
|
||||||
top: 0px;
|
left: 0;
|
||||||
left: 0px; */
|
height: 100%;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
.sidebar-margin {
|
||||||
|
width: 300px;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.sidebar-link {
|
.sidebar-link {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
@@ -77,5 +83,8 @@ function handleStateChange(newState : string, newLane: number) {
|
|||||||
.sidebar-container {
|
.sidebar-container {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.sidebar-margin {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -28,13 +28,9 @@ function updateState(newState : string, newLane : number) {
|
|||||||
<Title>{{ championData.name }}</Title>
|
<Title>{{ championData.name }}</Title>
|
||||||
</Head>
|
</Head>
|
||||||
|
|
||||||
<NavBottomBar :champion-name="championData.name"
|
|
||||||
:champion-lanes="championData.lanes"
|
|
||||||
@state-change="updateState"/>
|
|
||||||
|
|
||||||
<div id="alias-content-wrapper">
|
<div id="alias-content-wrapper">
|
||||||
|
|
||||||
<NavSideBar :champion-name="championData.name"
|
<NavBar :champion-name="championData.name"
|
||||||
:champion-lanes="championData.lanes"
|
:champion-lanes="championData.lanes"
|
||||||
@state-change="updateState"/>
|
@state-change="updateState"/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user