대시보드 화면 감지 기능 추가

This commit is contained in:
dohyeons
2025-10-23 09:56:35 +09:00
parent 298fd11169
commit 73e3bf4159
3 changed files with 31 additions and 7 deletions

View File

@@ -57,11 +57,27 @@ export function detectScreenResolution(): Resolution {
const width = window.screen.width;
const height = window.screen.height;
let detectedResolution: Resolution;
// 화면 해상도에 따라 적절한 캔버스 해상도 반환
if (width >= 3840 || height >= 2160) return "uhd";
if (width >= 2560 || height >= 1440) return "qhd";
if (width >= 1920 || height >= 1080) return "fhd";
return "hd";
if (width >= 3840 || height >= 2160) {
detectedResolution = "uhd";
} else if (width >= 2560 || height >= 1440) {
detectedResolution = "qhd";
} else if (width >= 1920 || height >= 1080) {
detectedResolution = "fhd";
} else {
detectedResolution = "hd";
}
console.log("🖥️ 화면 해상도 자동 감지:", {
screenWidth: width,
screenHeight: height,
detectedResolution,
canvasSize: RESOLUTIONS[detectedResolution],
});
return detectedResolution;
}
/**