2025-01-15 08:10:28 +00:00
|
|
|
<script setup>
|
2025-01-23 11:41:09 +00:00
|
|
|
import { ref } from "vue";
|
2025-01-15 08:10:28 +00:00
|
|
|
|
|
|
|
const isButtonActive = ref(false);
|
|
|
|
|
2025-01-23 11:41:09 +00:00
|
|
|
const handleButtonPress = (event) => {
|
|
|
|
event.stopPropagation();
|
2025-01-15 08:10:28 +00:00
|
|
|
isButtonActive.value = true;
|
|
|
|
};
|
2025-01-23 11:41:09 +00:00
|
|
|
|
|
|
|
const handleButtonRelease = (event) => {
|
|
|
|
event.stopPropagation();
|
2025-01-15 08:10:28 +00:00
|
|
|
isButtonActive.value = false;
|
|
|
|
};
|
|
|
|
</script>
|
2025-01-23 11:41:09 +00:00
|
|
|
|
2025-01-15 08:10:28 +00:00
|
|
|
<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
|
|
|
]"
|
2025-01-23 11:41:09 +00:00
|
|
|
@touchstart.stop="handleButtonPress"
|
|
|
|
@touchend.stop="handleButtonRelease"
|
2025-01-15 08:10:28 +00:00
|
|
|
>
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
2025-01-23 11:41:09 +00:00
|
|
|
</template>
|