Files
DiceCloud/app/imports/ui/properties/components/persona/NoteCard.vue
Stefan Zermatten 4b4e3a8928 Improve hover highlight UI effects for cards in dark mode
In light mode a change in elevation changes the drop shadow, but this is 
all but invisible in dark mode, so I added a highlight to the cards when 
hovering to show that the card can be expanded with a click
2022-03-03 17:21:59 +02:00

73 lines
1.4 KiB
Vue

<template lang="html">
<v-card
:color="model.color"
:data-id="model._id"
hover
:dark="model.color && isDark"
:light="model.color && !isDark"
@click="clickProperty(model._id)"
@mouseover="hover = true"
@mouseleave="hover = false"
>
<v-card-title class="text-h6">
{{ model.name }}
</v-card-title>
<v-card-text v-if="model.summary">
<property-description
text
:model="model.summary"
/>
</v-card-text>
<card-highlight
:active="hover"
:dark="theme.isDark"
/>
</v-card>
</template>
<script lang="js">
import PropertyDescription from '/imports/ui/properties/viewers/shared/PropertyDescription.vue';
import isDarkColor from '/imports/ui/utility/isDarkColor.js';
import CardHighlight from '/imports/ui/components/CardHighlight.vue';
export default {
components: {
PropertyDescription,
CardHighlight,
},
inject: {
theme: {
default: {
isDark: false,
},
},
},
props: {
model: {
type: Object,
required: true,
},
},
data(){ return{
hover: false,
}},
computed: {
isDark(){
return isDarkColor(this.model.color);
},
},
methods: {
clickProperty(_id){
this.$store.commit('pushDialogStack', {
component: 'creature-property-dialog',
elementId: `${_id}`,
data: {_id},
});
},
},
};
</script>
<style lang="css" scoped>
</style>