mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 21:07:27 +00:00
feat: update layout to add season select
This commit is contained in:
parent
d1b69aa577
commit
1f7bd5a853
10 changed files with 102 additions and 35 deletions
|
|
@ -3,8 +3,8 @@
|
||||||
<Ripple
|
<Ripple
|
||||||
@click.native="displayDetails"
|
@click.native="displayDetails"
|
||||||
color="rgba(43, 108, 176, 0.7)"
|
color="rgba(43, 108, 176, 0.7)"
|
||||||
:class="[data.result, showDetails ? 'rounded-t-lg' : 'rounded-lg']"
|
:class="[data.result, showDetails ? 'rounded-t-lg' : 'rounded-lg', {'mt-4': indexMatch !== 0 }]"
|
||||||
class="match relative mt-4 bg-blue-800 text-white text-base cursor-pointer hover:shadow-xl"
|
class="match relative bg-blue-800 text-white text-base cursor-pointer hover:shadow-xl"
|
||||||
>
|
>
|
||||||
<div class="relative flex flex-wrap px-5 py-3">
|
<div class="relative flex flex-wrap px-5 py-3">
|
||||||
<div class="first w-4/12 text-left">
|
<div class="first w-4/12 text-left">
|
||||||
|
|
@ -169,6 +169,10 @@ export default {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
indexMatch: {
|
||||||
|
type: Number,
|
||||||
|
default: -1,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
|
||||||
48
client/src/components/Summoner/FilterSeason.vue
Normal file
48
client/src/components/Summoner/FilterSeason.vue
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
<template>
|
||||||
|
<div class="relative group self-end inline-block text-blue-200 leading-none">
|
||||||
|
<select
|
||||||
|
v-model="season"
|
||||||
|
@change="filterSeason"
|
||||||
|
dir="rtl"
|
||||||
|
class="block appearance-none bg-transparent w-full px-4 pr-8 rounded-md cursor-pointer focus:outline-none group-hover:text-white"
|
||||||
|
>
|
||||||
|
<option v-for="(s, index) in seasons" :key="index" :value="s" class="bg-blue-800">Season {{ s }}</option>
|
||||||
|
</select>
|
||||||
|
<div
|
||||||
|
class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"
|
||||||
|
>
|
||||||
|
<svg class="w-4 h-4 text-blue-200 group-hover:text-white">
|
||||||
|
<use xlink:href="#caret-down" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
season: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
currentseason: state => state.summoner.basic.currentSeason,
|
||||||
|
seasons: state => state.summoner.basic.seasons,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.season = this.currentseason
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
filterSeason() {
|
||||||
|
console.log('filter season', this.season)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="text-white">
|
<div class="text-white pb-2">
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<div style="width: 520px; height: 239px;">
|
<div style="width: 520px; height: 239px;">
|
||||||
<content-loader
|
<content-loader
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="mt-3 flex text-center">
|
<div class="mt-3 flex text-center">
|
||||||
<div class="mt-4 w-3/12">
|
<div class="w-3/12">
|
||||||
<div class="bg-blue-850 rounded-lg" style="width: 300px; height: 339px;">
|
<div class="bg-blue-850 rounded-lg" style="width: 300px; height: 339px;">
|
||||||
<content-loader
|
<content-loader
|
||||||
:height="339"
|
:height="339"
|
||||||
|
|
@ -191,7 +191,8 @@
|
||||||
<div
|
<div
|
||||||
v-for="index in 10"
|
v-for="index in 10"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="mt-4 ml-4 bg-blue-850 rounded-lg"
|
:class="{'mt-4': index !== 1}"
|
||||||
|
class="ml-4 bg-blue-850 rounded-lg"
|
||||||
style="width: 884px; height: 144px;"
|
style="width: 884px; height: 144px;"
|
||||||
>
|
>
|
||||||
<content-loader
|
<content-loader
|
||||||
|
|
|
||||||
|
|
@ -62,33 +62,41 @@
|
||||||
<RecentActivity :matches="basic.matchList" />
|
<RecentActivity :matches="basic.matchList" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- NAVIGATION -->
|
<div class="flex items-center justify-between">
|
||||||
<router-link
|
<!-- NAVIGATION -->
|
||||||
:to="{ name: 'summoner', params: { region: $route.params.region, name: $route.params.name }}"
|
<div class="pb-2">
|
||||||
:class="isRouteActive('summoner')"
|
<router-link
|
||||||
class="pb-2 border-b-2 border-transparent text-blue-300 cursor-pointer hover:text-blue-100"
|
:to="{ name: 'summoner', params: { region: $route.params.region, name: $route.params.name }}"
|
||||||
exact
|
:class="isRouteActive('summoner')"
|
||||||
>overview</router-link>
|
class="pb-2 border-b-2 border-transparent text-blue-300 cursor-pointer hover:text-blue-100"
|
||||||
<router-link
|
exact
|
||||||
:to="{ name: 'summonerChampions', params: { region: $route.params.region, name: $route.params.name }}"
|
>overview</router-link>
|
||||||
:class="isRouteActive('summonerChampions')"
|
<router-link
|
||||||
class="ml-4 pb-2 border-b-2 border-transparent text-blue-300 cursor-pointer hover:text-blue-100"
|
:to="{ name: 'summonerChampions', params: { region: $route.params.region, name: $route.params.name }}"
|
||||||
exact
|
:class="isRouteActive('summonerChampions')"
|
||||||
>champions</router-link>
|
class="ml-4 pb-2 border-b-2 border-transparent text-blue-300 cursor-pointer hover:text-blue-100"
|
||||||
<router-link
|
exact
|
||||||
:to="{ name: 'summonerRecords', params: { region: $route.params.region, name: $route.params.name }}"
|
>champions</router-link>
|
||||||
:class="isRouteActive('summonerRecords')"
|
<router-link
|
||||||
class="ml-4 pb-2 border-b-2 border-transparent text-blue-300 cursor-pointer hover:text-blue-100"
|
:to="{ name: 'summonerRecords', params: { region: $route.params.region, name: $route.params.name }}"
|
||||||
exact
|
:class="isRouteActive('summonerRecords')"
|
||||||
>records</router-link>
|
class="ml-4 pb-2 border-b-2 border-transparent text-blue-300 cursor-pointer hover:text-blue-100"
|
||||||
<router-link
|
exact
|
||||||
:to="{ name: 'summonerLive', params: { region: $route.params.region, name: $route.params.name }}"
|
>records</router-link>
|
||||||
:class="isRouteActive('summonerLive')"
|
<router-link
|
||||||
class="ml-4 pb-2 border-b-2 border-transparent text-blue-300 cursor-pointer hover:text-blue-100"
|
:to="{ name: 'summonerLive', params: { region: $route.params.region, name: $route.params.name }}"
|
||||||
exact
|
:class="isRouteActive('summonerLive')"
|
||||||
>live game</router-link>
|
class="ml-4 pb-2 border-b-2 border-transparent text-blue-300 cursor-pointer hover:text-blue-100"
|
||||||
|
exact
|
||||||
|
>live game</router-link>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Select Season -->
|
||||||
|
<FilterSeason />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<!-- View -->
|
<!-- View -->
|
||||||
|
|
||||||
<transition :name="tabTransition">
|
<transition :name="tabTransition">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
@ -110,6 +118,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapActions, mapGetters } from 'vuex'
|
import { mapState, mapActions, mapGetters } from 'vuex'
|
||||||
|
import FilterSeason from '@/components/Summoner/FilterSeason.vue'
|
||||||
import LazyBackground from '@/components/LazyBackgroundImage.vue'
|
import LazyBackground from '@/components/LazyBackgroundImage.vue'
|
||||||
import MainFooter from '@/components/MainFooter.vue'
|
import MainFooter from '@/components/MainFooter.vue'
|
||||||
import RecentActivity from '@/components/Summoner/RecentActivity.vue'
|
import RecentActivity from '@/components/Summoner/RecentActivity.vue'
|
||||||
|
|
@ -119,6 +128,7 @@ import SummonerRanked from '@/components/Summoner/SummonerRanked.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
FilterSeason,
|
||||||
LazyBackground,
|
LazyBackground,
|
||||||
MainFooter,
|
MainFooter,
|
||||||
RecentActivity,
|
RecentActivity,
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,10 @@ export const namespaced = true
|
||||||
export const state = {
|
export const state = {
|
||||||
basic: {
|
basic: {
|
||||||
account: {},
|
account: {},
|
||||||
|
currentSeason: 10,
|
||||||
matchList: [],
|
matchList: [],
|
||||||
ranked: {},
|
ranked: {},
|
||||||
|
seasons: [],
|
||||||
status: '',
|
status: '',
|
||||||
},
|
},
|
||||||
overview: {
|
overview: {
|
||||||
|
|
@ -79,6 +81,7 @@ export const mutations = {
|
||||||
state.basic.account = infos.account
|
state.basic.account = infos.account
|
||||||
state.basic.matchList = infos.matchList
|
state.basic.matchList = infos.matchList
|
||||||
state.basic.ranked = infos.ranked
|
state.basic.ranked = infos.ranked
|
||||||
|
state.basic.seasons = infos.seasons
|
||||||
state.basic.status = 'found'
|
state.basic.status = 'found'
|
||||||
state.live.match = infos.current
|
state.live.match = infos.current
|
||||||
state.live.playing = infos.playing
|
state.live.playing = infos.playing
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-if="overviewLoaded" key="overview" class="mt-3 flex text-center">
|
<div v-if="overviewLoaded" key="overview" class="mt-3 flex text-center">
|
||||||
<div class="mt-4 w-3/12">
|
<div class="w-3/12">
|
||||||
<SummonerChampions />
|
<SummonerChampions />
|
||||||
<SummonerStats />
|
<SummonerStats />
|
||||||
<SummonerMates />
|
<SummonerMates />
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
v-for="(match, index) in overview.matches"
|
v-for="(match, index) in overview.matches"
|
||||||
:key="index"
|
:key="index"
|
||||||
:data="overview.matches[index]"
|
:data="overview.matches[index]"
|
||||||
|
:index-match="index"
|
||||||
/>
|
/>
|
||||||
</ul>
|
</ul>
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div key="champions" class="mt-3">
|
<div key="champions" class="mt-3">
|
||||||
<div class="mt-4 flex items-center">
|
<div class="flex items-center">
|
||||||
<ChampionsSearch @search-champions="updateSearch" />
|
<ChampionsSearch @search-champions="updateSearch" />
|
||||||
<FilterQueue @filter-queue="filterByQueue" :choices="queues" class="ml-4" />
|
<FilterQueue @filter-queue="filterByQueue" :choices="queues" class="ml-4" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div key="records" class="mt-3">
|
<div key="records" class="">
|
||||||
<template v-if="!recordsLoaded || (recordsLoaded && records.maxKda)">
|
<template v-if="!recordsLoaded || (recordsLoaded && records.maxKda)">
|
||||||
<div class="mt-4">
|
<div class="">
|
||||||
<div class="mx-4 text-blue-200 text-2xl border-b-2 border-blue-800 blue-900">basics</div>
|
<div class="mx-4 text-blue-200 text-2xl border-b-2 border-blue-800 blue-900">basics</div>
|
||||||
<div class="-mx-2 flex flex-wrap">
|
<div class="-mx-2 flex flex-wrap">
|
||||||
<template v-if="recordsLoaded">
|
<template v-if="recordsLoaded">
|
||||||
|
|
|
||||||
|
|
@ -488,7 +488,7 @@ module.exports = {
|
||||||
stroke: ['responsive'],
|
stroke: ['responsive'],
|
||||||
tableLayout: ['responsive'],
|
tableLayout: ['responsive'],
|
||||||
textAlign: ['responsive'],
|
textAlign: ['responsive'],
|
||||||
textColor: ['responsive', 'hover', 'focus'],
|
textColor: ['responsive', 'hover', 'focus', 'group-hover'],
|
||||||
textDecoration: ['responsive', 'hover', 'focus'],
|
textDecoration: ['responsive', 'hover', 'focus'],
|
||||||
textTransform: ['responsive'],
|
textTransform: ['responsive'],
|
||||||
userSelect: ['responsive'],
|
userSelect: ['responsive'],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue