add broker

This commit is contained in:
Litlyx
2024-05-31 14:08:51 +02:00
parent 2b185a9db5
commit 9caec3b92b
17 changed files with 489415 additions and 0 deletions

16
broker/src/ScreenSize.ts Normal file
View File

@@ -0,0 +1,16 @@
export function getDeviceFromScreenSize(width: number, height: number) {
const totalArea = width * height;
const mobileArea = 375 * 667;
const tabletMinArea = 768 * 1366
const tabletMaxArea = 1024 * 1366
const isMobile = totalArea <= mobileArea;
const isTablet = totalArea >= tabletMinArea && totalArea <= tabletMaxArea;
if (isMobile) return 'mobile';
if (isTablet) return 'tablet'
return 'desktop';
}