traxxx/assets/components/tile/tag.vue

61 lines
1.0 KiB
Vue

<template>
<a
:href="`/tag/${tag.slug}`"
:title="tag.name"
class="tile"
>
<span class="title">{{ tag.name }}</span>
<img
v-if="tag.poster"
:src="`/img/${tag.poster.thumbnail}`"
:alt="tag.name"
class="poster"
>
</a>
</template>
<script>
export default {
props: {
tag: {
type: Object,
default: null,
},
},
};
</script>
<style lang="scss" scoped>
@import 'theme';
.tile {
color: $text;
background: $background;
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
box-shadow: 0 0 3px rgba(0, 0, 0, .25);
text-align: center;
text-decoration: none;
}
.poster {
width: 100%;
height: 14rem;
object-fit: cover;
}
.title {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
padding: .5rem 1rem;
font-weight: bold;
text-transform: capitalize;
}
</style>