MCPcopy Create free account
hub / github.com/Xu22Web/tech-study-js / initFontSize

Function initFontSize

tech-study.js:191–204  ·  view source on GitHub ↗

* @description 初始化配置

()

Source from the content-addressed store, hash-verified

189 * @description 初始化配置
190 */
191function initFontSize() {
192 // 移动端
193 const moblie = hasMobile();
194 if (moblie) {
195 // 清除缩放
196 const meta = $$('meta[name=viewport]')[0];
197 if (meta) {
198 meta.content = 'initial-scale=0, user-scalable=yes';
199 }
200 // 缩放比例
201 const scale = ~~(window.innerWidth / window.outerWidth) || 1;
202 document.documentElement.style.setProperty('--scale', String(scale));
203 }
204}
205/**
206 * @description 初始化最大阅读时长
207 */

Callers 1

tech-study.jsFile · 0.70

Calls 2

hasMobileFunction · 0.70
$$Function · 0.70

Tested by

no test coverage detected