FEATURE: add the ability to zoom in and out using touch screen

This commit is contained in:
kharhamel 2021-04-14 17:47:26 +02:00
parent 71898bff7d
commit d7a74baa9d
11 changed files with 77 additions and 10 deletions

View file

@ -0,0 +1,16 @@
class TouchScreenManager {
readonly supportTouchScreen:boolean;
constructor() {
this.supportTouchScreen = this.detectTouchscreen();
}
//found here: https://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript#4819886
detectTouchscreen(): boolean {
return (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
}
}
export const touchScreenManager = new TouchScreenManager();