2020-06-27 02:50:13 +00:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
v-if="entity"
|
|
|
|
class="entity content"
|
|
|
|
>
|
|
|
|
<div class="info">
|
2020-06-27 22:44:53 +00:00
|
|
|
<template v-if="entity.hasLogo">
|
|
|
|
<img
|
|
|
|
v-if="$route.name === 'network'"
|
|
|
|
class="logo"
|
|
|
|
:src="`/img/logos/${entity.slug}/thumbs/network.png`"
|
|
|
|
>
|
2020-06-27 02:50:13 +00:00
|
|
|
|
2020-06-27 22:44:53 +00:00
|
|
|
<img
|
|
|
|
v-else-if="entity.parent"
|
|
|
|
class="logo"
|
|
|
|
:src="`/img/logos/${entity.parent.slug}/thumbs/${entity.slug}.png`"
|
|
|
|
>
|
|
|
|
|
|
|
|
<img
|
|
|
|
v-else
|
|
|
|
class="logo"
|
|
|
|
:src="`/img/logos/${entity.slug}/thumbs/${entity.slug}.png`"
|
|
|
|
>
|
|
|
|
</template>
|
2020-06-27 02:50:13 +00:00
|
|
|
|
2020-06-27 22:44:53 +00:00
|
|
|
<h2
|
2020-06-27 22:15:13 +00:00
|
|
|
v-else
|
2020-06-27 22:44:53 +00:00
|
|
|
class="name"
|
|
|
|
>{{ entity.name }}</h2>
|
2020-06-27 22:15:13 +00:00
|
|
|
|
2020-06-27 02:50:13 +00:00
|
|
|
<router-link
|
|
|
|
v-if="entity.parent"
|
2020-06-27 22:15:13 +00:00
|
|
|
:to="`/${entity.parent.type}/${entity.parent.slug}`"
|
2020-06-27 22:44:53 +00:00
|
|
|
class="link parent-link"
|
2020-06-27 02:50:13 +00:00
|
|
|
>
|
|
|
|
<img
|
2020-06-27 22:44:53 +00:00
|
|
|
v-if="entity.parent.hasLogo"
|
2020-06-27 22:15:13 +00:00
|
|
|
class="logo logo-parent"
|
2020-06-27 02:50:13 +00:00
|
|
|
:src="`/img/logos/${entity.parent.slug}/thumbs/network.png`"
|
|
|
|
>
|
2020-06-27 22:44:53 +00:00
|
|
|
|
|
|
|
<h3
|
|
|
|
v-else
|
|
|
|
class="name parent-name"
|
|
|
|
>{{ entity.parent.name }}</h3>
|
2020-06-27 02:50:13 +00:00
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="content-inner">
|
|
|
|
<div
|
|
|
|
v-if="entity.children.length > 0"
|
2020-06-28 01:19:09 +00:00
|
|
|
class="children-container"
|
2020-06-27 02:50:13 +00:00
|
|
|
>
|
2020-06-28 01:58:16 +00:00
|
|
|
<div
|
|
|
|
v-if="expanded"
|
|
|
|
class="expand noselect"
|
|
|
|
@click="expanded = !expanded"
|
|
|
|
>
|
|
|
|
<Icon
|
|
|
|
v-show="expanded"
|
|
|
|
icon="arrow-up3"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
v-show="!expanded"
|
|
|
|
icon="arrow-down3"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
2020-06-28 01:19:09 +00:00
|
|
|
<div
|
|
|
|
class="scroll-container"
|
|
|
|
:class="{ expanded }"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="scroll scroll-left noselect"
|
2020-06-28 01:28:11 +00:00
|
|
|
:class="{ 'scroll-start': scrollAtStart }"
|
2020-06-28 01:19:09 +00:00
|
|
|
@click="scroll('left')"
|
|
|
|
><Icon icon="arrow-left3" /></div>
|
2020-06-27 02:50:13 +00:00
|
|
|
|
2020-06-28 01:19:09 +00:00
|
|
|
<div
|
|
|
|
ref="children"
|
|
|
|
class="children"
|
|
|
|
:class="{ expanded }"
|
|
|
|
@scroll="updateScroll"
|
|
|
|
>
|
|
|
|
<EntityTile
|
|
|
|
v-for="child in entity.children"
|
|
|
|
:key="`child-${child.id}`"
|
|
|
|
:entity="child"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
class="scroll scroll-right noselect"
|
2020-06-28 01:28:11 +00:00
|
|
|
:class="{ 'scroll-end': scrollAtEnd }"
|
2020-06-28 01:19:09 +00:00
|
|
|
@click="scroll('right')"
|
|
|
|
><Icon icon="arrow-right3" /></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
2020-06-28 01:58:16 +00:00
|
|
|
v-if="scrollable || expanded"
|
2020-06-28 01:19:09 +00:00
|
|
|
class="expand noselect"
|
|
|
|
@click="expanded = !expanded"
|
|
|
|
>
|
|
|
|
<Icon
|
|
|
|
v-show="expanded"
|
|
|
|
icon="arrow-up3"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
v-show="!expanded"
|
|
|
|
icon="arrow-down3"
|
|
|
|
/>
|
|
|
|
</div>
|
2020-06-27 02:50:13 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<FilterBar
|
|
|
|
:fetch-releases="fetchEntity"
|
|
|
|
:items-total="totalCount"
|
|
|
|
:items-per-page="limit"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div class="releases">
|
|
|
|
<Releases :releases="entity.releases" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import EntityTile from './tile.vue';
|
|
|
|
import FilterBar from '../header/filter-bar.vue';
|
|
|
|
import Releases from '../releases/releases.vue';
|
|
|
|
|
|
|
|
async function fetchEntity() {
|
|
|
|
const { entity, totalCount } = await this.$store.dispatch('fetchEntityBySlugAndType', {
|
|
|
|
entitySlug: this.$route.params.entitySlug,
|
|
|
|
entityType: this.$route.name,
|
|
|
|
limit: this.limit,
|
|
|
|
range: this.$route.params.range,
|
|
|
|
pageNumber: Number(this.$route.params.pageNumber),
|
|
|
|
});
|
|
|
|
|
|
|
|
this.entity = entity;
|
|
|
|
this.totalCount = totalCount;
|
|
|
|
|
|
|
|
this.pageTitle = entity.name;
|
|
|
|
}
|
|
|
|
|
2020-06-28 01:19:09 +00:00
|
|
|
function updateScroll() {
|
2020-06-28 01:28:11 +00:00
|
|
|
this.scrollable = this.$refs.children.scrollWidth > this.$refs.children.clientWidth;
|
|
|
|
this.scrollAtStart = this.$refs.children.scrollLeft === 0;
|
|
|
|
this.scrollAtEnd = this.$refs.children.scrollWidth - this.$refs.children.clientWidth === this.$refs.children.scrollLeft;
|
2020-06-28 01:19:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function scroll(direction) {
|
|
|
|
if (direction === 'right') {
|
|
|
|
this.$refs.children.scrollLeft = this.$refs.children.scrollLeft + this.$refs.children.clientWidth - 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (direction === 'left') {
|
|
|
|
this.$refs.children.scrollLeft = this.$refs.children.scrollLeft - this.$refs.children.clientWidth + 100;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-27 02:50:13 +00:00
|
|
|
async function mounted() {
|
|
|
|
await this.fetchEntity();
|
2020-06-28 01:19:09 +00:00
|
|
|
|
|
|
|
this.updateScroll();
|
|
|
|
window.addEventListener('resize', this.updateScroll);
|
|
|
|
}
|
|
|
|
|
|
|
|
function beforeDestroy() {
|
|
|
|
window.removeEventListener('resize', this.updateScroll);
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async function route() {
|
|
|
|
await this.fetchEntity();
|
2020-06-28 02:02:44 +00:00
|
|
|
|
|
|
|
this.expanded = false;
|
|
|
|
this.updateScroll();
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
EntityTile,
|
|
|
|
FilterBar,
|
|
|
|
Releases,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
entity: null,
|
|
|
|
totalCount: null,
|
|
|
|
limit: 10,
|
|
|
|
expanded: false,
|
2020-06-28 01:28:11 +00:00
|
|
|
scrollable: true,
|
|
|
|
scrollAtStart: true,
|
|
|
|
scrollAtEnd: false,
|
2020-06-27 02:50:13 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
$route: route,
|
|
|
|
},
|
|
|
|
mounted,
|
2020-06-28 01:19:09 +00:00
|
|
|
beforeDestroy,
|
2020-06-27 02:50:13 +00:00
|
|
|
methods: {
|
|
|
|
fetchEntity,
|
2020-06-28 01:19:09 +00:00
|
|
|
updateScroll,
|
|
|
|
scroll,
|
2020-06-27 02:50:13 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2020-06-28 01:58:16 +00:00
|
|
|
@import 'theme';
|
|
|
|
|
2020-06-27 02:50:13 +00:00
|
|
|
.info {
|
|
|
|
height: 2.5rem;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
padding: 1rem;
|
|
|
|
background: var(--profile);
|
|
|
|
border-bottom: solid 1px var(--lighten-hint);
|
2020-06-28 01:58:16 +00:00
|
|
|
box-shadow: inset 0 0 3px var(--darken);
|
2020-06-27 22:44:53 +00:00
|
|
|
|
|
|
|
.link {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.logo {
|
|
|
|
height: 100%;
|
2020-06-27 22:15:13 +00:00
|
|
|
width: 100%;
|
2020-06-27 02:50:13 +00:00
|
|
|
max-width: 20rem;
|
|
|
|
object-fit: contain;
|
2020-06-27 22:15:13 +00:00
|
|
|
object-position: 0 50%;
|
|
|
|
}
|
|
|
|
|
2020-06-27 22:44:53 +00:00
|
|
|
.name {
|
|
|
|
color: var(--text-light);
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
font-size: 1.5rem;
|
|
|
|
}
|
|
|
|
|
2020-06-27 22:15:13 +00:00
|
|
|
.logo-parent {
|
|
|
|
object-position: 100% 50%;
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
|
|
|
|
2020-06-28 01:19:09 +00:00
|
|
|
.children-container {
|
|
|
|
background: var(--profile);
|
|
|
|
}
|
|
|
|
|
2020-06-27 02:50:13 +00:00
|
|
|
.children {
|
|
|
|
display: flex;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 1rem;
|
|
|
|
border-bottom: solid 1px var(--darken-hint);
|
2020-06-28 01:19:09 +00:00
|
|
|
overflow-x: auto;
|
|
|
|
scroll-behavior: smooth;
|
2020-06-27 02:50:13 +00:00
|
|
|
scrollbar-width: none;
|
|
|
|
|
|
|
|
.tile {
|
|
|
|
width: 15rem;
|
|
|
|
margin: 0 1rem 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.expanded {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
|
|
|
|
grid-gap: 1rem;
|
|
|
|
|
|
|
|
.tile {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.expand {
|
2020-06-28 01:19:09 +00:00
|
|
|
.icon {
|
|
|
|
fill: var(--lighten);
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background: var(--lighten-hint);
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
fill: var(--text-light);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.scroll-container {
|
|
|
|
position: relative;
|
|
|
|
padding: 0 1rem 0 0;
|
|
|
|
|
|
|
|
&.expanded {
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
.scroll {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.scroll {
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
box-sizing: border-box;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
|
2020-06-28 01:28:11 +00:00
|
|
|
&.scroll-start ,
|
|
|
|
&.scroll-end {
|
|
|
|
/* use over v-show so button stays visible while still hovered */
|
2020-06-28 01:19:09 +00:00
|
|
|
display: none;
|
2020-06-28 01:28:11 +00:00
|
|
|
|
|
|
|
.icon {
|
|
|
|
fill: var(--lighten-weak);
|
|
|
|
}
|
2020-06-28 01:19:09 +00:00
|
|
|
}
|
2020-06-27 02:50:13 +00:00
|
|
|
|
|
|
|
.icon {
|
2020-06-28 01:19:09 +00:00
|
|
|
fill: var(--lighten);
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
2020-06-28 01:19:09 +00:00
|
|
|
display: flex;
|
|
|
|
cursor: pointer;
|
2020-06-27 02:50:13 +00:00
|
|
|
|
2020-06-28 01:28:11 +00:00
|
|
|
&:not(.scroll-start):not(.scroll-end) {
|
|
|
|
.icon {
|
|
|
|
fill: var(--text-light);
|
|
|
|
}
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-06-28 01:19:09 +00:00
|
|
|
|
|
|
|
.scroll-left {
|
|
|
|
left: 0;
|
|
|
|
padding: 1rem 2rem 1rem 1rem;
|
|
|
|
background: linear-gradient(to right, var(--profile) 50%, transparent);
|
|
|
|
}
|
|
|
|
|
|
|
|
.scroll-right {
|
|
|
|
right: 0;
|
|
|
|
padding: 1rem 1rem 1rem 2rem;
|
|
|
|
background: linear-gradient(to left, var(--profile) 50%, transparent);
|
|
|
|
}
|
2020-06-28 01:58:16 +00:00
|
|
|
|
|
|
|
@media(max-width: $breakpoint) {
|
|
|
|
.scroll {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
2020-06-27 02:50:13 +00:00
|
|
|
</style>
|