feat: support closing modal via back button

This commit is contained in:
codytseng 2025-05-06 23:10:35 +08:00
parent 53c8483a3f
commit 60fca48a72
10 changed files with 264 additions and 44 deletions

View file

@ -12,6 +12,12 @@ export function isSafari() {
return /Safari/.test(ua) && /Apple Computer/.test(vendor) && !/Chrome/.test(ua)
}
export function isAndroid() {
if (typeof window === 'undefined' || !window.navigator) return false
const ua = window.navigator.userAgent
return /android/i.test(ua)
}
export function isInViewport(el: HTMLElement) {
const rect = el.getBoundingClientRect()
return (