const coversupport = 'css' in window && typeof css.supports === 'function' && (css.supports('top: env(a)') || css.supports('top: constant(a)')) document.write('') const displaymodechangeevent = document.createevent('event') displaymodechangeevent.initevent('displaymodechange', false, false) function resizeevent() { const clientwidth = document.documentelement.clientwidth let scale = 1 const displaymode = window.displaymode if (clientwidth > 960) { scale = math.max(1280, clientwidth) / 1920 window.ismobile = false window.ispc = true window.displaymode = 'pc' } else { scale = clientwidth / 750 window.ismobile = true window.ispc = false window.displaymode = 'mobile' } window.$$pagescale = scale document.documentelement.style.fontsize = (scale * 100).tofixed(3) + 'px' if (displaymode !== window.displaymode) { document.dispatchevent(displaymodechangeevent) } } document.addeventlistener('domcontentloaded', function () { resizeevent() }) window.addeventlistener('resize', function () { resizeevent() }) resizeevent()