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
This commit is contained in:
Stefan Zermatten
2022-03-03 17:21:59 +02:00
parent 92a588bfcc
commit 4b4e3a8928
9 changed files with 119 additions and 16 deletions

View File

@@ -2,6 +2,8 @@
<v-card
:hover="hasClickListener"
@click="click"
@mouseover="hasClickListener ? hovering = true : undefined"
@mouseleave="hasClickListener ? hovering = false : undefined"
>
<div class="layout align-center">
<roll-popup
@@ -31,6 +33,7 @@
{{ model.name }}
</v-card-title>
</div>
<card-highlight :active="hasClickListener && hovering" />
</v-card>
</template>
@@ -39,10 +42,12 @@
import RollPopup from '/imports/ui/components/RollPopup.vue';
import doCheck from '/imports/api/engine/actions/doCheck.js';
import {snackbar} from '/imports/ui/components/snackbars/SnackbarQueue.js';
import CardHighlight from '/imports/ui/components/CardHighlight.vue';
export default {
components: {
RollPopup,
CardHighlight,
},
inject: {
context: {
@@ -57,6 +62,7 @@
},
data(){return {
checkLoading: false,
hovering: false,
}},
computed: {
hasClickListener(){

View File

@@ -43,11 +43,17 @@
</div>
</div>
</v-layout>
<card-highlight :active="hover" />
</v-card>
</template>
<script lang="js">
import CardHighlight from '/imports/ui/components/CardHighlight.vue';
export default {
components: {
CardHighlight,
},
inject: {
context: { default: {} }
},