2019-12-03 20:57:52 +00:00
|
|
|
<template>
|
2020-06-11 20:37:22 +00:00
|
|
|
<div class="flex flex-col min-h-screen overflow-hidden bg-blue-900">
|
2019-12-03 20:57:52 +00:00
|
|
|
<LazyBackground
|
|
|
|
|
:image-source="require('@/assets/img/bg-homepage-1.jpg')"
|
2020-06-11 20:37:22 +00:00
|
|
|
image-class="absolute z-0 w-full h-200"
|
2019-12-03 20:57:52 +00:00
|
|
|
more-backgrounds="linear-gradient(180deg, rgba(42, 67, 101, 0) 0%, #2A4365 50%),"
|
|
|
|
|
transition-name="fade"
|
|
|
|
|
></LazyBackground>
|
|
|
|
|
|
2020-04-01 10:55:55 +00:00
|
|
|
<header
|
|
|
|
|
:class="bgHeader ? 'header-scrolled' : 'bg-transparent'"
|
2020-08-24 12:24:09 +00:00
|
|
|
class="fixed left-0 right-0 z-20 px-4 text-teal-100 transition-colors duration-100 ease-in-out border-b-2 header"
|
2020-04-01 10:55:55 +00:00
|
|
|
style="border-color: rgba(144, 205, 244, 0.4);"
|
|
|
|
|
>
|
2020-08-23 21:43:42 +00:00
|
|
|
<div class="flex items-center justify-between py-2 -mb-2px">
|
2020-04-01 10:55:55 +00:00
|
|
|
<div class="flex flex-1">
|
2019-12-03 20:57:52 +00:00
|
|
|
<router-link to="/">
|
2020-04-01 10:55:55 +00:00
|
|
|
<img class="block h-10" src="@/assets/img/Logo.svg" alt="LeagueStats logo" />
|
2019-12-03 20:57:52 +00:00
|
|
|
</router-link>
|
2020-04-01 10:55:55 +00:00
|
|
|
</div>
|
2019-12-03 20:57:52 +00:00
|
|
|
|
2020-08-23 21:43:42 +00:00
|
|
|
<SearchForm @formSubmit="redirect" :homepage="false" />
|
2020-04-01 10:55:55 +00:00
|
|
|
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<div class="flex items-center justify-end">
|
2020-06-11 20:37:22 +00:00
|
|
|
<a class="relative text-sm discord" href="https://discord.gg/RjBzjfk" target="_blank">
|
2020-04-01 10:55:55 +00:00
|
|
|
<svg
|
|
|
|
|
class="absolute fill-current"
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
viewBox="0 0 448 512"
|
|
|
|
|
>
|
|
|
|
|
<path
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
d="M297.216 243.2c0 15.616-11.52 28.416-26.112 28.416-14.336 0-26.112-12.8-26.112-28.416s11.52-28.416 26.112-28.416c14.592 0 26.112 12.8 26.112 28.416zm-119.552-28.416c-14.592 0-26.112 12.8-26.112 28.416s11.776 28.416 26.112 28.416c14.592 0 26.112-12.8 26.112-28.416.256-15.616-11.52-28.416-26.112-28.416zM448 52.736V512c-64.494-56.994-43.868-38.128-118.784-107.776l13.568 47.36H52.48C23.552 451.584 0 428.032 0 398.848V52.736C0 23.552 23.552 0 52.48 0h343.04C424.448 0 448 23.552 448 52.736zm-72.96 242.688c0-82.432-36.864-149.248-36.864-149.248-36.864-27.648-71.936-26.88-71.936-26.88l-3.584 4.096c43.52 13.312 63.744 32.512 63.744 32.512-60.811-33.329-132.244-33.335-191.232-7.424-9.472 4.352-15.104 7.424-15.104 7.424s21.248-20.224 67.328-33.536l-2.56-3.072s-35.072-.768-71.936 26.88c0 0-36.864 66.816-36.864 149.248 0 0 21.504 37.12 78.08 38.912 0 0 9.472-11.52 17.152-21.248-32.512-9.728-44.8-30.208-44.8-30.208 3.766 2.636 9.976 6.053 10.496 6.4 43.21 24.198 104.588 32.126 159.744 8.96 8.96-3.328 18.944-8.192 29.44-15.104 0 0-12.8 20.992-46.336 30.464 7.68 9.728 16.896 20.736 16.896 20.736 56.576-1.792 78.336-38.912 78.336-38.912z"
|
|
|
|
|
/>
|
|
|
|
|
</svg>
|
|
|
|
|
<span class="ml-8">
|
2020-08-22 13:11:25 +00:00
|
|
|
Join
|
|
|
|
|
<span class="font-bold">our Discord</span>
|
2020-04-01 10:55:55 +00:00
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
2019-12-03 20:57:52 +00:00
|
|
|
</div>
|
2020-04-01 10:55:55 +00:00
|
|
|
</div>
|
|
|
|
|
</header>
|
2019-12-03 20:57:52 +00:00
|
|
|
|
2020-08-23 21:43:42 +00:00
|
|
|
<div class="relative z-10 flex-grow mx-auto mt-20 text-white page-wrapper">
|
2019-12-28 19:35:05 +00:00
|
|
|
<template v-if="summonerLoading || summonerFound">
|
|
|
|
|
<template v-if="summonerLoading">
|
2020-01-01 16:04:55 +00:00
|
|
|
<HeaderLoader />
|
2019-12-28 19:35:05 +00:00
|
|
|
</template>
|
|
|
|
|
<template v-else-if="summonerFound">
|
2020-06-11 20:37:22 +00:00
|
|
|
<div class="flex items-center justify-between">
|
2019-12-03 20:57:52 +00:00
|
|
|
<div>
|
2020-09-26 20:10:14 +00:00
|
|
|
<div class="flex items-center mt-2">
|
2020-06-20 17:46:25 +00:00
|
|
|
<Tooltip>
|
|
|
|
|
<template v-slot:trigger>
|
2020-09-26 20:10:14 +00:00
|
|
|
<h1 class="text-4xl font-extrabold">
|
|
|
|
|
{{ basic.account.name }}
|
2020-06-20 17:46:25 +00:00
|
|
|
</h1>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:default>
|
|
|
|
|
<div
|
|
|
|
|
v-if="basic.account.names.length > 1"
|
|
|
|
|
class="px-2 text-sm text-center text-white select-none"
|
|
|
|
|
>
|
|
|
|
|
<div>Old summoner names</div>
|
|
|
|
|
<ul class="pl-2 text-left">
|
|
|
|
|
<li
|
|
|
|
|
v-for="name in basic.account.names"
|
|
|
|
|
:key="name.date"
|
|
|
|
|
class="text-teal-400"
|
|
|
|
|
>{{ name.name }}</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</Tooltip>
|
2019-12-03 20:57:52 +00:00
|
|
|
<div
|
|
|
|
|
v-if="playing"
|
2020-06-11 20:37:22 +00:00
|
|
|
class="flex items-center px-3 py-1 mt-2 ml-4 bg-teal-800 border border-teal-400 rounded-full"
|
2019-12-03 20:57:52 +00:00
|
|
|
>
|
2020-06-11 20:37:22 +00:00
|
|
|
<div class="w-2 h-2 rounded-full playing-dot bg-teal-flashy"></div>
|
|
|
|
|
<span class="ml-2 text-sm font-semibold text-teal-flashy">In Game</span>
|
2019-12-03 20:57:52 +00:00
|
|
|
</div>
|
2020-02-13 20:18:44 +00:00
|
|
|
<div
|
|
|
|
|
v-if="false"
|
2020-06-11 20:37:22 +00:00
|
|
|
class="inline-flex items-center px-2 py-1 mt-2 ml-4 leading-tight border border-teal-500 rounded"
|
2020-02-13 20:18:44 +00:00
|
|
|
style="background: rgba(40, 94, 97, 0.35);"
|
|
|
|
|
>
|
2020-02-10 19:53:32 +00:00
|
|
|
<svg class="w-4 h-4 text-teal-600">
|
|
|
|
|
<use xlink:href="#star" />
|
|
|
|
|
</svg>
|
2020-06-11 20:37:22 +00:00
|
|
|
<div class="ml-1 text-xs font-bold text-teal-200">Favorite</div>
|
2020-02-10 19:53:32 +00:00
|
|
|
</div>
|
2019-12-03 20:57:52 +00:00
|
|
|
</div>
|
2020-09-26 20:10:14 +00:00
|
|
|
<div class="flex mt-2">
|
2019-12-03 20:57:52 +00:00
|
|
|
<div :class="{'playing': playing}" class="relative w-24 h-24">
|
|
|
|
|
<div
|
|
|
|
|
:class="{'border-2': !playing}"
|
2020-06-11 20:37:22 +00:00
|
|
|
class="relative z-10 w-24 h-24 bg-center bg-cover border-teal-400 rounded-full bg-blue-1000"
|
2019-12-27 17:38:43 +00:00
|
|
|
:style="{backgroundImage: `url('https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/profile-icons/${basic.account.profileIconId}.jpg')`}"
|
2019-12-03 20:57:52 +00:00
|
|
|
>
|
|
|
|
|
<div
|
2020-06-11 20:37:22 +00:00
|
|
|
class="absolute bottom-0 left-0 flex items-center justify-center w-8 h-8 text-xs font-extrabold text-teal-500 bg-blue-900 border-2 border-teal-400 rounded-full"
|
2019-12-27 17:38:43 +00:00
|
|
|
>{{ basic.account.summonerLevel }}</div>
|
2019-12-03 20:57:52 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<SummonerRanked
|
2019-12-27 17:38:43 +00:00
|
|
|
v-if="Object.entries(basic.ranked).length !== 0"
|
|
|
|
|
:ranked="basic.ranked"
|
2019-12-03 20:57:52 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
2019-12-27 17:38:43 +00:00
|
|
|
<RecentActivity :matches="basic.matchList" />
|
2019-12-03 20:57:52 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-02-01 16:14:03 +00:00
|
|
|
<div class="flex items-center justify-between">
|
|
|
|
|
<!-- NAVIGATION -->
|
|
|
|
|
<div class="pb-2">
|
|
|
|
|
<router-link
|
|
|
|
|
:to="{ name: 'summoner', params: { region: $route.params.region, name: $route.params.name }}"
|
|
|
|
|
:class="isRouteActive('summoner')"
|
2020-06-11 20:37:22 +00:00
|
|
|
class="pb-2 text-blue-300 border-b-2 border-transparent cursor-pointer hover:text-blue-100"
|
2020-02-01 16:14:03 +00:00
|
|
|
exact
|
2020-08-22 13:11:25 +00:00
|
|
|
>Overview</router-link>
|
2020-02-01 16:14:03 +00:00
|
|
|
<router-link
|
|
|
|
|
:to="{ name: 'summonerChampions', params: { region: $route.params.region, name: $route.params.name }}"
|
|
|
|
|
:class="isRouteActive('summonerChampions')"
|
2020-06-11 20:37:22 +00:00
|
|
|
class="pb-2 ml-4 text-blue-300 border-b-2 border-transparent cursor-pointer hover:text-blue-100"
|
2020-02-01 16:14:03 +00:00
|
|
|
exact
|
2020-08-22 13:11:25 +00:00
|
|
|
>Champions</router-link>
|
2020-02-01 16:14:03 +00:00
|
|
|
<router-link
|
|
|
|
|
:to="{ name: 'summonerRecords', params: { region: $route.params.region, name: $route.params.name }}"
|
|
|
|
|
:class="isRouteActive('summonerRecords')"
|
2020-06-11 20:37:22 +00:00
|
|
|
class="pb-2 ml-4 text-blue-300 border-b-2 border-transparent cursor-pointer hover:text-blue-100"
|
2020-02-01 16:14:03 +00:00
|
|
|
exact
|
2020-08-22 13:11:25 +00:00
|
|
|
>Records</router-link>
|
2020-02-01 16:14:03 +00:00
|
|
|
<router-link
|
|
|
|
|
:to="{ name: 'summonerLive', params: { region: $route.params.region, name: $route.params.name }}"
|
|
|
|
|
:class="isRouteActive('summonerLive')"
|
2020-06-11 20:37:22 +00:00
|
|
|
class="pb-2 ml-4 text-blue-300 border-b-2 border-transparent cursor-pointer hover:text-blue-100"
|
2020-02-01 16:14:03 +00:00
|
|
|
exact
|
2020-08-22 13:11:25 +00:00
|
|
|
>Live game</router-link>
|
2020-02-01 16:14:03 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Select Season -->
|
2020-02-02 12:11:49 +00:00
|
|
|
<template v-if="$route.meta.season">
|
|
|
|
|
<FilterSeason />
|
|
|
|
|
</template>
|
2020-02-01 16:14:03 +00:00
|
|
|
</div>
|
2019-12-28 19:35:05 +00:00
|
|
|
</template>
|
2020-02-02 12:11:49 +00:00
|
|
|
|
2020-02-14 18:34:11 +00:00
|
|
|
<!-- View -->
|
2019-12-29 16:49:26 +00:00
|
|
|
<transition :name="tabTransition">
|
2019-12-27 21:09:24 +00:00
|
|
|
<slot></slot>
|
2019-12-28 19:35:05 +00:00
|
|
|
</transition>
|
2019-12-03 20:57:52 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-else-if="summonerNotFound">
|
2020-06-11 20:37:22 +00:00
|
|
|
<div class="flex justify-center mt-16">
|
|
|
|
|
<div class="px-4 py-3 text-lg font-bold text-center text-blue-100 rounded-lg bg-gradient">
|
2019-12-03 20:57:52 +00:00
|
|
|
<div>Player can't be found.</div>
|
|
|
|
|
<div>😕</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<MainFooter />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { mapState, mapActions, mapGetters } from 'vuex'
|
2020-02-01 16:14:03 +00:00
|
|
|
import FilterSeason from '@/components/Summoner/FilterSeason.vue'
|
2020-02-13 19:16:13 +00:00
|
|
|
import LazyBackground from '@/components/Common/LazyBackgroundImage.vue'
|
|
|
|
|
import MainFooter from '@/components/Layout/MainFooter.vue'
|
2019-12-03 20:57:52 +00:00
|
|
|
import RecentActivity from '@/components/Summoner/RecentActivity.vue'
|
2020-02-13 19:16:13 +00:00
|
|
|
import SearchForm from '@/components/Form/SearchForm.vue'
|
2020-01-01 16:04:55 +00:00
|
|
|
import HeaderLoader from '@/components/Summoner/HeaderLoader.vue'
|
2019-12-03 20:57:52 +00:00
|
|
|
import SummonerRanked from '@/components/Summoner/SummonerRanked.vue'
|
2020-06-20 17:46:25 +00:00
|
|
|
import Tooltip from '@/components/Common/Tooltip.vue'
|
2019-12-03 20:57:52 +00:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
2020-02-01 16:14:03 +00:00
|
|
|
FilterSeason,
|
2019-12-03 20:57:52 +00:00
|
|
|
LazyBackground,
|
|
|
|
|
MainFooter,
|
|
|
|
|
RecentActivity,
|
|
|
|
|
SearchForm,
|
2020-01-01 16:04:55 +00:00
|
|
|
HeaderLoader,
|
2019-12-03 20:57:52 +00:00
|
|
|
SummonerRanked,
|
2020-06-20 17:46:25 +00:00
|
|
|
Tooltip
|
2019-12-03 20:57:52 +00:00
|
|
|
},
|
|
|
|
|
|
2020-04-01 10:55:55 +00:00
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
bgHeader: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2019-12-03 20:57:52 +00:00
|
|
|
computed: {
|
2019-12-29 16:49:26 +00:00
|
|
|
tabTransition() {
|
2020-01-01 15:39:54 +00:00
|
|
|
return this.summonerFound && this.overviewLoaded ? 'tab' : 'none'
|
2019-12-29 16:49:26 +00:00
|
|
|
},
|
2019-12-03 20:57:52 +00:00
|
|
|
...mapState({
|
2019-12-27 17:38:43 +00:00
|
|
|
basic: state => state.summoner.basic
|
2019-12-03 20:57:52 +00:00
|
|
|
}),
|
2020-01-01 15:39:54 +00:00
|
|
|
...mapGetters('summoner', ['playing', 'overviewLoaded', 'summonerFound', 'summonerNotFound', 'summonerLoading'])
|
2019-12-03 20:57:52 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
watch: {
|
2020-02-14 22:05:59 +00:00
|
|
|
$route(to, from) {
|
|
|
|
|
if (from.params.region === to.params.region && from.params.name === to.params.name)
|
|
|
|
|
return
|
2019-12-03 20:57:52 +00:00
|
|
|
this.apiCall()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2020-01-02 12:18:43 +00:00
|
|
|
created() {
|
2019-12-03 20:57:52 +00:00
|
|
|
this.apiCall()
|
2020-04-01 10:55:55 +00:00
|
|
|
window.addEventListener('scroll', this.handleScroll)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
destroyed() {
|
|
|
|
|
window.removeEventListener('scroll', this.handleScroll)
|
2019-12-03 20:57:52 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
apiCall() {
|
2020-02-14 18:34:11 +00:00
|
|
|
this.updateSettings({ name: 'region', value: this.$route.params.region.toLowerCase() })
|
|
|
|
|
this.basicRequest({ summoner: this.$route.params.name, region: this.$route.params.region })
|
2019-12-03 20:57:52 +00:00
|
|
|
},
|
2020-04-01 10:55:55 +00:00
|
|
|
handleScroll() {
|
|
|
|
|
this.bgHeader = window.scrollY > 25
|
|
|
|
|
},
|
2020-01-25 12:59:39 +00:00
|
|
|
isRouteActive(currentRoute) {
|
|
|
|
|
return {
|
|
|
|
|
'router-link-active': this.$route.name === currentRoute
|
|
|
|
|
}
|
|
|
|
|
},
|
2019-12-03 20:57:52 +00:00
|
|
|
redirect(summoner, region) {
|
2020-04-01 10:55:55 +00:00
|
|
|
this.$router.push(`/summoner/${region}/${summoner}`).catch(() => { })
|
2019-12-03 20:57:52 +00:00
|
|
|
},
|
2020-02-06 18:45:22 +00:00
|
|
|
...mapActions('settings', ['updateSettings']),
|
2019-12-27 17:38:43 +00:00
|
|
|
...mapActions('summoner', ['basicRequest']),
|
2020-06-26 15:27:22 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
metaInfo() {
|
|
|
|
|
return {
|
|
|
|
|
titleTemplate: this.summonerFound ? `${this.basic.account.name} | LeagueStats.gg %s` : 'LeagueStats.gg %s',
|
|
|
|
|
}
|
2019-12-03 20:57:52 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2020-04-01 10:55:55 +00:00
|
|
|
.header-scrolled {
|
|
|
|
|
background-color: rgba(42, 67, 101, 0.95);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.discord svg {
|
|
|
|
|
width: 22px;
|
|
|
|
|
height: 22px;
|
|
|
|
|
transform-origin: bottom left;
|
|
|
|
|
transition: 0.2s ease-in-out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.discord:hover svg {
|
|
|
|
|
width: 24px;
|
|
|
|
|
height: 24px;
|
|
|
|
|
transform: rotate(-5deg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.discord:hover span {
|
|
|
|
|
color: #ebf8ff;
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-03 20:57:52 +00:00
|
|
|
.router-link-active {
|
|
|
|
|
color: #fff;
|
|
|
|
|
border-color: #fff;
|
|
|
|
|
}
|
|
|
|
|
.playing::before {
|
|
|
|
|
z-index: 0;
|
|
|
|
|
background: rgba(137, 160, 181, 0.2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.playing::before,
|
|
|
|
|
.playing::after {
|
|
|
|
|
content: "";
|
|
|
|
|
position: absolute;
|
|
|
|
|
height: 100px;
|
|
|
|
|
width: 100px;
|
|
|
|
|
top: -2px;
|
|
|
|
|
left: -2px;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.playing::after {
|
|
|
|
|
z-index: 0;
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
to top,
|
|
|
|
|
rgba(0, 0, 0, 0) 30%,
|
|
|
|
|
rgb(36, 232, 204) 100%
|
|
|
|
|
);
|
|
|
|
|
animation: 0.75s linear 0s infinite normal none running rotate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes rotate {
|
|
|
|
|
100% {
|
|
|
|
|
transform: rotate(360deg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.playing-dot {
|
|
|
|
|
box-shadow: 0 0 0 0 rgba(0, 0, 0, 1);
|
|
|
|
|
transform: scale(1);
|
|
|
|
|
animation: 2.5s ease-in-out 0s infinite normal none running pulse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes pulse {
|
|
|
|
|
0% {
|
|
|
|
|
transform: scale(0.95);
|
|
|
|
|
box-shadow: 0 0 0 0 rgba(36, 232, 204, 0.7);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
70% {
|
|
|
|
|
transform: scale(1);
|
|
|
|
|
box-shadow: 0 0 0 8px rgba(0, 0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
100% {
|
|
|
|
|
transform: scale(0.95);
|
|
|
|
|
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|