koel/resources/assets/js/visualizers/asteroid/scripts/DeviceChecker.ts

7 lines
396 B
TypeScript
Raw Normal View History

2022-11-07 14:23:59 +00:00
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))
}
}