PageSourceSearch

https://professorclock.tv/assets/useScrollVideo-BcBkmNuC.js

js professorclock.tv collected 2026-10-10 02:24:00 UTC 903 bytes, 1 lines download raw bytes

1import{r as n}from"./lucide-Lukeen-8.js";function g(t,M){const a=n.useRef(null),u=n.useRef(null),o=n.useRef(0),[l,d]=n.useState(!1),m=t!==void 0&&t.current instanceof HTMLVideoElement,f=t!==void 0&&t.current instanceof HTMLElement&&!(t.current instanceof HTMLVideoElement),r=m?t:a,c=f?t:u,s=n.useCallback(()=>{const e=r.current,i=c.current??(e==null?void 0:e.parentElement)??null;!e||!i||!e.duration||Number.isNaN(e.duration)||(cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{const v=i.getBoundingClientRect(),E=i.offsetHeight,p=window.innerHeight,w=-v.top,H=E-p,h=Math.max(0,Math.min(1,w/Math.max(1,H)));try{e.currentTime=h*e.duration}catch{}}))},[r,c]);return n.useEffect(()=>(window.addEventListener("scroll",s,{passive:!0}),()=>{window.removeEventListener("scroll",s),cancelAnimationFrame(o.current)}),[s]),{videoRef:r,sectionRef:c,videoReady:l,setVideoReady:d}}export{g as u};

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.