MCPcopy Create free account
hub / github.com/NCUSCC/cs4ncu / init

Function init

docs/javascripts/readingProgress.js:138–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136
137 // 初始化
138 function init() {
139 createProgressRing();
140 const throttledUpdate = throttle(updateProgress, 100);
141 const throttledResize = throttle(() => {
142 updateCircleSize();
143 updateProgress();
144 }, 200);
145
146 window.addEventListener('scroll', throttledUpdate, { passive: true });
147 window.addEventListener('resize', throttledResize, { passive: true });
148 updateProgress();
149 }
150
151 if (document.readyState === 'loading') {
152 document.addEventListener('DOMContentLoaded', init);

Callers 1

readingProgress.jsFile · 0.85

Calls 4

createProgressRingFunction · 0.85
throttleFunction · 0.85
updateCircleSizeFunction · 0.85
updateProgressFunction · 0.85

Tested by

no test coverage detected