master
chenzhi 3 years ago
parent 0e82241aa6
commit 3125e2527d

@ -3,6 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script src="__JS__/resize.js" type=""></script>
<title>隐私指引</title> <title>隐私指引</title>
</head> </head>
<style> <style>
@ -12,14 +13,14 @@
} }
.title{ .title{
text-align: center; text-align: center;
font-size: 14px; font-size: .40rem;
} }
h2,p{ h2,p{
color: #333; color: #333;
font-weight: 400; font-weight: 400;
} }
p{ p{
font-size: 12px; font-size: .32rem;
line-height: 20px; line-height: 20px;
} }

@ -0,0 +1,39 @@
!function (window) {
/* 设计图文档宽度 */
var docWidth = 750;
var doc = window.document,
docEl = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
var recalc = (function refreshRem () {
var clientWidth = docEl.getBoundingClientRect().width;
if(clientWidth >1023){
docEl.style.fontSize = Math.max(Math.min(20 * (clientWidth / 2048), 38.5),25) * 5 + 'px';
}else if(clientWidth > 750){
docEl.style.fontSize = Math.max(Math.min(20 * (clientWidth / 1536), 29.5),20) * 5 + 'px';
}else{
/* 8.55小于320px不再缩小11.2大于420px不再放大 17.2 大于667不再放大*/
docEl.style.fontSize = Math.max(Math.min(20 * (clientWidth / docWidth), 17.2), 8.55) * 5 + 'px';
}
return refreshRem;
})();
/* 添加倍屏标识安卓为1 */
docEl.setAttribute('data-dpr', window.navigator.appVersion.match(/iphone/gi) ? window.devicePixelRatio : 1);
if (/iP(hone|od|ad)/.test(window.navigator.userAgent)) {
/* 添加IOS标识 */
doc.documentElement.classList.add('ios');
/* IOS8以上给html添加hairline样式以便特殊处理 */
if (parseInt(window.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/)[1], 10) >= 8)
doc.documentElement.classList.add('hairline');
}
if (!doc.addEventListener) return;
window.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
}(window);
Loading…
Cancel
Save