iopProject

This commit is contained in:
zhuzhuxia233
2023-04-12 14:40:19 +08:00
commit 54bc2204dc
133 changed files with 35706 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
// 基准大小
const baseSize = 16;
// 设置 rem 函数
function setRem() {
// 当前页面宽度相对于 375 宽的缩放比例,可根据自己需要修改。
const scale = document.documentElement.clientWidth / 375;
// 设置页面根节点字体大小,Math.min(scal,2)表示最大缩放比例为2
document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + "px";
}
// 初始化
setRem();
// 改变窗口大小时重新设置 rem
window.onresize = function () {
setRem();
};