Files
afilmory/apps/web/src/lib/device-viewport.ts
Innei 5b512d60a7 feat: enhance Live Photo functionality and improve user experience
- Added support for long press to play Live Photos on mobile devices.
- Implemented a ref for LivePhoto component to control play and stop actions.
- Updated localization files to include new strings for Live Photo playback status.
- Enhanced CSS styles to prevent text selection and improve layout consistency.
- Refactored ExifPanel and ProgressiveImage components for better integration with Live Photo features.

Signed-off-by: Innei <tukon479@gmail.com>
2025-06-28 14:00:12 +08:00

14 lines
406 B
TypeScript

export const isSafari =
/Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent)
export const isMobileDevice = (() => {
if (typeof window === 'undefined') return false
return (
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
navigator.userAgent,
) ||
// 现代检测方式:支持触摸且屏幕较小
'ontouchstart' in window
)
})()