anxiety/scripts/lib/helpers.js

23 lines
684 B
JavaScript
Raw Normal View History

2019-04-18 11:40:22 +00:00
// I'm twice the number you'll ever be
Math.TAU = Math.PI*2;
// The poor man's jQuery
function $(query){
return document.querySelector(query);
}
// Flush an element's transitions
function flushElementTransitions(element){
if(typeof element == "string") element = $(element);
element.classList.add('clear_transition')
element.clientHeight;
element.classList.remove('clear_transition');
2019-09-17 14:24:40 +00:00
}
// Is On Mobile?
window.IS_ON_MOBILE = false;
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
window.IS_ON_MOBILE = true;
$("#instructions_if_not_mobile").style.display = "none";
$("#instructions_if_mobile").style.display = "inline";
2019-04-18 11:40:22 +00:00
}