2020-06-27 02:50:13 +00:00
|
|
|
<template>
|
|
|
|
<router-link
|
2020-06-27 22:15:13 +00:00
|
|
|
:to="`/${entity.type}/${entity.slug}`"
|
2020-06-27 02:50:13 +00:00
|
|
|
:title="entity.name"
|
|
|
|
class="tile"
|
|
|
|
>
|
2021-10-30 20:41:58 +00:00
|
|
|
<div class="tile-logo">
|
|
|
|
<template v-if="entity.hasLogo">
|
|
|
|
<img
|
|
|
|
v-if="entity.type === 'network' || entity.independent"
|
|
|
|
:src="`/img/logos/${entity.slug}/thumbs/network.png`"
|
|
|
|
:alt="entity.name"
|
|
|
|
loading="lazy"
|
|
|
|
class="logo"
|
|
|
|
@load="$emit('load', $event)"
|
|
|
|
>
|
2020-06-27 22:15:13 +00:00
|
|
|
|
2021-10-30 20:41:58 +00:00
|
|
|
<img
|
|
|
|
v-else-if="entity.parent"
|
|
|
|
:src="`/img/logos/${entity.parent.slug}/thumbs/${entity.slug}.png`"
|
|
|
|
:alt="entity.name"
|
|
|
|
loading="lazy"
|
|
|
|
class="logo"
|
|
|
|
@load="$emit('load', $event)"
|
|
|
|
>
|
2020-06-27 02:50:13 +00:00
|
|
|
|
2021-10-30 20:41:58 +00:00
|
|
|
<img
|
|
|
|
v-else
|
|
|
|
:src="`/img/logos/${entity.slug}/thumbs/${entity.slug}.png`"
|
|
|
|
:alt="entity.name"
|
|
|
|
loading="lazy"
|
|
|
|
class="logo"
|
|
|
|
@load="$emit('load', $event)"
|
|
|
|
>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<span
|
2020-06-27 22:44:53 +00:00
|
|
|
v-else
|
2021-10-30 20:41:58 +00:00
|
|
|
class="name"
|
|
|
|
>{{ entity.name }}</span>
|
|
|
|
</div>
|
2020-06-27 22:44:53 +00:00
|
|
|
|
2022-01-23 23:15:11 +00:00
|
|
|
<span
|
|
|
|
v-if="entity.childrenTotal > 0 || typeof entity.sceneTotal !== 'undefined'"
|
|
|
|
class="count"
|
|
|
|
>
|
|
|
|
<span v-if="typeof entity.sceneTotal !== 'undefined'">{{ entity.sceneTotal }} scenes</span>
|
2021-10-30 20:41:58 +00:00
|
|
|
<span v-if="entity.type === 'network'">{{ entity.childrenTotal }} channels</span>
|
|
|
|
</span>
|
2020-06-27 02:50:13 +00:00
|
|
|
</router-link>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
entity: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
},
|
2020-12-30 01:23:43 +00:00
|
|
|
emits: ['load'],
|
2020-06-27 02:50:13 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import 'theme';
|
|
|
|
|
|
|
|
.tile {
|
2021-04-04 19:52:19 +00:00
|
|
|
height: 100%;
|
2020-07-05 02:27:46 +00:00
|
|
|
background: var(--tile);
|
2020-06-27 02:50:13 +00:00
|
|
|
display: flex;
|
2021-10-30 20:41:58 +00:00
|
|
|
flex-direction: column;
|
2020-06-27 02:50:13 +00:00
|
|
|
flex-shrink: 0;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
box-sizing: border-box;
|
|
|
|
border-radius: .25rem;
|
2021-10-30 20:41:58 +00:00
|
|
|
position: relative;
|
2020-06-27 02:50:13 +00:00
|
|
|
box-shadow: 0 0 3px rgba(0, 0, 0, .25);
|
|
|
|
text-align: center;
|
|
|
|
text-decoration: none;
|
2021-11-20 23:15:19 +00:00
|
|
|
overflow: hidden;
|
2021-10-30 20:41:58 +00:00
|
|
|
|
|
|
|
&:hover .count {
|
2021-11-20 23:15:19 +00:00
|
|
|
bottom: 0;
|
2021-10-30 20:41:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tile-logo {
|
|
|
|
display: flex;
|
|
|
|
flex-grow: 1;
|
|
|
|
padding: .5rem 1rem;
|
|
|
|
overflow: hidden;
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.logo {
|
2020-09-05 02:08:10 +00:00
|
|
|
max-width: 100%;
|
|
|
|
max-height: 100%;
|
2020-06-27 02:50:13 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2021-10-30 20:41:58 +00:00
|
|
|
align-self: center;
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
|
|
|
|
2020-06-27 22:44:53 +00:00
|
|
|
.name {
|
|
|
|
color: var(--text-light);
|
|
|
|
font-size: 1.25rem;
|
|
|
|
font-weight: bold;
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
2021-10-30 20:41:58 +00:00
|
|
|
|
|
|
|
.count {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
width: 100%;
|
2021-11-20 23:15:19 +00:00
|
|
|
position: absolute;
|
|
|
|
bottom: -1.75rem;
|
2021-10-30 20:41:58 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
padding: .25rem .5rem;
|
2021-11-20 23:15:19 +00:00
|
|
|
background: var(--darken-strong);
|
|
|
|
box-shadow: 0 0 3px var(--darken);
|
|
|
|
color: var(--text-light);
|
2021-10-30 20:41:58 +00:00
|
|
|
text-align: center;
|
2021-11-20 23:15:19 +00:00
|
|
|
text-shadow: 1px 1px var(--darken);
|
|
|
|
transition: bottom .1s ease;
|
2021-10-30 20:41:58 +00:00
|
|
|
}
|
2020-06-27 02:50:13 +00:00
|
|
|
</style>
|