traxxx/assets/components/tile/tag.vue

75 lines
1.4 KiB
Vue

<template>
<router-link
:to="{ name: 'tag', params: { tagSlug: tag.slug } }"
:title="tag.name"
class="tile"
>
<span class="title">{{ tag.name }}</span>
<img
v-if="tag.poster"
:src="sfw ? `/img/${tag.poster.sfw.thumbnail}` : `/img/${tag.poster.thumbnail}`"
:alt="tag.name"
class="poster"
>
</router-link>
</template>
<script>
function sfw() {
return this.$store.state.ui.sfw;
}
export default {
props: {
tag: {
type: Object,
default: null,
},
},
computed: {
sfw,
},
};
</script>
<style lang="scss" scoped>
@import 'theme';
.tile {
color: var(--text-light);
background: var(--profile);
display: flex;
flex-direction: column;
align-items: left;
justify-content: flex-end;
box-sizing: border-box;
position: relative;
text-align: center;
text-decoration: none;
box-shadow: inset 0 0 3px var(--darken);
}
.poster {
width: 100%;
height: 16rem;
object-fit: cover;
object-position: 50% 100%;
box-shadow: 0 0 1px var(--darken);
}
.title {
width: 100%;
display: flex;
box-sizing: border-box;
padding: .5rem 1rem;
position: absolute;
bottom: 0;
background: var(--darken);
font-size: 1rem;
font-weight: bold;
text-transform: capitalize;
text-shadow: 0 0 3px var(--darken-strong);
}
</style>