PageSourceSearch

https://swooni.io/assets/blur-fade-B1Dwn3g_.js

js swooni.io collected 2026-10-08 11:21:50 UTC 2,336 bytes, 1 lines download raw bytes

1import{u as d,j as V}from"./index-BBYgzlXC.js";const P=()=>typeof window>"u"?"desktop":window.matchMedia("(max-width: 767px)").matches?"mobile":window.matchMedia("(max-width: 1023px)").matches?"tablet":"desktop",Q=(e,t)=>t!=="desktop"&&(e==="left"||e==="right")?"up":e,z=(e,t)=>t==="mobile"?Math.min(Math.round(e*.45),6):t==="tablet"?Math.min(Math.round(e*.65),8):e,H=(e,t)=>t==="mobile"?Math.max(e,.42):t==="tablet"?Math.max(e,.38):e,N=(e,t)=>t==="mobile"?Math.min(e*.65,.26):t==="tablet"?Math.min(e*.82,.34):e;function q({children:e,className:t,duration:b=.32,delay:M=0,offset:x=8,direction:g="up",inView:c=!1,inViewMargin:p="0px 0px -12% 0px",blur:h="0px",responsiveScrollMotion:E=!1,...R}){const v=d.useRef(null),[u,l]=d.useState(!c),[f,y]=d.useState(!1),[o,L]=d.useState("desktop");d.useEffect(()=>{if(typeof window>"u")return;const i=window.matchMedia("(prefers-reduced-motion: reduce)"),a=window.matchMedia("(max-width: 767px)"),s=window.matchMedia("(max-width: 1023px)"),r=()=>{y(i.matches)},n=()=>{L(P())};return r(),n(),i.addEventListener("change",r),a.addEventListener("change",n),s.addEventListener("change",n),()=>{i.removeEventListener("change",r),a.removeEventListener("change",n),s.removeEventListener("change",n)}},[]),d.useEffect(()=>{const i=o!=="desktop";if(!c||u||f||i){(f||i)&&!u&&l(!0);return}const a=v.current;if(!a||typeof IntersectionObserver>"u"){l(!0);return}const s=()=>{const n=a.getBoundingClientRect(),O=window.innerHeight*.88;return n.top<O&&n.bottom>0?(l(!0),!0):!1};if(s())return;const r=new IntersectionObserver(([n])=>{n?.isIntersecting&&(l(!0),r.disconnect())},{rootMargin:p,threshold:.12});return r.observe(a),window.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",s),()=>{r.disconnect(),window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}},[u,c,p,o,f,E]);const k=Q(g,o),B=z(x,o),w=H(b,o),m=N(M,o),D=h!=="0"&&h!=="0px",S=u||f||o!=="desktop",j=w>=.7?"slow":w>=.38?"medium":"fast",I=m>=.4?"long":m>=.2?"medium":m>0?"short":"none";return V.jsx("div",{ref:v,className:["swooni-blur-fade",c?"swooni-responsive-no-scroll-reveal":null,t].filter(Boolean).join(" "),"data-visible":S?"true":"false","data-direction":k,"data-offset":B<=6?"compact":"default","data-duration":j,"data-delay":I,"data-blur":D?"true":"false",...R,children:e})}export{q as B};

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.