1/** 2 * å¯ä¼¸ç¼©å¸å±æ¹æ¡ 3 * remè®¡ç®æ¹å¼ï¼è®¾è®¡å¾å°ºå¯¸px / 100 = å®é rem ä¾: 100px = 1rem 4 */ 5! function (window) { 6 var docWidth = 375; 7 var rootHtml = document.documentElement, 8 deviceWidth = rootHtml.clientWidth, 9 resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'; 10 var doc = window.document, 11 docEl = doc.documentElement; 12 13 if (deviceWidth < 750) { 14 var recalc = (function refreshRem() { 15 docEl.style.fontSize = (100 / docWidth * deviceWidth).toFixed(1) + 'px'; 16 return refreshRem; 17 })(); 18 window.removeEventListener(resizeEvt, recalc); 19 } 20 21 window.removeEventListener('resize', resizeBaseFontSize); 22 window.removeEventListener('orientationchange', resizeBaseFontSize); 23 if (deviceWidth < 750) { 24 PhoneResize() 25 if (!doc.addEventListener) return; 26 window.addEventListener(resizeEvt, recalc, false); 27 doc.addEventListener('DOMContentLoaded', recalc, false); 28 } else { 29 resizeBaseFontSize(); 30 window.addEventListener('resize', resizeBaseFontSize, false); 31 window.addEventListener('orientationchange', resizeBaseFontSize, false); 32 } 33 34 function resizeBaseFontSize() { 35 if ( deviceWidth > 1260) { 36 deviceWidth = rootHtml.clientWidth 37 } else { 38 deviceWidth = 1600; 39 } 40 rootHtml.style.fontSize = deviceWidth / 11 + 'px'; 41 } 42 43 44 function PhoneResize() { 45 /* æ·»å å屿 è¯ï¼å®å为1 */ 46 docEl.setAttribute('data-dpr', window.navigator.appVersion.match(/iphone/gi) ? window.devicePixelRatio : 1); 47 48 if (/iP(hone|od|ad)/.test(window.navigator.userAgent)) { 49 /* æ·»å IOSæ è¯ */ 50 doc.documentElement.classList.add('ios'); 51 /* IOS8以ä¸ç»htmlæ·»å hairlineæ ·å¼ï¼ä»¥ä¾¿ç¹æ®å¤ç */ 52 if (parseInt(window.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/)[1], 10) >= 8) 53 doc.documentElement.classList.add('hairline'); 54 } 55 } 56}(window); 57 58 59var screenWidth = window.innerWidth; 60var UI_SIZE_M = 375 // 设计å¾å®½åº¦ 61function converSize(baseNum = 12) { 62 return (document.body.offsetWidth / UI_SIZE_M) * baseNum; 63}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.