fix: Calculator fixes
Add mobile/desktop fixes to calculator
This commit is contained in:
parent
d71e59b9c0
commit
d7b624df4d
1 changed files with 13 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<article class="PriceCard roboto-condensed" v-ripple="{ color: 'rgba(0, 0, 0, 0.1)' }">
|
||||
<article class="PriceCard roboto-condensed" v-ripple="$device.isMobile ? { color: 'rgba(0, 0, 0, 0.1)' } : { duration: 0, scale: 0 }">
|
||||
<div class="bottom">
|
||||
<div class="bg-edit">
|
||||
<Icon class="icon" name="uil:pen" mode="svg" />
|
||||
|
@ -13,7 +13,7 @@
|
|||
class="top flex-col"
|
||||
:class="{ 'animated' : !isSwiping }"
|
||||
:style="{ left }"
|
||||
@click="update"
|
||||
@click="cardClick"
|
||||
>
|
||||
<header>
|
||||
<div class="name-price">
|
||||
|
@ -86,8 +86,10 @@ const { lengthX, direction, isSwiping } = useSwipe(top, {
|
|||
},
|
||||
onSwipeEnd() {
|
||||
if (['down', 'up'].includes(direction.value)) return
|
||||
if (lengthX.value > 50) deleteCard()
|
||||
if (lengthX.value > 50) {
|
||||
vibrate(100)
|
||||
deleteCard()
|
||||
}
|
||||
left.value = '0'
|
||||
},
|
||||
})
|
||||
|
@ -97,6 +99,13 @@ const ppr = computed(() => priceClean.value / +card.roles)
|
|||
const pps = computed(() => (ppr.value / +card.sheets) * 100)
|
||||
const ppl = computed(() => (pps.value / +card.layers) * 10)
|
||||
|
||||
const { isDesktop } = useDevice()
|
||||
|
||||
const cardClick = () => {
|
||||
if (isDesktop) return
|
||||
emit('update')
|
||||
}
|
||||
|
||||
const update = () => emit('update')
|
||||
const deleteCard = () => emit('remove')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue