1import{V as ee,M as nt,I as pa,J as Lt,v as Xt,K as mt,N as Gt,x as ge,O as vt,P as ft,w as ma,_ as fa,p as ga,r as pe,Q as va,o as wa,n as ba,h as xa,i as Sa,b as ya,c as Ca,e as Ce,f as kt,U as Ot,g as Ba,X as It,Y as Ea,t as Ma,T as Wa,S as Aa,m as Ta,q as Ra,Z as Fa,W as Pa,A as Da,$ as Ht,a0 as La,a1 as Ga,a2 as ka,C as Oa,R as Ia,z as Ha,j as je,E as Ua,D as za,F as _a,H as Na}from"./index-DObtZvbc.js";import{B as Va,k as Xa,l as Ka,m as ja,N as Ya,j as et,E as $a,R as Ja,a as tt,b as Ut,e as Qa,f as Za,G as qa,O as en,d as tn,s as L,n as an,F as nn}from"./Footer-CidQ4yws.js";import{w as on,B as zt,e as rn,f as ln,g as sn}from"./sliderFx-BC-B0dLC.js";const g={effect:"Bridge + Bulge",forward:{direction:1,origin:"Outer"},backward:{direction:-1,origin:"Inner"},curve:2,onlyWhileScrolling:!0,strength:40,maxDepth:100,focal:1e3,attack:8,release:4,bridgePinch:.175,shading:.5,relief:.5,sheen:.5},Ie={uWheelBendF:{value:0},uWheelBendB:{value:0},uWheelOriginF:{value:1},uWheelOriginB:{value:0},uWheelCenter:{value:new ee(0,0)},uWheelRadius:{value:300},uCardHeight:{value:100},uWheelCurve:{value:2},uWheelShade:{value:1},uWheelRelief:{value:1},uWheelSheen:{value:.7},uWheelFocal:{value:1e3}},Kt=` 2 uniform float uWheelBendF; 3 uniform float uWheelBendB; 4 uniform float uWheelOriginF; 5 uniform float uWheelOriginB; 6 uniform vec2 uWheelCenter; 7 uniform float uWheelRadius; 8 uniform float uCardHeight; 9 uniform float uWheelCurve; 10 uniform float uWheelFocal; 11 uniform float uWheelShade; 12 uniform float uWheelRelief; 13 uniform float uWheelSheen; 14 varying float vWheelLight; // how lit the bent surface is here (1 = as flat) 15 varying float vWheelSheen; // glossy highlight added on top 16 17 // One bend: depth at 'across' (0 inner edge .. 1 outer) and its slope along the radius 18 // (+ = deeper further out). The fixed edge gets no depth and leaves flat; the depth 19 // grows along pow(t, curve) to its full amount at the moving edge. 20 vec2 wheelBend(float across, float bend, float origin) { 21 float t = mix(1.0 - across, across, origin); // 0 at the fixed edge, 1 at the moving one 22 float lift = pow(t, uWheelCurve); 23 float dLift = uWheelCurve * pow(max(t, 1e-4), uWheelCurve - 1.0) * (origin > 0.5 ? 1.0 : -1.0); 24 return vec2(bend * lift, bend * dLift / uCardHeight); 25 } 26`,jt=` 27 varying float vWheelLight; 28 varying float vWheelSheen; 29`,Yt=` 30 vec4 mvPosition = modelViewMatrix * vec4(transformed, 1.0); 31 vec2 fromCenter = mvPosition.xy - uWheelCenter; 32 float across = clamp((length(fromCenter) - uWheelRadius) / uCardHeight + 0.5, 0.0, 1.0); 33 vec2 bend = wheelBend(across, uWheelBendF, uWheelOriginF) + wheelBend(across, uWheelBendB, uWheelOriginB); 34 float depth = max(bend.x, -0.9 * uWheelFocal); // can't come past the camera 35 36 // Light the bent surface like paper: its slope along the radius tilts the normal; 37 // parts turning away from the light (upper left, in front) darken, parts turning 38 // toward it catch a sheen, and deeper parts sit a little darker 39 float slope = bend.y * uWheelRelief; 40 vec2 radial = length(fromCenter) > 1e-3 ? normalize(fromCenter) : vec2(0.0, 1.0); 41 vec3 bendNormal = normalize(vec3(radial * slope, 1.0)); 42 vec3 lightDir = normalize(vec3(-0.45, 0.55, 1.0)); 43 float diffuse = clamp(dot(bendNormal, lightDir) / lightDir.z, 0.0, 1.2); 44 float depthShade = clamp(1.0 - depth / uWheelFocal * 0.9, 0.55, 1.15); 45 vWheelLight = mix(1.0, diffuse * depthShade, uWheelShade); 46 float glint = max(reflect(-lightDir, bendNormal).z, 0.0); 47 vWheelSheen = max(pow(glint, 24.0) - pow(lightDir.z, 24.0), 0.0) * uWheelSheen * uWheelShade; 48 49 mvPosition.xy = uWheelCenter + fromCenter * (uWheelFocal / (uWheelFocal + depth)); 50 gl_Position = projectionMatrix * mvPosition; 51`,un=u=>{Object.assign(u.uniforms,Ie),u.vertexShader=u.vertexShader.replace("#include <common>",`#include <common> 52${Kt}`).replace("#include <project_vertex>",Yt),u.fragmentShader=u.fragmentShader.replace("#include <common>",`#include <common> 53${jt}`).replace("#include <map_fragment>",`#include <map_fragment> 54 diffuseColor.rgb = diffuseColor.rgb * vWheelLight + vWheelSheen;`)},Y={forward:0,backward:0,lastDir:1};function dn(){Y.forward=Y.backward=0,Y.lastDir=1,Ie.uWheelBendF.value=0,Ie.uWheelBendB.value=0}const _t=(u,v,y,h)=>v*Math.pow(y>.5?u:1-u,h);function cn(u,v,y){const h=Ie,x=h.uWheelBendF.value,B=h.uWheelBendB.value,d=h.uWheelCenter.value.x,b=h.uWheelCenter.value.y,E=v-d,X=y-b,O=Math.hypot(E,X);if(!x&&!B||O<.001)return u.set(v,y);const n=h.uWheelRadius.value,r=h.uCardHeight.value,A=h.uWheelFocal.value,$=h.uWheelCurve.value;let H=O;for(let K=0;K<8;K++){const me=ge.clamp((H-n)/r+.5,0,1),ve=Math.max(_t(me,x,h.uWheelOriginF.value,$)+_t(me,B,h.uWheelOriginB.value,$),-.9*A);H=O*(A+ve)/A}return u.set(d+E/O*H,b+X/O*H)}const Nt=(u,v,y)=>{const h=Math.abs(v)>
54Math.abs(u)?g.attack:g.release,x=u+(v-u)*(1-Math.exp(-h*y));return Math.abs(v-x)<.01?v:x};function hn(u,v,{wheelAmount:y,radius:h,cardHeight:x}){const B=Math.abs(u);B>1&&(Y.lastDir=u<0?1:-1);let d=0;g.effect==="Bridge + Bulge"&&(d=(g.onlyWhileScrolling?Math.min(B*g.strength/1e3,g.maxDepth):g.maxDepth)*y);const b=g.forward,E=g.backward,X=Y.lastDir>0?d*Math.sign(b.direction||1):0,O=Y.lastDir<0?d*Math.sign(E.direction||1):0;Y.forward=Nt(Y.forward,X,v),Y.backward=Nt(Y.backward,O,v);const n=Ie;n.uWheelBendF.value=Y.forward,n.uWheelBendB.value=Y.backward,n.uWheelOriginF.value=b.origin==="Outer"?1:0,n.uWheelOriginB.value=E.origin==="Outer"?1:0,n.uWheelRadius.value=h,n.uCardHeight.value=x,n.uWheelCurve.value=Math.max(g.curve,1),n.uWheelShade.value=g.shading,n.uWheelRelief.value=g.relief,n.uWheelSheen.value=g.sheen,n.uWheelFocal.value=g.focal}const Ee=16,Me=8,pn=()=>{const u=new pa,v=Me+1,y=new Float32Array((Ee+1)*v*3),h=new Float32Array((Ee+1)*v*2),x=[];for(let B=0;B<=Ee;B++)for(let d=0;d<=Me;d++)if(h.set([B/Ee,d/Me],(B*v+d)*2),B<Ee&&d<Me){const b=B*v+d,E=b+v;x.push(b,E,b+1,b+1,E,E+1)}return u.setAttribute("position",new Lt(y,3)),u.setAttribute("uv",new Lt(h,2)),u.setIndex(x),u},mn=()=>new Xt({uniforms:{...Ie,uTexA:{value:null},uTexB:{value:null},uCropA:{value:new Gt(1,1,0,0)},uCropB:{value:new Gt(1,1,0,0)},uEdgeA:{value:1},uEdgeB:{value:0},uFlipA:{value:0},uFlipB:{value:0},uHeight:{value:1},uPinch:{value:.35},uPresence:{value:1},uPinchPos:{value:.5},uTaper:{value:1.7},uBlend:{value:.5},uSmear:{value:0}},vertexShader:` 55 varying vec2 vUv; 56 ${Kt} 57 void main() { 58 vUv = uv; 59 vec3 transformed = position; 60 ${Yt} 61 } 62 `,fragmentShader:` 63 uniform sampler2D uTexA; 64 uniform sampler2D uTexB; 65 uniform vec4 uCropA; 66 uniform vec4 uCropB; 67 uniform float uEdgeA; 68 uniform float uEdgeB; 69 uniform float uFlipA; 70 uniform float uFlipB; 71 uniform float uHeight; 72 uniform float uPinch; 73 uniform float uPresence; 74 uniform float uPinchPos; 75 uniform float uTaper; 76 uniform float uBlend; 77 uniform float uSmear; 78 79 varying vec2 vUv; 80 ${jt} 81 82 // A point on a thumbnail's edge column: u at the edge (pulled inward by the 83 // smear), v along it, through the thumbnail's crop 84 vec4 edgeColor(sampler2D tex, vec4 crop, float edge, float flip, float v, float smear) { 85 v = clamp(mix(v, 1.0 - v, flip), 0.002, 0.998); 86 float u = mix(clamp(0.002 + smear, 0.002, 0.998), clamp(0.998 - smear, 0.002, 0.998), edge); 87 return texture2D(tex, vec2(u, v) * crop.xy + crop.zw); 88 } 89 90 void main() { 91 float s = vUv.x; // 0 where it leaves thumbnail A, 1 at thumbnail B 92 93 // Bell peaking at the pinch: 0 at both ends, 1 at the pinch 94 float pp = clamp(uPinchPos, 0.05, 0.95); 95 float h = s < pp ? 0.5 * s / pp : 0.5 + 0.5 * (s - pp) / (1.0 - pp); 96 float bell = sin(3.14159265 * h); 97 float taper = pow(1.0 - bell, uTaper); // 1 at the ends, 0 at the pinch 98 99 // Full height at each end, necking in to the pinch; the whole strand thins 100 // down with its presence, so it melts away instead of popping off 101 float halfH = mix(uHeight * 0.5 * uPinch, uHeight * 0.5, taper) * uPresence; 102 103 float y = (vUv.y - 0.5) * uHeight; 104 float d = abs(y) - halfH; 105 float aa = clamp(fwidth(d), 0.5, 2.0); 106 float alpha = (1.0 - smoothstep(-aa, aa, d)) * smoothstep(0.0, 0.35, uPresence); 107 if (alpha <= 0.001) discard; 108 109 // The ribbon spans the attachment height: its v is the edge's v 110 vec4 colA = edgeColor(uTexA, uCropA, uEdgeA, uFlipA, vUv.y, uSmear * s); 111 vec4 colB = edgeColor(uTexB, uCropB, uEdgeB, uFlipB, vUv.y, uSmear * (1.0 - s)); 112 113 // Even mix at the pinch, each image taking over toward its own thumbnail 114 float halfBlend = max(uBlend, 0.01) * 0.5; 115 vec4 col = mix(colA, colB, smoothstep(pp - halfBlend, pp + halfBlend, s)); 116 117 // Lit by the bend like the thumbnails it joins 118 gl_FragColor = vec4(col.rgb * vWheelLight + vWheelSheen, alpha * col.a); 119 } 120 `,transparent:!0,depthTest:!1,depthWrite:!1,side:mt});function fn(u,v){const y=[];for(let h=0;h<v;h++){const x=new nt(pn(),mn());x.position.z=-.5,x.frustumCulled=!1,x.visible=!1,u.add(x),y.push(x)}return y}const Be=new ee,Le=new ee,Ge=new ee,ke=new ee,Oe=new ee;function gn(u,v,{thumbW:y,thumbH:h,presence:x,lag:B,skipIndex:d,maxGap:b},E){const X=E.honeyEnabled&&x>.001,O=h*.5,n=O/2;for(let r=0;r<u.length;r++){const A=u[r],$=(r+1)%v.length,H=v[r],K=v[$];Be.set(K.position.x-H.position.x,K.position.y-H.position.y);const me=Be.length(),ve=me-y;if(A.visible=X&&r!==d&&$!==d&&ve>0&&ve<=b,!A.visible)continue;Be.divideScalar(me);const te=Math.cos(H.rotation.z),He=Math.sin(H.rotation.z),se=Math.cos(K.rotation.z),$e=Math.sin(K.rotation.z),We=Be.x*te+Be.y*He>=0,Ae=Be.x*se+Be.y*$e<0;Le.set(te,He).multiplyScalar(We?1:-1),Ge.set(se,$e).multiplyScalar(Ae?1:-1),ke.set(H.position.x,H.position.y).addScaledVector(Le,y/2-1),Oe.set(K.position.x,K.position.y).addScaledVector(Ge,y/2-1);const J=ke.distanceTo(Oe),ae=A.geometry.attributes.position;for(let Te=0;Te<=Ee;Te++){const ne=Te/Ee,Z=ne*ne,we=Z*ne,Ue=2*we-3*Z+1,ze=we-2*Z+ne,_e=-2*we+3*Z,Re=we-Z,be=6*Z-6*ne,V=3*Z-4*ne+1,U=-6*Z+6*ne,C=3*Z-2*ne,F=Ue*ke.x+ze*Le.x*J+_e*Oe.x-Re*Ge.x*J,xe
120=Ue*ke.y+ze*Le.y*J+_e*Oe.y-Re*Ge.y*J;let oe=be*ke.x+V*Le.x*J+U*Oe.x-C*Ge.x*J,I=be*ke.y+V*Le.y*J+U*Oe.y-C*Ge.y*J;const M=Math.hypot(oe,I)||1;oe/=M,I/=M;for(let k=0;k<=Me;k++){const re=(k/Me*2-1)*n;ae.setXYZ(Te*(Me+1)+k,F-I*re,xe+oe*re,0)}}ae.needsUpdate=!0;const R=A.material.uniforms,j=H.material.map,Q=K.material.map;R.uTexA.value=j,R.uTexB.value=Q,R.uCropA.value.set(j.repeat.x,j.repeat.y,j.offset.x,j.offset.y),R.uCropB.value.set(Q.repeat.x,Q.repeat.y,Q.offset.x,Q.offset.y),R.uEdgeA.value=We?1:0,R.uFlipA.value=We?0:1,R.uEdgeB.value=Ae?1:0,R.uFlipB.value=Ae?1:0,R.uHeight.value=O,R.uPinch.value=g.bridgePinch,R.uPresence.value=x,R.uPinchPos.value=.5+B,R.uTaper.value=E.honeyTaper,R.uBlend.value=E.honeyBlend,R.uSmear.value=E.honeySmear}}const gt=u=>Math.sqrt(Math.max(u,0)*4/Math.PI),vn={uniforms:{tDiffuse:{value:null},uResolution:{value:new ee(1,1)},uChromaStrength:{value:0},uChromaCurve:{value:1},uChromaRadial:{value:1},uChromaAxis:{value:new ee(1,0)},...ja(),uVignette:{value:1},uAmount:{value:1},uSize:{value:gt(.05)},uSoftness:{value:1.29-gt(.05)},uShape:{value:2},uRoundness:{value:0},uDesaturate:{value:.2},uTint:{value:new vt("#05060a")},uDither:{value:2},uTime:{value:0},uGrainAmount:{value:.025},uGrainSpeed:{value:5}},vertexShader:Ka,fragmentShader:` 121 uniform sampler2D tDiffuse; 122 uniform vec2 uResolution; 123 124 uniform float uChromaStrength; 125 uniform float uChromaCurve; 126 uniform float uChromaRadial; 127 uniform vec2 uChromaAxis; 128 129 uniform float uVignette; 130 uniform float uAmount; 131 uniform float uSize; 132 uniform float uSoftness; 133 uniform float uShape; 134 uniform float uRoundness; 135 uniform float uDesaturate; 136 uniform vec3 uTint; 137 uniform float uDither; 138 139 uniform float uTime; 140 uniform float uGrainAmount; 141 uniform float uGrainSpeed; 142 143 varying vec2 vUv; 144 145 ${Va} 146 147 float rand(vec2 n) { 148 return fract(sin(dot(n, vec2(12.9898, 78.233))) * 43758.5453); 149 } 150 151 // Same grain hash as the home page's fused-noise pass 152 float grainHash(vec2 p) { 153 return fract(1e4 * sin(17.0 * p.x + p.y * 0.1) * (0.1 + abs(sin(p.y * 13.0 + p.x)))); 154 } 155 156 vec2 mirrorUv(vec2 uv) { 157 return 1.0 - abs(1.0 - abs(uv)); 158 } 159 160 // 1. Red and blue split apart inside the edge bands (one read outside them) 161 vec4 edgeChroma() { 162 vec4 base = texture2D(tDiffuse, vUv); 163 float amount = uChromaStrength * pow(bandT(vUv), uChromaCurve) * uIntensity; 164 if (amount < 0.01) return base; 165 166 vec2 fromCenter = vUv - 0.5; 167 vec2 axial = uChromaAxis * (dot(fromCenter, uChromaAxis) >= 0.0 ? 1.0 : -1.0); 168 vec2 radial = normalize(fromCenter * uResolution + 1e-5); 169 vec2 shift = normalize(mix(axial, radial, uChromaRadial) + 1e-5) * amount / uResolution; 170 171 // Mirror shifted lookups back on screen instead of stretching the edge row 172 vec4 r = texture2D(tDiffuse, mirrorUv(vUv + shift)); 173 vec4 b = texture2D(tDiffuse, mirrorUv(vUv - shift)); 174 return vec4(r.r, base.g, b.b, max(base.a, max(r.a, b.a))); 175 } 176 177 // 2. Oval vignette: clear inside, darkening smoothly out to the edges 178 vec3 vignette(vec3 color) { 179 float aspect = uResolution.x / max(uResolution.y, 1.0); 180 vec2 p = (vUv - 0.5) * 2.0; // 1 at the middle of each screen edge 181 p.x *= mix(1.0, aspect, uRoundness); 182 183 // Superellipse distance: an oval at 2, a rounded rectangle as it grows 184 float n = max(uShape, 1.0); 185 float d = pow(pow(abs(p.x), n) + pow(abs(p.y), n), 1.0 / n); 186 float v = smoothstep(uSize, uSize + max(uSoftness, 0.001), d) * uVignette; 187 188 float luma = dot(color, vec3(0.2126, 0.7152, 0.0722)); 189 color = mix(color, vec3(luma), v * uDesaturate); 190 color = mix(color, uTint, v * uAmount); 191 // A hair of noise so the dark gradient doesn't band
192 return color + (rand(gl_FragCoord.xy) - 0.5) / 255.0 * uDither * uVignette; 193 } 194 195 void main() { 196 vec4 color = edgeChroma(); 197 color.rgb = vignette(color.rgb); 198 199 // 3. Film grain on top 200 float bw = step(0.5, grainHash(vUv + mod(uTime, 100.0) * uGrainSpeed)); 201 color.rgb = mix(color.rgb, vec3(bw), uGrainAmount); 202 203 gl_FragColor = color; 204 // 4. Tone mapping + sRGB (applied by three when this pass draws to the screen) 205 ${Xa} 206 } 207 `},G={enabled:!0,intensity:5,color:"#ffffff",gapForFull:140,core:1,edgeSoftness:.4,glow:70,glowAmount:.3,ditherIntensity:10,ditherGlowAmount:.5,preview:!1,previewGap:120},wn=u=>new Xt({uniforms:{...u,uIntensity:{value:0},uColor:{value:new vt(G.color)},uGap:{value:0},uCore:{value:G.core},uEdgeSoftness:{value:G.edgeSoftness},uGlow:{value:G.glow},uGlowAmount:{value:G.glowAmount},uWidth:{value:1}},vertexShader:on(` 208 varying vec2 vUv; 209 void main() { 210 vUv = uv; 211 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 212 } 213 `),fragmentShader:` 214 uniform float uIntensity; 215 uniform vec3 uColor; 216 uniform float uGap; 217 uniform float uCore; 218 uniform float uEdgeSoftness; 219 uniform float uGlow; 220 uniform float uGlowAmount; 221 uniform float uWidth; 222 223 varying vec2 vUv; 224 225 void main() { 226 float halfG = max(uGap * 0.5, 0.5); 227 float x = abs(vUv.x - 0.5) * uWidth; // px from the gap's center line 228 229 // The light seen straight through the gap
230 float soft = clamp(uEdgeSoftness, 0.0, 1.0); 231 float core = 1.0 - smoothstep(halfG * (1.0 - soft), halfG + 2.0, x); 232 233 // Its glow spilling over the slide edges 234 float glow = exp(-max(x - halfG, 0.0) / max(uGlow, 1.0)) * uGlowAmount; 235 236 float light = (core * uCore + glow) * uIntensity; 237 if (light <= 0.0005) discard; 238 gl_FragColor = vec4(uColor * light, 1.0); 239 } 240 `,transparent:!0,depthTest:!1,depthWrite:!1,blending:ma});function bn(u,v,y){const h=new ft(1,1,4,32),x=wn(y),B=[];for(let d=0;d<v;d++){const b=new nt(h,x);b.position.z=-5,b.frustumCulled=!1,b.visible=!1,u.add(b),B.push(b)}return{meshes:B,geometry:h,material:x}}function xn(u,{gapCenters:v,gap:y,height:h,opacity:x,ditherMix:B=0}){const d=G,b=d.preview?Math.max(y,d.previewGap):y,E=d.enabled?ge.smoothstep(b,0,Math.max(d.gapForFull,1))*x:0,X=E>.001,O=b+d.glow*12+8,n=h*1.3;if(X){const r=u.material.uniforms,A=ge.lerp(d.intensity,d.ditherIntensity,B);r.uIntensity.value=A*E,r.uColor.value.set(d.color),r.uGap.value=b,r.uWidth.value=O,r.uCore.value=d.core,r.uEdgeSoftness.value=d.edgeSoftness,r.uGlow.value=d.glow,r.uGlowAmount.value=ge.lerp(d.glowAmount,d.ditherGlowAmount,B)}for(let r=0;r<u.meshes.length;r++){const A=u.meshes[r];A.visible=X&&r<v.length,A.visible&&(A.position.set(v[r],0,-5),A.scale.set(O,n,1))}}const Sn={class:"title-container"},Ye=15,Vt=.8,yn=512,at=3,Cn=2e3,Bn={__name:"index",setup(u){ga();const v=Ha(),{playDrag:y,play:h}=Ua(),{loadAllAssets:x}=Ta(),B=pe(null),d=pe(null),b=pe(null),E=pe(!1),X=pe(!0);let O=!1;const n={current:0,target:0,speed:0,lspeed:0,isDragging:!1,dragStartX:0,dragStartTarget:0,lastKeyTime:0,keyBoostUntil:0,introActive:!1},r={lerpFactor:.04,lerpFactorMobile:.12,keyLerpFactor:.08,snapFactor:.1,scrollSpeed:.001,mouseMultiplier:.5,firefoxMultiplier:30,dragSensitivity:.005,keyScrollCooldown:200,speedDecay:.95,speedSpread:1,introSlides:20,introLerpFactor:.04,introLerpFactorMobile:.12,introSpeedKick:5},A=window.matchMedia?.("(pointer: coarse)").matches??!1,$=(t,e)=>1-Math.pow(1-t,e*60),H=(t,e)=>(t%e+e)%e,K=t=>{const e=n;e.speed=ge.clamp(e.speed*Math.pow(r.speedDecay,2*t*60),-1,1),Math.abs(e.speed)<.001&&(e.speed=0),e.lspeed=A?0:e.lspeed+(Math.abs(e.speed)-e.lspeed)*$(.1,t);const o=Math.round(e.target);e.target+=(o-e.target)*$(r.snapFactor,t);const s=e.introActive?A?r.introLerpFactorMobile:r.introLerpFactor:Date.now()<e.keyBoostUntil?r.keyLerpFactor:A?r.lerpFactorMobile:r.lerpFactor;e.current+=(e.target-e.current)*$(s,t),!e.isDragging&&Math.abs(e.target-o)<1e-4&&Math.abs(e.current-o)<1e-4&&(e.target=e.current=o,e.introActive=!1)},me=()=>window.innerWidth*(et()?.8:.45),ve=()=>{const t=et();return{radius:t?150:300,thumbW:t?30:70,thumbH:t?45:100,thumbSpacing:t?80:160}};let te=ve();const He=()=>{const t=Math.round(r.introSlides);t<=0||(n.target=Math.round(n.target),n.current=n.target+t,n.introActive=!0,A||(n.speed=n.lspeed=r.introSpeedKick),le())},se={progress:0,target:0},$e=()=>{E.value=!E.value,se.target=E.value?1:0,le(),h()},We=["/playground/1.webp","/playground/2.webp","/playground/3.webp","/playground/4.webp","/playground/5.webp","/playground/6.webp"],Ae=["/playground/1.webp","/playground/2.webp","/playground/3.webp","/playground/4.webp","/playground/5.webp","/playground/6.webp"],J=["PIXEL DREAMS","VAULT RUNNER","GRID FUSION","NOISE FIELD","CHROMA LOOP","ARCHIVE BLAST","NEON WHEEL","GLITCH GALLERY","SPECTRA SLIDE","META FRAME","LUMEN SHIFT","VORTEX VIEW","ECHO LENS","REVEAL NODE","SHOCKWAVE"],ae=Array.from({length:Ye},(t,e)=>({id:e,title:J[e%J.length],sliderUrl:We[e%We.length],wheelUrl:Ae[e%Ae.length]})),R=pe(ae[0].title),j=new Map,Q=new Map,Te=new va,ne=()=>{const t=new ka(new Uint8Array([16,16,16,255]),1,1);return t.needsUpdate=!0,t},Z=()=>Math.ceil(Math.max(window.screen?.height||0,window.innerHeight)*Math.min(window.devicePixelRatio||1,1.25)/Vt),we=(t,e=Z())=>Te.loadAsync(t).then(o=>{const s=o.image;if(s&&s.height>e){const p=e/s.height,a=document.createElement("canvas");a.width=Math.round(s.width*p),a.height=e;const m=a.getContext("2d");m.imageSmoothingQuality="high",m.drawImage(s,0,0,a.width,a.height),o.dispose(),o=new Wa(a),o.needsUpdate=!0}
240return o.colorSpace=Aa,o}).catch(()=>ne()),Ue=()=>{j.forEach(t=>t.dispose()),Q.forEach(t=>t.dispose()),j.clear(),Q.clear()},ze=(t,e,o=1)=>{const s=t.image;if(!s||!s.width||!s.height)return;const p=s.width/s.height;let a=1,m=1;e>p?m=p/e:a=e/p,t.repeat.set(a*o,m*o),t.offset.set((1-t.repeat.x)/2,(1-t.repeat.y)/2)},_e=()=>{const t=me()/window.innerHeight;j.forEach(e=>ze(e,t,Vt)),Q.forEach(e=>ze(e,te.thumbW/te.thumbH))},Re=pe(null);let be=null,V,U,C,F,xe,oe,I,M,k,re,ue=null,Ne=null;const Ve=pe(!1),z={intensity:1,gridSize:2,pixelSizeRatio:A?2.8:2,grayscale:!1,invert:!1,fadeSeconds:.8,glitchMs:600};let wt=!0,de=null,Fe=null;const ot=[];let fe=[],ce=[];const Pe=[],bt=new Ia,xt=new ee,rt=new ee,it=sn(),$t=rn(it);let St=0,Xe=[];const yt={edgeFx:0,edgeTier:0};let lt=0;const Se={thumbW:0,thumbH:0,presence:0,lag:0,skipIndex:-1,maxGap:0},_={bandLeft:.3,bandRight:.3,minBlurPx:.15,maxBlurPx:64,chromaPx:18,chromaRadial:!0};let ie=0;const De={openArea:.05,reach:1.29},st=()=>{if(!I)return;const t=gt(De.openArea);I.uniforms.uSize.value=t,I.uniforms.uSoftness.value=Math.max(De.reach-t,.02)},ut=pe(!1);let Ct=performance.now(),ye=1;const le=()=>{Ct=performance.now()};let q=!1,Je=-1;const Qe=[],he={x:0,y:0,rotation:0,scale:1};let Ze=null,Ke=null;const Jt=()=>{V=new Ra,V.background=new vt(0);const t=window.innerWidth,e=window.innerHeight;U=new Fa(t/-2,t/2,e/2,e/-2,-1e3,1e3),U.position.z=100,C=new Pa({canvas:Re.value,alpha:!1,antialias:!1}),C.setSize(t,e),C.setPixelRatio(Math.min(window.devicePixelRatio,et()?1:1.25)),C.toneMapping=Da,C.toneMappingExposure=1;const o=new ft(1,1,4,24);Pe.push(o);const s=new Map;ae.forEach((l,c)=>{let f=s.get(l.wheelUrl);f||(f=new Ht({map:Q.get(l.wheelUrl),transparent:!0,side:mt}),f.onBeforeCompile=un,s.set(l.wheelUrl,f));const i=new nt(o,f);i.userData={index:c,type:"thumb"},V.add(i),ce.push(i)}),Xe=fn(V,ce.length),dn();const p=new ft(1,1,zt,zt);Pe.push(p);for(let l=-at;l<=at;l++){const c=new Ht({map:j.get(ae[0].sliderUrl),transparent:!0,side:mt});c.onBeforeCompile=$t;const f=new nt(p,c);f.position.z=-10,V.add(f),fe.push(f)}Fe=bn(V,fe.length-1,it),Pe.push(Fe.geometry),_e();const a=C.getPixelRatio();F=new $a(C,new La(t*a,e*a,{type:Ga,depthBuffer:!1})),F.addPass(new Ja(V,U)),xe=new tt(Ut),oe=new tt(Ut),oe.uniforms.uDirection.value.set(0,1);for(const l of[xe,oe])l.uniforms.uSpread.value=3,l.uniforms.uGrain.value=1,l.uniforms.uBandTop.value=0,l.uniforms.uBandBottom.value=0,l.uniforms.uCurve.value=1,l.enabled=!1,F.addPass(l);I=new tt(vn),I.uniforms.uBandTop.value=0,I.uniforms.uBandBottom.value=0,I.uniforms.uCurve.value=1,I.uniforms.uResolution.value.set(t*a,e*a),st(),F.addPass(I),M=new tt({uniforms:{tDiffuse:{value:null},uIntensity:{value:0},uResolution:{value:new ee(t*a,e*a)},uGridSize:{value:z.gridSize},uPixelSizeRatio:{value:z.pixelSizeRatio},uGrayscaleOnly:{value:0},uInvertColor:{value:0}},vertexShader:Za,fragmentShader:Qa}),M.enabled=!1,F.addPass(M),k=new qa,k.enabled=!1,F.addPass(k),re=new en,re.enabled=!1,F.addPass(re),Qt(),Xe.forEach(l=>{l.visible=!0}),Fe.meshes.forEach(l=>{l.visible=!0}),C.compile(V,U),ie=1,dt(0,0);for(const l of[M,k,re])l.enabled=!0;F.render();for(const l of[M,k,re])l.enabled=!1;ie=0,dt(0,0);const m=new Oa;let T=0,w=0;const P=()=>{if(!C||!wt)return;const l=m.getElapsedTime(),c=Math.min(l-T,.1);T=l;const f=n.current;q||K(c),se.progress+=(se.target-se.progress)*$(.08,c);const i=me(),W=c>0?(n.current-f)*i/c:0,S=Math.abs(W);w+=(W/60*.015-w)*$(.1,c),Zt(c),an(yt,S,c,L);const N=L.honeyEnabled?ge.clamp(-W*L.honeyLag/1e3,-.4,.4):0;lt+=(N-lt)*(1-Math.exp(-L.honeyLagFollow*c)),hn(W,c,{wheelAmount:1-se.progress,radius:te.radius,cardHeight:te.thumbH}),qt(i),ea(i,w),dt(S,c),St=ln(it,St,S,c,L),I.uniforms.uTime.value=l,re.enabled=M.enabled||k.enabled,F.render(),be=requestAnimationFrame(P)};P()},Qt=()=>{if(de=tn(),!de)return;const t=I.uniforms,e=de.addFolder("Slider (Motion)");e.add(r,"lerpFactor",.01,.3,.005).name("Glide (desktop)"),e.add(r,"lerpFactorMobile",.01,.3,.005).name("Glide (touch)"),e.add(r,"keyLerpFactor",.01,.3,.005).name("Glide After Key"),e.add(r,"snapFactor",0,.5,.005).name("Snap Pull"),e.add(r,"scrollSpeed",1e-4,.01,1e-4).name("Wheel Speed"),e.add(r,"mouseMultiplier",.1,3,.05).name("Wheel Multiplier"),e.add(r,"dragSensitivity",.001,.02,5e-4).name("Drag Sensitivity"),e.add(r,"speedSpread",0,3,.05).name("Spread While Moving"),e.add(r,"keyScrollCooldown",0,1e3,10).name("Key Cooldown (ms)");const o=de.addFolder("Intro (After Page Transition)");o.add(r,"introSlides",0,150,1).name("Spin Length (slides, 0 = off)"),o.add(r,"introLerpFactor",.01,.3,.005).name("Spin Glide (desktop)"),o.add(r,"introLerpFactorMobile",.01,.3,.005).name("Spin Glide (touch)"),o.add(r,"introSpeedKick",0,5,.1).name("Spread Kick"),o.add({replay:He},"replay").name("â¶ Replay Intro");const s=de.addFolder("Post Processing"),p=s.addFolder("Film Grain");p.add(t.uGrainAmount,"value",0,.3,.001).name("Amount"),p.add(t.uGrainSpeed,"value",0,10,.01).name("Flicker Speed");const a=s.addFolder("Vignette"),m={enabled:t.uVignette.value>.5};a.add(m,"enabled").name("Enabled").onChange(D=>{t.uVignette.value=D?1:0}
240),a.add(t.uAmount,"value",0,1,.01).name("Darkness"),a.add(De,"openArea",.05,.95,.01).name("Open Area (share clear)").onChange(st),a.add(De,"reach",.8,1.5,.01).name("Full Dark At (1 = edges)").onChange(st),a.add(t.uShape,"value",1,8,.1).name("Shape (2 = oval, higher = squarer)"),a.add(t.uRoundness,"value",0,1,.01).name("Roundness (1 = circle)"),a.add(t.uDesaturate,"value",0,1,.01).name("Colour Drain");const T={color:`#${t.uTint.value.getHexString()}`};a.addColor(T,"color").name("Tint").onChange(D=>t.uTint.value.set(D)),a.add(t.uDither,"value",0,2,.01).name("Dither (anti-banding)"),s.add(C,"toneMappingExposure",0,3,.01).name("Exposure");const w=s.addFolder("Gap Light (White, Z)");w.add(G,"enabled").name("Enabled"),w.add(G,"preview").name("Preview (hold on at rest)"),w.add(G,"previewGap",10,400,1).name("Preview Gap (px)"),w.add(G,"intensity",0,10,.01).name("Intensity"),w.addColor(G,"color").name("Colour"),w.add(G,"gapForFull",10,600,1).name("Full At Gap (px)"),w.add(G,"core",0,4,.01).name("Gap Brightness"),w.add(G,"edgeSoftness",0,1,.01).name("Edge Softness"),w.add(G,"glow",0,300,1).name("Glow Spread (px)"),w.add(G,"glowAmount",0,2,.01).name("Glow Amount"),w.add(G,"ditherIntensity",0,20,.1).name("Intensity (Dither On)"),w.add(G,"ditherGlowAmount",0,2,.01).name("Glow Amount (Dither On)");const P=s.addFolder("Dither (Logo Click)");P.add({toggle:Bt},"toggle").name("â¶ Toggle Dither"),P.add(z,"intensity",0,1,.01).name("Strength").onChange(D=>{Ve.value&&!ue&&(M.uniforms.uIntensity.value=D)}),P.add(z,"gridSize",1,8,.5).name("Grid Size (px)").onChange(D=>{M.uniforms.uGridSize.value=D}),P.add(z,"pixelSizeRatio",1,6,.1).name("Pixel Size").onChange(D=>{M.uniforms.uPixelSizeRatio.value=D}),P.add(z,"grayscale").name("Grayscale").onChange(D=>{M.uniforms.uGrayscaleOnly.value=D?1:0}),P.add(z,"invert").name("Invert").onChange(D=>{M.uniforms.uInvertColor.value=D?1:0}),P.add(z,"fadeSeconds",0,3,.05).name("Fade (s)"),P.add(z,"glitchMs",0,2e3,10).name("Glitch Burst (ms)");const l=s.addFolder("Edge Blur + Chroma (while moving)");l.add(_,"bandLeft",0,.5,.01).name("Band Left"),l.add(_,"bandRight",0,.5,.01).name("Band Right"),l.add(_,"minBlurPx",0,5,.01).name("Min Blur (px)"),l.add(_,"maxBlurPx",0,128,.5).name("Max Blur (px)"),l.add(_,"chromaPx",0,60,.5).name("Chroma Split (px)"),l.add(_,"chromaRadial").name("Chroma Radial");const c=s.addFolder("Big Slider Bend (shared)");c.add(L,"bendEnabled").name("Enabled"),c.add(L,"bendInvert").name("Invert (Bowl)"),c.add(L,"bendShape",["Sphere","Vertical","Horizontal"]).name("Shape"),c.add(L,"bendStrength",0,300,1).name("Strength (px per 1000 px/s)"),c.add(L,"bendMaxPx",0,1500,1).name("Max Depth (px)"),c.add(L,"bendFocal",200,4e3,10).name("Perspective (px)"),c.add(L,"bendProfile",1,8,.1).name("Curve Shape"),c.add(L,"bendAttack",1,30,.5).name("Build Speed"),c.add(L,"bendRelease",.5,20,.1).name("Return Speed");const f=de.addFolder("Wheel (Small Slider)");f.add(g,"effect",["Bridge Only","Bridge + Bulge"]).name("Effect");const i={"In (1)":1,"Out (-1)":-1},W={"Inner (bottom edge)":"Inner","Outer (top edge)":"Outer"},S=f.addFolder("Forward Movement");S.add(g.forward,"direction",i).name("Bulge Direction"),S.add(g.forward,"origin",W).name("Moving Edge");const N=f.addFolder("Backward Movement");N.add(g.backward,"direction",i).name("Bulge Direction"),N.add(g.backward,"origin",W).name("Moving Edge"),f.add(g,"curve",1,5,.1).name("Bend Curve (1 = straight)"),f.add(g,"onlyWhileScrolling").name("Only While Scrolling"),f.add(g,"shading",0,1,.01).name("Bend Shading"),f.add(g,"relief",0,1.5,.01).name("Shading Relief"),f.add(g,"sheen",0,1,.01).name("Sheen"),f.add(g,"strength",0,400,1).name("Strength (px per 1000 px/s)"),f.add(g,"maxDepth",0,900,1).name("Max Depth (px)"),f.add(g,"focal",200,4e3,10).name("Perspective (px)"),f.add(g,"attack",1,30,.5).name("Build Speed"),f.add(g,"release",.5,20,.1).name("Return Speed"),f.add(L,"honeyEnabled").name("Honey Bridges"),f.add(g,"bridgePinch",0,1,.005).name("Bridge Pinch"),de.add({copy:()=>{const D={SLIDER:r,EDGE:_,post:{grainAmount:t.uGrainAmount.value,grainSpeed:t.uGrainSpeed.value,vignette:{enabled:m.enabled,amount:t.uAmount.value,openArea:De.openArea,reach:De.reach,shape:t.uShape.value,roundness:t.uRoundness.value,desaturate:t.uDesaturate.value,tint:T.color,dither:t.uDither.value},exposure:C.toneMappingExposure},wheelFx:g,GAP_LIGHT:G};navigator.clipboard?.writeText(JSON.stringify(D,null,2))}},"copy").name("Copy Settings (JSON)")},Zt=t=>{(n.isDragging||q||n.current!==n.target||n.speed!==0)&&le();const o=performance.now()-Ct>Cn;o!==ut.value&&(ut.value=o);const s=o?0:1;ye+=(s-ye)*(1-Math.exp(-4*t)),Math.abs(s-ye)<.001&&(ye=s)},dt=(t,e)=>{const o=q?0:Math.min(t/60*.1,1),s=o>ie?L.edgeFxAttack:L.edgeFxRelease;ie+=(o-ie)*(1-Math.exp(-s*e)),o===0&&ie<.001&&(ie=0);const p=ie>.001,a=C.getPixelRatio(),m=window.innerWidth*a,T=window.innerHeight*a,w=I.uniforms;if(w.uResolution.value.set(m,T),w.uIntensity.value=ie,w.uChromaStrength.value=_.chromaPx*a,w.uChromaCurve.value=L.chromaCurve,w.uChromaRadial.value=_.chromaRadial?1:0,w.uBandLeft.value=_.bandLeft,w.uBandRight.value=_.bandRight,xe.enabled=oe.enabled=p,!!p)for(const P of[xe,oe]){const l=P.uniforms;l.uIntensity.value=ie,l.uResolution.value.set(m,T),l.uMinBlur.value=_.minBlurPx*a,l.uMaxBlur.value=_.maxBlurPx*a,l.uBandLeft.value=_.bandLeft,l.uBandRight.value=_.bandRight}},qt=t=>{const e=1+n.lspeed*r.speedSpread,o=Math.round(-n.current),s=ye>.001;for(let a=0;a<fe.length;a++){const m=fe[a],T=o+a-at;m.position.x=(T+n.current)*t*e,m.scale.set(t,window.innerHeight,1),m.material.map=j.get(ae[H(T,Ye)].sliderUrl),m.material.opacity=ye,m.visible=s}for(let a=0;a<fe.length-1;a++)ot[a]=(o+a-at+.5+n.current)*t*e;ot.length=fe.length-1,xn(Fe,{gapCenters:ot,gap:t*(e-1),height:window.innerHeight,opacity:ye,ditherMix:M?.enabled?ge.clamp(M.uniforms.uIntensity.value/Math.max(z.intensity,.001),0,1):0});const p=ae[H(o,Ye)].title;R.value!==p&&(R.value=p)},ea=(t,e)=>{const o=window.innerWidth,s=window.innerHeight,{radius:p,thumbW:a,thumbH:m,thumbSpacing:T}=te,w=Math.PI*2/Ye,P=n.current*t,l=P*.0015,c=Ye*T,f=.5,i=Math.abs(e),W=se.progress;for(let S=0;S<ce.length;S++){const N=ce[S],D=S*w+l,At=o/2+Math.cos(D)*p-a/2,Tt=s/2+Math.sin(D)*p-m/2,ia=D*180/Math.PI+90;let ht=S*T+P*f;ht=(ht%c+c)%c;const Rt=o/2+ht-c/2-a/2,la=s/2-m/2+260,sa=(Rt+a/2-o/2)/T*i*60/100*a,ua=Rt+sa,da=At+(ua-At)*W,ca=Tt+(la-Tt)*W,ha=ia*(1-W),Ft=-o/2+da+a/2,Pt=s/2-ca-m/2,Dt=-ha*Math.PI/180,pt=Qe[S]||(Qe[S]={tx:0,ty:0,rotation:0});pt.tx=Ft,pt.ty=Pt,pt.rotation=Dt,Je!==S&&(N.position.set(Ft,Pt,0),N.rotation.z=Dt,N.scale.set(a,m,1))}Se.thumbW=a,Se.thumbH=m,Se.presence=ge.smoothstep(yt.edgeTier,.35,2),Se.lag=lt,Se.skipIndex=Je,Se.maxGap=T*2,gn(Xe,ce,Se,L)},Bt=()=>{if(!M)return;ue?.kill(),ue=null;const t=M.uniforms.uIntensity;if(Ve.value){Ve.value=!1,ue=je.to(t,{value:0,duration:z.fadeSeconds,ease:"power2.inOut",onComplete:()=>{M&&(M.enabled=!1),ue=null}});return}Ve.value=!0,M.enabled=!0,ue=je.to(t,{value:z.intensity,duration:z.fadeSeconds,ease:"power2.inOut",onComplete:()=>{ue=null}}),k&&z.glitchMs>0&&(clearTimeout(Ne),k.enabled=!0,k.goWild=!0,Ne=setTimeout(()=>{Ne=null,k&&(k.goWild=!1,k.enabled=!1)},z.glitchMs))},ta=()=>{je.killTweensOf(he),clearTimeout(Ze),Ze=null},aa=t=>{if(q)return;q=!0,Je=t,h();const e=ce[t],o=Qe[t]||{tx:0,ty:0,rotation:0};Object.assign(he,{x:o.tx,y:o.ty,rotation:o.rotation,scale:1});const s=()=>{const{thumbW:p,thumbH:a}=te;e.position.set(he.x,he.y,10),e.rotation.z=he.rotation,e.scale.set(p*he.scale,a*he.scale,1)};je.to(he,{x:0,y:0,rotation:0,scale:3,duration:1.2,ease:"power4.out",onUpdate:s,onComplete:()=>{Ze=setTimeout(()=>{Ze=null;const p=Qe[t];je.to(he,{x:p.tx,y:p.ty,rotation:p.rotation,scale:1,duration:1,ease:"power3.inOut",onUpdate:s,onComplete:()=>{e.position.z=0,q=!1,Je=-1,le()}})},800)}})},qe=()=>
240{if(te=ve(),!C||!F||!U)return;const t=window.innerWidth,e=window.innerHeight;U.left=t/-2,U.right=t/2,U.top=e/2,U.bottom=e/-2,U.updateProjectionMatrix(),C.setPixelRatio(Math.min(window.devicePixelRatio,et()?1:1.25)),C.setSize(t,e),F.setPixelRatio(C.getPixelRatio()),F.setSize(t,e);const o=C.getPixelRatio();M?.uniforms.uResolution.value.set(t*o,e*o),_e()},ct=()=>document.body.style.overflow==="hidden",Et=t=>t instanceof Element&&!!B.value?.contains(t)&&!t.closest('header, button, a, input, textarea, select, [contenteditable="true"]'),na=t=>t instanceof Element&&!!t.closest('input, textarea, select, [contenteditable="true"]'),oa=()=>{let t=0;const e=120,o=()=>{if(q)return;const i=performance.now();i-t<e||(t=i,y())},s=i=>{if(q||n.isDragging||i.ctrlKey||ct()||!Et(i.target))return;let W=i.wheelDeltaX||-i.deltaX,S=i.wheelDeltaY||-i.deltaY;!i.wheelDeltaX&&!i.wheelDeltaY&&i.deltaMode===1&&(W*=r.firefoxMultiplier,S*=r.firefoxMultiplier);const N=(W+S)*r.mouseMultiplier;n.introActive=!1,n.target+=N*r.scrollSpeed,n.speed=N*15e-5*5,o(),le()};let p=!1,a=0,m=0,T=0;const w=i=>{q||!i.isPrimary||ct()||!Et(i.target)||(p=!0,n.introActive=!1,n.isDragging=!0,n.dragStartX=i.clientX,n.dragStartTarget=n.target,a=T=i.clientX,m=i.clientY,d.value&&(d.value.style.cursor="grabbing"),le())},P=i=>{if(!n.isDragging||!i.isPrimary)return;const W=i.clientX-n.dragStartX;n.speed=W*.001,n.target=n.dragStartTarget+W*r.dragSensitivity,i.clientX!==T&&o(),T=i.clientX,le()},l=i=>{if(!p||!i.isPrimary||(p=!1,n.isDragging=!1,d.value&&(d.value.style.cursor="grab"),le(),i.type!=="pointerup"||q)||Math.abs(i.clientX-a)>=5||Math.abs(i.clientY-m)>=5)return;const W=window.innerWidth,S=window.innerHeight;cn(rt,i.clientX-W/2,S/2-i.clientY),xt.set(rt.x/(W/2),rt.y/(S/2)),bt.setFromCamera(xt,U);const N=bt.intersectObjects(ce);N.length>0&&aa(N[0].object.userData.index)},c={ArrowLeft:1,KeyA:1,ArrowRight:-1,KeyD:-1,Space:-1},f=i=>{const W=c[i.code];if(!W||q||i.metaKey||i.ctrlKey||i.altKey||ct()||na(i.target))return;i.preventDefault();const S=Date.now();S-n.lastKeyTime<r.keyScrollCooldown||(n.lastKeyTime=S,n.introActive=!1,n.target=Math.round(n.target)+W,n.keyBoostUntil=S+r.keyScrollCooldown+500,o(),le())};window.addEventListener("wheel",s,{passive:!0}),window.addEventListener("pointerdown",w),window.addEventListener("pointermove",P),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),window.addEventListener("keydown",f),Ke=()=>{window.removeEventListener("wheel",s),window.removeEventListener("pointerdown",w),window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l),window.removeEventListener("keydown",f),n.isDragging=!1}},ra=()=>{wt=!1,be&&cancelAnimationFrame(be),be=null,ta(),ue?.kill(),ue=null,clearTimeout(Ne),Ne=null,Ve.value=!1,de?.destroy(),de=null,F&&(F.passes.forEach(e=>{e.dispose&&e.dispose(),e.material&&e.material.dispose(),e.fsQuad&&e.fsQuad.dispose&&e.fsQuad.dispose()}),F.renderTarget1?.dispose(),F.renderTarget2?.dispose());const t=new Set;[...fe,...ce,...Xe,...Fe?.meshes||[]].forEach(e=>{t.add(e.material),Pe.includes(e.geometry)||e.geometry.dispose()}),t.forEach(e=>e.dispose()),Pe.forEach(e=>e.dispose()),Pe.length=0,Ue(),V?.clear(),C&&(C.dispose(),C.forceContextLoss()),fe=[],ce=[],Xe=[],Fe=null,C=null,F=null,V=null,U=null,xe=oe=I=M=k=re=null};wa(async()=>{const t=[];b.value&&b.value.videoRef&&t.push({id:"navbar-logo",el:b.value.videoRef});let e=!1;try{const o=[...new Set(ae.map(a=>a.sliderUrl))],s=[...new Set(ae.map(a=>a.wheelUrl))],p=[...o.map(a=>we(a).then(m=>{j.set(a,m)})),...s.map(a=>we(a,yn).then(m=>{Q.set(a,m)}))];if(await x({fonts:["16px DotGothic16","16px Geist","16px DM Mono"],videoElements:t,promises:p,promiseNames:[...o,...s]}),await ba(),O||!Re.value){Ue();return}Jt(),e=!0}catch{xa()}O||(X.value=!1,e&&_a(He),za(),e&&(oa(),window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe),le()))}),Sa(()=>{O=!0,window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),Ke?.(),Ke=null,Na(ra)});let Mt=!1;const Wt=t=>{X.value||Mt||(Mt=!0,Ke?.(),Ke=null,setTimeout(()=>{v.push(t)}))};return(t,e)=>(ya(),Ca("div",{class:"explore-view",ref_key:"rootRef",ref:B},[Ce("canvas",{ref_key:"noiseCanvas",ref:Re,class:"noise-bg"},null,512),kt(Ya,{ref_key:"navbarRef",ref:b,onHome:e[0]||(e[0]=o=>Wt("/")),onShop:e[1]||(e[1]=o=>Wt("/shop")),onVideoClick:Bt},null,512),Ce("button",{class:"grid-toggle-btn",onPointerdown:e[2]||(e[2]=It(()=>{},["stop"])),onClick:It($e,["stop"])},[Ce("span",{class:Ot({active:!E.value})},"WHEEL",2),e[3]||(e[3]=Ba(" / ",-1)),Ce("span",{class:Ot({active:E.value})},"GRID",2)],32),Ce("div",{class:"viewport",ref_key:"viewportRef",ref:d},[Ce("div",Sn,[Ce("p",{class:"slide-title",style:Ea({opacity:ut.value?0:1})},"// "+Ma(R.value),5)])],512),kt(nn)],512))}},Tn=fa(Bn,[["__scopeId","data-v-808a2504"]]);export{Tn 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.