mobile warning
This commit is contained in:
parent
c6534f2554
commit
d6ceb356e5
2 changed files with 13 additions and 0 deletions
|
@ -37,6 +37,7 @@ import {
|
||||||
downloadFile,
|
downloadFile,
|
||||||
hashFromString,
|
hashFromString,
|
||||||
clone,
|
clone,
|
||||||
|
isMobile,
|
||||||
} from './utils.js';
|
} from './utils.js';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -171,6 +172,9 @@ const findInjectPanel = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
|
if (isMobile()) {
|
||||||
|
alert('Variable Time is a tool currently designed to be used on desktop.');
|
||||||
|
}
|
||||||
window.addEventListener('panelEvent', (e) => {
|
window.addEventListener('panelEvent', (e) => {
|
||||||
clearTimeout(window.panelFinderTimeout);
|
clearTimeout(window.panelFinderTimeout);
|
||||||
let target = false;
|
let target = false;
|
||||||
|
|
|
@ -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;
|
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 {
|
export {
|
||||||
|
|
Loading…
Reference in a new issue