update
init
This commit is contained in:
Binary file not shown.
File diff suppressed because one or more lines are too long
Vendored
+10
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
@@ -0,0 +1,81 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
|
||||
<link rel="icon" href="<%= BASE_URL %>faviconnew.png" />
|
||||
<!-- <title><%= htmlWebpackPlugin.options.title %></title>-->
|
||||
<title>即时通信</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong
|
||||
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please
|
||||
enable it to continue.</strong
|
||||
>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
<script src="./TCaptcha.js"></script>
|
||||
<script src="./aegis.min.js"></script>
|
||||
<script>
|
||||
/**
|
||||
* 根据基础字体大小 和 效果图宽度设置 根节点字体大小
|
||||
* @param baseFontSize 浏览器默认字体大小 [注]浏览器最小字体为12像素,所以该值必需大于等于12
|
||||
* @param baseWidth 设计稿的尺寸
|
||||
*/
|
||||
function initFontSize() {
|
||||
// 获取当前屏幕宽度
|
||||
var clientWidth = document.documentElement.clientWidth || window.innerWidth;
|
||||
// 根据宽度计算根节点字体大小
|
||||
//初始化 字体16px , 设计稿宽1920px
|
||||
var size = Math.floor((clientWidth / 1920) * 16);
|
||||
|
||||
size = size > 12 ? size : 12;
|
||||
|
||||
document.querySelector('html').style.fontSize = size + 'px';
|
||||
}
|
||||
initFontSize();
|
||||
// 窗口大小改变时设置根节点字体大小,通过字体大小来控制页面元素尺寸的缩放
|
||||
window.addEventListener('resize', initFontSize);
|
||||
|
||||
// prevent page scaling
|
||||
window.onload = function () {
|
||||
var lastTouchEnd = 0;
|
||||
// prevent double-click on scaling
|
||||
document.addEventListener('touchstart', function (event) {
|
||||
if (event.touches.length > 1) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
document.addEventListener(
|
||||
'touchend',
|
||||
function (event) {
|
||||
var now = new Date().getTime();
|
||||
if (now - lastTouchEnd <= 300) {
|
||||
event.preventDefault();
|
||||
}
|
||||
lastTouchEnd = now;
|
||||
},
|
||||
false
|
||||
);
|
||||
// prevent double fingers on scaling
|
||||
document.addEventListener('gesturestart', function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
document.addEventListener('dblclick', function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
// 阻止android部分浏览器原生强制允许放大
|
||||
document.getElementById('app').addEventListener(
|
||||
'touchmove',
|
||||
function (e) {
|
||||
e.stopPropagation();
|
||||
},
|
||||
false
|
||||
);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user