mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-15 00:14:52 +02:00
feat: add haptic feedback to all action buttons
This commit is contained in:
parent
96dde8cf31
commit
1aa6a441f3
16 changed files with 113 additions and 42 deletions
|
@ -59,6 +59,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: Boolean,
|
||||
|
@ -89,30 +91,37 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
clickedChapterOption() {
|
||||
async clickedChapterOption() {
|
||||
await Haptics.impact({ style: ImpactStyle.Medium });
|
||||
this.show = false
|
||||
this.$nextTick(() => this.$emit('change', { time: this.currentEndOfChapterTime * 1000, isChapterTime: true }))
|
||||
},
|
||||
clickedOption(timeoutMin) {
|
||||
async clickedOption(timeoutMin) {
|
||||
await Haptics.impact({ style: ImpactStyle.Medium });
|
||||
var timeout = timeoutMin * 1000 * 60
|
||||
this.show = false
|
||||
this.manualTimerModal = false
|
||||
this.$nextTick(() => this.$emit('change', { time: timeout, isChapterTime: false }))
|
||||
},
|
||||
cancelSleepTimer() {
|
||||
async cancelSleepTimer() {
|
||||
await Haptics.impact({ style: ImpactStyle.Medium });
|
||||
this.$emit('cancel')
|
||||
this.show = false
|
||||
},
|
||||
increaseSleepTime() {
|
||||
async increaseSleepTime() {
|
||||
await Haptics.impact({ style: ImpactStyle.Medium });
|
||||
this.$emit('increase')
|
||||
},
|
||||
decreaseSleepTime() {
|
||||
async decreaseSleepTime() {
|
||||
await Haptics.impact({ style: ImpactStyle.Medium });
|
||||
this.$emit('decrease')
|
||||
},
|
||||
increaseManualTimeout() {
|
||||
async increaseManualTimeout() {
|
||||
await Haptics.impact({ style: ImpactStyle.Medium });
|
||||
this.manualTimeoutMin++
|
||||
},
|
||||
decreaseManualTimeout() {
|
||||
async decreaseManualTimeout() {
|
||||
await Haptics.impact({ style: ImpactStyle.Medium });
|
||||
if (this.manualTimeoutMin > 1) this.manualTimeoutMin--
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue