mobile warning

This commit is contained in:
jrkb 2023-09-24 21:36:18 +02:00
parent c6534f2554
commit d6ceb356e5
2 changed files with 13 additions and 0 deletions

View file

@ -37,6 +37,7 @@ import {
downloadFile,
hashFromString,
clone,
isMobile,
} from './utils.js';
import {
@ -171,6 +172,9 @@ const findInjectPanel = () => {
};
window.onload = () => {
if (isMobile()) {
alert('Variable Time is a tool currently designed to be used on desktop.');
}
window.addEventListener('panelEvent', (e) => {
clearTimeout(window.panelFinderTimeout);
let target = false;

View file

@ -386,6 +386,15 @@ const mapValue = (value, low1, high1, low2, high2, clamp=false) => {
return clamp ? Math.min(high2 > low2 ? high2 : low2, Math.max(low2 < high2 ? low2 : high2, mapped)) : mapped;
}
const isMobile = () => {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
return true;
} else if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform)) {
return true;
}
return false;
};
/////////////////////////////////////
export {