1import{l as s,r as e}from"./app.js";import{s as t}from"./scroll-control-nF8xo79a.js";class r{constructor(e){return this.log=s("ScrollProgress"),e?(this.log("Init scroll progress: ",e),this.elem=elem,this.screeHeight=null,this.getScreenHeight(),this.progress=this.calcProgress(),this.drawProgress(),this.addEvents(),this):(this.log("Node element not found"),!1)}addEvents(){return this.log("Add events"),e.subscribe(this.getScreenHeight.bind(this)),document.addEventListener("scroll",(()=>{requestAnimationFrame((()=>this.onScroll()))})),this}onScroll(){this.calcProgress(),this.drawProgress()}calcProgress(){const s=t.getScrollPos(),e=document.body.scrollHeight;this.progress=(s+this.screeHeight)/e}drawProgress(){this.elem.style.transform=`scaleX(${this.progress}) translateZ(0)`}getScreenHeight(){this.screeHeight=document.documentElement.clientHeight}}export{r as ScrollProgress,r as default};
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.