UNPKG

@meleon/uni-ui

Version:

A uniapp components library written in vue3 and typescript

1 lines 914 B
export const generateDeviceUI=function(){let t={top:0,width:0,height:0,left:0,right:0},e={};if(uni.getMenuButtonBoundingClientRect){const{top:i,height:h,width:n,left:g,right:r}=uni.getMenuButtonBoundingClientRect(),{screenWidth:s,screenHeight:c,safeArea:o={height:0},statusBarHeight:a=0}=uni.getSystemInfoSync();t={top:i,height:h,width:n,left:g,right:r},e={screenWidth:s,screenHeight:c,safeAreaHeight:o.height,statusBarHeight:a}}else{const{screenWidth:t,screenHeight:i}={screenWidth:window.innerWidth,screenHeight:window.innerHeight};e={screenWidth:t,screenHeight:i,safeAreaHeight:i,statusBarHeight:0}}const{top:i,height:h,width:n,right:g}=t,{screenWidth:r,screenHeight:s,safeAreaHeight:c,statusBarHeight:o}=e,a=2*(i-o)+h;return{ui:{screenWidth:r,statusBarHeight:o,menuButtonWidth:2*(r-g)+n,customBarHeight:a,contentHeight:c-a-50,tabbarHeight:50,bottomBarHeight:s-c-o,windowHeight:c,screenHeight:s},menuButton:t}};