Skip to content

Commit

Permalink
ホバーした0.5秒後にポップアップが出るように調整
Browse files Browse the repository at this point in the history
  • Loading branch information
UnABC committed Jan 13, 2025
1 parent 2544496 commit 862f88f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/components/Main/MainView/MessageElement/StampElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
<stamp-scaled-element
:class="$style.scaleReaction"
:show="isHovered && !isDetailShown"
:show="isHovered && isLongHovered && !isDetailShown"
:stamp="stamp"
/>
</template>
Expand Down Expand Up @@ -94,6 +94,22 @@ watch(
)
const { isHovered, onMouseEnter, onMouseLeave } = useHover()
const hoverTimeout = ref<ReturnType<typeof setTimeout> | null>(null)
const isLongHovered = ref(false)
watch(isHovered, (beginHover) => {
if (beginHover) {
hoverTimeout.value = setTimeout(() => {
isLongHovered.value = true
}, 500)
} else {
if (hoverTimeout.value) {
clearTimeout(hoverTimeout.value)
hoverTimeout.value = null
}
isLongHovered.value = false
}
})
</script>

<style lang="scss" module>
Expand Down

0 comments on commit 862f88f

Please sign in to comment.