PageSourceSearch

https://ayaneo.com/ayaneo/js/resize.js?ver=1.2025012411

js ayaneo.com collected 2026-10-02 05:08:33 UTC 1,361 bytes, 47 lines download raw bytes

1
2;(function(designWidth, maxWidth) {
3  const doc = document,
4        win = window,
5        docEl = doc.documentElement,
6        remStyle = document.createElement('style')
7  
8  // 设备类型检测(优化正则)
9  const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent)
10  
11  function refreshRem() {
12    let width = docEl.clientWidth
13    
14    // 非移动端宽度补偿(仅PC且非Retina屏)
15    if(!isMobile && window.devicePixelRatio === 1) {
16      width = Math.min(width + 17, maxWidth)
17    }
18    
19    // 响应式断点设置
20    if (width <= 750) {
21      designWidth = 375  // 移动端基准
22    } else if(width <= 1200) {
23      width = 1200       // 平板适配
24      designWidth = 1200
25    } else {
26      designWidth = maxWidth // PC端基准
27    }
28    
29    const rem = (width / designWidth) * 10
30    remStyle.textContent = `html{font-size:${rem}px !important}`
31  }
32
33  // 样式注入优化
34  doc.head.appendChild(remStyle)
35  
36  // 事件监听优化
37  const raf = win.requestAnimationFrame || 
38              (fn => setTimeout(fn, 16))
39  
40  win.addEventListener('resize', () => raf(refreshRem), false)
41  win.addEventListener('pageshow', (e) => {
42    e.persisted && refreshRem()
43  })
44
45  // 初始化执行
46  doc.addEventListener('DOMContentLoaded', refreshRem, false)
47})(1920, 1920)

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.