2025-01-15 08:10:28 +00:00
|
|
|
<script setup>
|
|
|
|
import {ref, defineEmits} from "vue";
|
|
|
|
|
|
|
|
const emit = defineEmits(["click"]);
|
|
|
|
|
|
|
|
const isButtonActive = ref(false);
|
|
|
|
|
|
|
|
const handleButtonPress = () => {
|
|
|
|
isButtonActive.value = true;
|
|
|
|
};
|
|
|
|
const handleButtonRelease = () => {
|
|
|
|
isButtonActive.value = false;
|
|
|
|
emit("click")
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
:class="[
|
2025-01-16 03:12:52 +00:00
|
|
|
'transition-all duration-200',
|
|
|
|
isButtonActive ? 'scale-95' : ''
|
2025-01-15 08:10:28 +00:00
|
|
|
]"
|
|
|
|
@touchstart="handleButtonPress"
|
|
|
|
@touchend="handleButtonRelease"
|
|
|
|
>
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</template>
|