PageSourceSearch

https://cognitum.one/assets/HeroAnimation-DmpBEQPo.js

js cognitum.one collected 2026-09-25 14:22:50 UTC 5,127 bytes, 1 lines download raw bytes

1import{r as u,j as t}from"./vendor-CR4GEDXU.js";import{C as A,u as g,P as y,a as v}from"./Points-CeyA0uK4.js";import{g as I}from"./WebGlCanvasGate-uJwTB3pe.js";import{A as M,V as k}from"./three-CZy7VViJ.js";const z=u.createContext(!0),j=()=>u.useContext(z);function C(e,a){const o=Math.sqrt(e*e+a*a);return o>=1?[e/o*.99,a/o*.99]:[e,a]}function R(e){const a=new Float32Array(e*3);for(let o=0;o<e;o++){const n=Math.random()*Math.PI*2,s=Math.sqrt(Math.random())*.95,[r,i]=C(s*Math.cos(n),s*Math.sin(n));a[o*3]=r*3,a[o*3+1]=i*3,a[o*3+2]=(Math.random()-.5)*.5}return a}function x({radius:e,speed:a,color:o,size:n}){const s=u.useRef(null),r=j(),i=80,d=u.useMemo(()=>{const c=new Float32Array(i*3);for(let l=0;l<i;l++){const f=l/i*Math.PI*2,p=e+Math.sin(f*8)*.1;c[l*3]=Math.cos(f)*p,c[l*3+1]=Math.sin(f)*p,c[l*3+2]=0}return c},[e]);return g(c=>{if(!r||!s.current)return;s.current.rotation.z=c.clock.elapsedTime*a;const l=1+Math.sin(c.clock.elapsedTime*2)*.05;s.current.scale.setScalar(l)}),t.jsx(y,{ref:s,positions:d,stride:3,children:t.jsx(v,{transparent:!0,color:o,size:n,sizeAttenuation:!0,depthWrite:!1,blending:M})})}function V(){const e=u.useRef(null),a=j(),o=800,n=u.useMemo(()=>R(o),[]);return g(s=>{!a||!e.current||(e.current.rotation.z=s.clock.elapsedTime*.05,e.current.rotation.x=Math.sin(s.clock.elapsedTime*.3)*.1)}),t.jsx(y,{ref:e,positions:n,stride:3,children:t.jsx(v,{transparent:!0,color:"#8b5cf6",size:.02,sizeAttenuation:!0,depthWrite:!1,blending:M,opacity:.6})})}function N(){const e=u.useRef(null),a=j(),o=u.useMemo(()=>{const n=[];for(let r=0;r<6;r++){const i=[],d=r/6*Math.PI*2,c=d+Math.PI;for(let l=0;l<=30;l++){const f=l/30,p=d+f*(c-d),m=.5+Math.sin(f*Math.PI)*1.5,h=Math.cos(p)*m,b=Math.sin(p)*m;i.push(new k(h,b,0))}n.push(i)}return n},[]);return g(n=>{!a||!e.current||(e.current.rotation.z=n.clock.elapsedTime*.1)}),t.jsx("group",{ref:e,children:o.map((n,s)=>t.jsxs("line",{children:[t.jsx("bufferGeometry",{children:t.jsx("bufferAttribute",{attach:"attributes-position",count:n.length,array:new Float32Array(n.flatMap(r=>[r.x,r.y,r.z])),itemSize:3})}),t.jsx("lineBasicMaterial",{color:"#22d3ee",transparent:!0,opacity:.2,blending:M})]},s))})}function F(){const e=u.useRef(null),a=j(),o=150,n=u.useMemo(()=>{const s=new Float32Array(o*3);for(let r=0;r<o;r++){const i=Math.random()*Math.PI*2,d=1.5+Math.random()*1.5;s[r*3]=Math.cos(i)*d,s[r*3+1]=Math.sin(i)*d,s[r*3+2]=(Math.random()-.5)*.3}return s},[]);return g((s,r)=>{if(!a||!e.current)return;const i=e.current.geometry.attributes.position.array;for(let d=0;d<o;d++){const c=d*3,l=i[c],f=i[c+1],p=Math.sqrt(l*l+f*f),m=.01/(p*p+.1),h=.3/p;i[c]+=(-f/p*h-l*m)*r,i[c+1]+=(l/p*h-f*m)*r;const b=Math.sqrt(i[c]**2+i[c+1]**2);if(b>3||b<.5){const w=Math.random()*Math.PI*2,P=1.5+Math.random()*1;i[c]=Math.cos(w)*P,i[c+1]=Math.sin(w)*P}}e.current.geometry.attributes.position.needsUpdate=!0}),t.jsx(y,{ref:e,positions:n,stride:3,children:t.jsx(v,{transparent:!0,color:"#f472b6",size:.03,sizeAttenuation:!0,depthWrite:!1,blending:M,opacity:.8})})}function T(){return t.jsxs(t.Fragment,{children:[t.jsx("ambientLight",{intensity:.5}),t.jsx(V,{}),t.jsx(N,{}),t.jsx(F,{}),t.jsx(x,{radius:1,speed:.3,color:"#8b5cf6",size:.015}),t.jsx(x,{radius:1.5,speed:-.2,color:"#22d3ee",size:.012}),t.jsx(x,{radius:2,speed:.15,color:"#f472b6",size:.01}),t.jsx(x,{radius:2.5,speed:-.1,color:"#8b5cf6",size:.008})]})}function L(){const e=u.useRef(null),[a,o]=u.useState(!0);return u.useEffect(()=>{const n=e.current;if(!n)return;const s=new IntersectionObserver(([r])=>{o(r.isIntersecting)},{threshold:.1});return s.observe(n),()=>s.disconnect()},[]),t.jsxs("div",{ref:e,className:"absolute inset-0 bg-gradient-to-br from-background via-background to-primary/5 overflow-hidden",children:[t.jsx("div",{className:"absolute top-1/4 right-1/4 w-[300px] h-[300px] bg-primary/20 rounded-full blur-[100px] animate-pulse-slow"}),t.jsx("div",{className:"absolute bottom-1/3 left-1/3 w-[200px] h-[200px] bg-accent/15 rounded-full blur-[80px] animate-pulse-slow"}),t.jsx(A,{camera:{position:[0,0,5],fov:60},dpr:[1,1.5],gl:{antialias:!1,alpha:!0,powerPreference:"low-power",failIfMajorPerformanceCaveat:!1},style:{background:"transparent"},frameloop:a?"always":"demand",onCreated:({gl:n})=>{I(n.domElement),n.setClearColor(0,0)},children:t.jsx(z.Provider,{value:a,children:t.jsx(T,{})})}),t.jsx("div",{className:"absolute inset-0 pointer-events-none bg-gradient-to-l from-transparent via-trans
1parent to-background/80"}),t.jsx("div",{className:"absolute inset-0 pointer-events-none bg-gradient-to-t from-background/50 via-transparent to-background/50"}),t.jsx("div",{className:"absolute top-20 right-20 w-1 h-1 rounded-full bg-primary/60 animate-float"}),t.jsx("div",{className:"absolute top-40 right-32 w-1.5 h-1.5 rounded-full bg-accent/50 animate-float",style:{animationDelay:"1s"}}),t.jsx("div",{className:"absolute bottom-32 right-24 w-1 h-1 rounded-full bg-primary/40 animate-float",style:{animationDelay:"2s"}}),t.jsx("div",{className:"absolute bottom-48 left-20 w-1 h-1 rounded-full bg-accent/60 animate-float",style:{animationDelay:"0.5s"}})]})}export{L as HeroAnimation,L 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.