Files
DiceCloud/app/imports/ui/tabletop/TabletopCreatureCard.vue
Stefan Zermatten afb76f6ac4 Iterated on tabletop
2022-04-15 22:36:20 +02:00

62 lines
1.2 KiB
Vue

<template lang="html">
<v-card
style="height: 150px; min-width: 120px;"
:color="active ? 'accent' : ''"
hover
@mouseover="hover = true"
@mouseleave="hover = false"
@click="$emit('click')"
>
<v-img
:src="model.picture"
aspect-ratio="1"
position="top center"
/>
<div
class="small-title"
>
{{ model.name }}
</div>
<card-highlight :active="hover" />
<v-btn
:color="targeted ? 'accent' : ''"
fab
small
style="position: fixed;"
@click.stop="targeted ? $emit('untarget') : $emit('target')"
>
<v-icon>{{ targeted ? 'mdi-target' : 'mdi-target' }}</v-icon>
</v-btn>
</v-card>
</template>
<script lang="js">
import CardHighlight from '/imports/ui/components/CardHighlight.vue';
export default {
components: {
CardHighlight,
},
props: {
model: {
type: Object,
required: true,
},
active: Boolean,
targeted: Boolean,
},
data(){return {
hover: false,
}},
}
</script>
<style lang="css" scoped>
.small-title {
font-size: 14px;
padding: 4px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>