(function() { var remSwitch = true; var oW = null; var timer = null; reset(); window.addEventListener("orientationchange", function() { reset(); }); window.addEventListener("resize", function() { reset(); }); function reset() { if (remSwitch) { remSwitch = false; oW = document.documentElement.clientWidth; if (oW > 1920) { oW = document.documentElement.clientWidth; } if (1500 > oW && oW >= 1400) { oW = document.documentElement.clientWidth * 1.05; } if (1400 > oW && oW >= 1300) { oW = document.documentElement.clientWidth * 1; } if (1300 > oW && oW >= 1200) { oW = document.documentElement.clientWidth * 1.05; } if (1200 > oW && oW >= 768) { oW = document.documentElement.clientWidth * 2; } if (750 >= oW) { oW = 1400; } document.querySelector("html").style.fontSize = oW / 19.2 + "px"; timer = setTimeout(function() { remSwitch = true; clearTimeout(timer); }, 200); } } })();