feat: add haptic feedback to all action buttons

This commit is contained in:
benonymity 2022-12-08 00:28:28 -05:00
parent 96dde8cf31
commit 1aa6a441f3
16 changed files with 113 additions and 42 deletions

View file

@ -8,7 +8,7 @@
<p v-show="!selectedSeriesName" class="font-book pt-1">{{ totalEntities }} {{ entityTitle }}</p>
<p v-show="selectedSeriesName" class="ml-2 font-book pt-1">{{ selectedSeriesName }} ({{ totalEntities }})</p>
<div class="flex-grow" />
<span v-if="page == 'library' || seriesBookPage" class="material-icons px-2" @click="bookshelfListView = !bookshelfListView">{{ !bookshelfListView ? 'view_list' : 'grid_view' }}</span>
<span v-if="page == 'library' || seriesBookPage" class="material-icons px-2" @click="changeView()">{{ !bookshelfListView ? 'view_list' : 'grid_view' }}</span>
<template v-if="page === 'library'">
<div class="relative flex items-center px-2">
<span class="material-icons" @click="showFilterModal = true">filter_alt</span>
@ -25,6 +25,8 @@
</template>
<script>
import { Haptics, ImpactStyle } from '@capacitor/haptics';
export default {
data() {
return {
@ -102,6 +104,10 @@ export default {
},
setTotalEntities(total) {
this.totalEntities = total
},
async changeView() {
this.bookshelfListView = !this.bookshelfListView
await Haptics.impact({ style: ImpactStyle.Medium });
}
},
mounted() {
@ -120,4 +126,4 @@ export default {
#bookshelf-toolbar {
box-shadow: 0px 5px 5px #11111155;
}
</style>
</style>