JSFiddle - React, Tailwind, and code Playground
by Сергей Тарасевич
JavaScript
"use strict";
function e() {
function e() {
var e = t.adaptive.isIos && 90 === Math.abs(window.orientation),
l = e ? screen.height : screen.width;
t.adaptive.isMobileStyle = t.adaptive.hasMobileVersion && l < s;
var u = t.adaptive.isAndroid ? "device-width" : l,
d = !t.adaptive.isMobileStyle && l < n ? l / n : 1;
r.setAttribute("content", "width=" + u + ", initial-scale=" + d + (t.adaptive.isMobileStyle ? ", maximum-scale=" + d + ", user-scalable=no" : "")),
r.parentNode || a.appendChild(r),
t.adaptive.isMobileStyle = t.adaptive.hasMobileVersion && o.matches,
i();
}
function i() {
var e = "tablet",
s = "touch";
document.body ? t.adaptive.isMobileStyle ? document.body.classList.remove(e, s) : document.body.classList.add(e, s) : document.addEventListener("DOMContentLoaded", i);
}
var s = 600,
n = 1012,
a = document.getElementsByTagName("head")[0],
r = document.querySelector("meta[name=viewport]") || document.createElement("meta");
t.adaptive.hasMobileVersion = document.documentElement.classList.contains("has-mobile-version"),
r.setAttribute("name", "viewport");
var o = window.matchMedia("(max-width: " + s + "px)");
o.addListener(function(e) {
t.adaptive.isMobileStyle = t.adaptive.hasMobileVersion && e.matches
}),
e(),
window.addEventListener("orientationchange", e);
}
var t = window.ivi = window.ivi || {};
t.adaptive = {},
t.adaptive.isIphone = /iPhone|iPod/.test(navigator.userAgent),
t.adaptive.isIpad = /iPad/.test(navigator.userAgent),
t.adaptive.isIos = t.adaptive.isIphone || t.adaptive.isIpad,
t.adaptive.isAndroid = /Android/i.test(navigator.userAgent),
t.adaptive.isMobile = t.adaptive.isIos || t.adaptive.isAndroid,
t.adaptive.isMobileStyle = void 0,
t.adaptive.isPhone = function() {
return t.adaptive.isMobile && t.adaptive.isMobileStyle
},
t.adaptive.isTablet = function() {
return t.adaptive.isMobile &&...