标签:agent mic one ati hone == pixel code roi
const ua: string = window.navigator.userAgent; const isWeixin: boolean = /MicroMessenger/i.test(ua); const isAndroid: boolean = /Android/i.test(ua); const isIOS: boolean = /iP[hone|ad|od] OS/i.test(ua); const isIphone: boolean = /iPhone/i.test(ua); // iphoneX iphoneXS 刘海高度 30px const isIphoneX: boolean = !!(isIphone && window.devicePixelRatio && window.devicePixelRatio === 3 && window.screen.width === 375 && window.screen.height === 812); // 刘海高度: 44px const isIphoneXSMAX: boolean = !!(isIphone && window.devicePixelRatio && window.devicePixelRatio === 3 && window.screen.width === 414 && window.screen.height === 896); // 刘海高度 33px const isIphoneXR: boolean = !!(isIphone && window.devicePixelRatio && window.devicePixelRatio === 2 && window.screen.width === 414 && window.screen.height === 896); // iPhoneX版本以上的刘海屏 const isIphoneXup: boolean = isIphoneX && isIphoneXSMAX && isIphoneXR; export default { isWeixin, isAndroid, isIOS, isIphone, isIphoneX, isIphoneXSMAX, isIphoneXR, isIphoneXup }
标签:agent mic one ati hone == pixel code roi
原文地址:https://www.cnblogs.com/goodluck-tang/p/10496311.html