koel/resources/assets/js/visualizers/asteroid/scripts/DeviceChecker.ts
2022-11-07 15:23:59 +01:00

6 lines
396 B
TypeScript

export class DeviceChecker {
isRetina () {
const m = window.matchMedia('only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)')
return (m && m.matches || (window.devicePixelRatio > 1))
}
}