feat: show emoji picker on non-touch devices

This commit is contained in:
codytseng
2025-05-28 22:04:38 +08:00
parent 94e2a446e8
commit 4785efd43c
2 changed files with 18 additions and 1 deletions

View File

@@ -24,6 +24,11 @@ export function isTorBrowser() {
return /torbrowser/i.test(ua)
}
export function isTouchDevice() {
if (typeof window === 'undefined' || !window.navigator) return false
return 'ontouchstart' in window || navigator.maxTouchPoints > 0
}
export function isInViewport(el: HTMLElement) {
const rect = el.getBoundingClientRect()
return (