PageSourceSearch

https://www.funnudge.com/_next/static/chunks/399.908d09505f093918.js

js funnudge.com collected 2026-10-02 01:30:29 UTC 15,908 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[399],{98:(e,t,a)=>{a.d(t,{EB:()=>c,ER:()=>d,cC:()=>i,sD:()=>h});var n=a(7548),o=a(2006),r=a(3464),s=a(6170),l=a(6451);function i(e,t){var a,i,d,c,h;let u=new n.Z58,m=new n.ubm(null!=(a=null==t?void 0:t.fov)?a:60,4/3,.1,500),p=new n.JeP({antialias:!0});p.setPixelRatio(Math.min(window.devicePixelRatio||1,1.5)),p.setClearColor(null!=(i=null==t?void 0:t.clear)?i:657940),(null==t?void 0:t.shadows)&&(p.shadowMap.enabled=!0,p.shadowMap.type=n.Wk7);let f=p.domElement;f.style.width="100%",f.style.height="100%",f.style.display="block",e.appendChild(f);let x=null;(null==t?void 0:t.bloom)&&((x=new o.s(p)).addPass(new s.A(u,m)),x.addPass(new l.C(new n.I9Y(256,256),null!=(d=t.bloom.strength)?d:.5,null!=(c=t.bloom.radius)?c:.5,null!=(h=t.bloom.threshold)?h:.7)),x.addPass(new r.X));let w=()=>{let t=e.clientWidth||1,a=e.clientHeight||1;p.setSize(t,a,!1),x&&(x.setPixelRatio(p.getPixelRatio()),x.setSize(t,a)),m.aspect=t/a,m.updateProjectionMatrix()};w();let g=new ResizeObserver(w);return g.observe(e),{scene:u,camera:m,renderer:p,render:()=>{x?x.render():p.render(u,m)},dispose:()=>{g.disconnect(),null==x||x.dispose(),u.traverse(e=>{e.geometry&&e.geometry.dispose();let t=e.material;Array.isArray(t)?t.forEach(e=>
1e.dispose()):null==t||t.dispose()}),p.dispose(),f.parentElement===e&&e.removeChild(f)}}}function d(e,t,a){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=document.createElement("canvas");s.width=e,s.height=t,a(s.getContext("2d"),e,t);let l=new n.GOR(s);return l.colorSpace=n.er$,l.wrapS=n.GJx,l.wrapT=n.GJx,l.repeat.set(o,r),l.anisotropy=4,l}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#808080",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:26;return d(e,e,n=>{n.fillStyle=t,n.fillRect(0,0,e,e);for(let t=0;t<e*e*.35;t++){let t=128+Math.floor((Math.random()-.5)*2*a);n.fillStyle="rgb(".concat(t,",").concat(t,",").concat(t,")"),n.fillRect(Math.random()*e,Math.random()*e,1.5,1.5)}})}function h(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0xffffff,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.6,r=new Float32Array(3*e);for(let a=0;a<e;a++){let e=t*(.5+.5*Math.random()),n=Math.random()*Math.PI*2,o=(Math.random()-.5)*Math.PI;r[3*a]=Math.cos(n)*Math.cos(o)*e,r[3*a+1]=Math.sin(o)*e,r[3*a+2]=Math.sin(n)*Math.cos(o)*e}let s=new n.LoY;s.setAttribute("position",new n.THS(r,3));let l=new n.BH$({color:a,size:o,sizeAttenuation:!0,transparent:!0,opacity:.8,blending:n.EZo,depthWrite:!1});return new n.ONl(s,l)}},399:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});var n=a(5155),o=a(2115),r=a(7548);let s=new r.Pq0;function l(e,t,a,n,o,r){let l=2*Math.PI*o/4,i=Math.max(r-2*o,0),d=Math.PI/4;s.copy(t),s[n]=0,s.normalize();let c=.5*l/(l+i),h=1-s.angleTo(e)/d;return 1===Math.sign(s[a])?h*c:i/(l+i)+c+c*(1-h)}class i extends r.iNn{constructor(e=1,t=1,a=1,n=2,o=.1){if(n=2*n+1,o=Math.min(e/2,t/2,a/2,o),super(1,1,1,n,n,n),1===n)return;let s=this.toNonIndexed();this.index=null,this.attributes.position=s.attributes.position,this.attributes.normal=s.attributes.normal,this.attributes.uv=s.attributes.uv;let i=new r.Pq0,d=new r.Pq0,c=new r.Pq0(e,t,a).divideScalar(2).subScalar(o),h=this.attributes.position.array,u=this.attributes.normal.array,m=this.attributes.uv.array,p=h.length/6,f=new r.Pq0,x=.5/n;for(let n=0,r=0;n<h.length;n+=3,r+=2)switch(i.fromArray(h,n),d.copy(i),d.x-=Math.sign(d.x)*x,d.y-=Math.sign(d.y)*x,d.z-=Math.sign(d.z)*x,d.normalize(),h[n+0]=c.x*Math.sign(i.x)+d.x*o,h[n+1]=c.y*Math.sign(i.y)+d.y*o,h[n+2]=c.z*Math.sign(i.z)+d.z*o,u[n+0]=d.x,u[n+1]=d.y,u[n+2]=d.z,Math.floor(n/p)){case 0:f.set(1,0,0),m[r+0]=l(f,d,"z","y",o,a),m[r+1]=1-l(f,d,"y","z",o,t);break;case 1:f.set(-1,0,0),m[r+0]=1-l(f,d,"z","y",o,a),m[r+1]=1-l(f,d,"y","z",o,t);break;case 2:f.set(0,1,0),m[r+0]=1-l(f,d,"x","z",o,e),m[r+1]=l(f,d,"z","x",o,a);break;case 3:f.set(0,-1,0),m[r+0]=1-l(f,d,"x","z",o,e),m[r+1]=1-l(f,d,"z","x",o,a);break;case 4:f.set(0,0,1),m[r+0]=1-l(f,d,"x","y",o,e),m[r+1]=1-l(f,d,"y","x",o,t);break;case 5:f.set(0,0,-1),m[r+0]=l(f,d,"x","y",o,e),m[r+1]=1-l(f,d,"y","x",o,t)}}}var d=a(1175),c=a(4107),h=a(98),u=a(3557),m=a(2773);function p(){let e=(0,o.useRef)(null),[t,a]=(0,o.useState)("idle");(0,m.GL)("running"===t);let[s,l]=(0,o.useState)(0),[p,f]=(0,o.useState)([]),{best:x,submit:w}=(0,u.g)("stack-3d"),g=(0,o.useRef)("idle"),y=(0,o.useRef)(0),b=(0,o.useRef)(()=>{}),M=(0,o.useRef)(()=>{}),v=(0,o.useRef)(0);g.current=t;let z=(0,o.useCallback)((e,t)=>{let a=++v.current;f(n=>[...n.slice(-2),{id:a,text:e,cls:t}]),setTimeout(()=>{f(e=>e.filter(e=>e.id!==a))},1300)},[]),S=(0,o.useRef)(z);return S.current=z,(0,o.useEffect)(()=>{let t=e.current;if(!t)return;let n=(0,h.cC)(t,{fov:45,clear:1184299,shadows:!0,bloom:{strength:.35,radius:.5,threshold:.78}}),{scene:o,camera:s,renderer:u}=n;o.fog=new r.jUj(1184299,25,70);let m=new r.$p8(0xffffff,.55);o.add(m);let p=new r.ZyN(0xffffff,1.6);p.position.set(8,18,6),p.castShadow=!0,p.shadow.mapSize.set(1024,1024),p.shadow.camera.left=-14,p.shadow.camera.right=14,p.shadow.camera.top=14,p.shadow.camera.bottom=-14,p.shadow.camera.far=80,o.add(p),o.add(p.target);let f=new r.ZyN(9133302,.35);f.position.set(-6,8,-4),o.add(f);let x=new r.GOR((()=>{let e=document.createElement("canvas");e.width=8,e.height=256;let t=e.getContext("2d"),a=t.createLinearGradient(0,0,0,256);return a.addColorStop(0,"#7ec8e8"),a.addColorStop(.5,"#a8dcc8"),a.addColorStop(.8,"#d8ecb8"),a.addColorStop(1,"#e8f4d0"),t.fillStyle=a,t.fillRect(0,0,8,256),e})());
1x.colorSpace=r.er$;let v=new r.eaF(new r.Gu$(150,24,16),new r.V9B({map:x,side:r.hsX,fog:!1}));o.add(v),o.fog=new r.jUj(0xc2e0c8,30,90);let z=(0,h.sD)(120,90,0xffffff,.5);z.material.opacity=.3,o.add(z);let P=new r.eaF(new r.tcD(120,48),new r._4j({color:5212733,roughness:1}));P.rotation.x=-Math.PI/2,P.position.y=-.51,P.receiveShadow=!0,o.add(P);let j=new r.G_z({color:7031340}),k=[new r.G_z({color:2976309}),new r.G_z({color:3833154}),new r.G_z({color:2447916})];for(let e=0;e<34;e++){let t=e/34*Math.PI*2+.2*Math.random(),a=22+30*Math.random(),n=1.6+2.4*Math.random(),s=new r.YJl,l=new r.eaF(new r.Ho_(.16*n,.2*n,n,7),j);l.position.y=n/2,s.add(l);let i=k[e%3];for(let e=0;e<3;e++){let t=new r.eaF(new r.qFE((1.3-.3*e)*n,1.2*n,8),i);t.position.y=n*(.9+.7*e),s.add(t)}s.position.set(Math.cos(t)*a,-.5,Math.sin(t)*a),o.add(s)}let N=(0,h.EB)(128,"#808080",18),C=new r.YJl;o.add(C);let E=new r.Q1f(0xffffff),F=new r.Q1f(0xffb88a),R=new r.Q1f(3358830),_=new r.Q1f(0xc2e0c8),D=new r.Q1f(1976134),G=new r.Gu$(1,8,6),A=new r.G_z({color:0xffffff,transparent:!0,opacity:.82}),I=new r.YJl;for(let e=0;e<9;e++){let t=new r.YJl,a=3+(2*Math.random()|0);for(let e=0;e<a;e++){let e=new r.eaF(G,A);e.position.set((Math.random()-.5)*3,(Math.random()-.3)*.8,(Math.random()-.5)*1.5),e.scale.setScalar(.8+Math.random()),t.add(e)}let n=Math.random()*Math.PI*2,o=30+15*Math.random();t.position.set(Math.cos(n)*o,12+3.2*e,Math.sin(n)*o),t.scale.setScalar(1.8+1.2*Math.random()),I.add(t)}o.add(I);let q=new r.bdM(.5,.16),L=new r.V9B({color:2040880,side:r.$EB}),B=[];for(let e=0;e<3;e++){let t=new r.YJl,a=new r.eaF(q,L);a.position.x=-.25;let n=new r.eaF(q,L);n.position.x=.25,t.add(a,n),B.push({g:t,wl:a,wr:n,r:12+4*e,y:15+9*e,sp:.25+.15*Math.random(),off:6.28*Math.random()}),o.add(t)}let O=[],T=[],J=null,Y=[],$=8,Q=0,H=e=>(160+9*e)%360,V=(e,t,a,n,o,s)=>{let l=new r.eaF(new i(e,1,t,2,.09),(e=>{let t=new r.Q1f().setHSL(H(e)/360,.62,.56);return new r._4j({color:t,emissive:t.clone().multiplyScalar(.14),roughness:.45,metalness:.15,bumpMap:N,bumpScale:.5})})(s));return l.position.set(a,n,o),l.castShadow=!0,l.receiveShadow=!0,C.add(l),l},W=[],Z=new r.iNn(.16,.16,.03),U=e=>{e.removeFromParent(),e.geometry.dispose(),e.material.dispose()},X=()=>{let e=T[T.length-1],t=T.length%2==0?"x":"z",a=+T.length,n=V(e.sx,e.sz,e.x,a,e.z,T.length);"x"===t?n.position.x=-7.5:n.position.z=-7.5,J={mesh:n,axis:t,t:0}};b.current=()=>{for(let e of T)U(e.mesh);for(let e of Y)U(e.mesh);J&&U(J.mesh),T=[],Y=[],J=null,y.current=0,l(0),$=8,Q=0;let e=V(6,6,0,0,0,0);T.push({mesh:e,x:0,z:0,sx:6,sz:6,pop:0}),X(),a("running")},M.current=()=>{if("running"!==g.current||!J)return;let e=T[T.length-1],t=J.axis,n="x"===t?J.mesh.position.x:J.mesh.position.z,s="x"===t?e.x:e.z,i="x"===t?e.sx:e.sz,h=n-s,u=i-Math.abs(h),m=+T.length;if(u<=0){Y.push({mesh:J.mesh,vy:0,vr:h>0?-2:2,fade:0}),J=null,(0,d._O)("lose"),a("over"),w(y.current),(0,c.q7)("stack-3d",y.current);return}let p=.2>Math.abs(h),f=u,x=p?s:s+h/2;if(p){f=Math.min(i+(.15+Math.min(.15,((Q+=1)-1)*.05)),6),(0,d._O)(Q>=3?"combo":"perfect"),Q>=2&&S.current("✨ PERFECT \xd7".concat(Q,"!"),"text-cyan-300");let e=new r.eaF(new r.rKP(.6,.78,40),new r.V9B({color:0xffffff,transparent:!0,opacity:.9,side:r.$EB}));e.rotation.x=-Math.PI/2,e.position.y=m+.55,o.add(e),O.push({mesh:e,t:0}),((e,t)=>{for(let a=0;a<16;a++){let n=new r.eaF(Z,new r.V9B({color:new r.Q1f().setHSL((H(t)+40*a)%360/360,.8,.6),transparent:!0}));n.position.set(0,e+.8,0),o.add(n);let s=a/16*Math.PI*2;W.push({mesh:n,vel:new r.Pq0(Math.cos(s)*(2+3*Math.random()),4+3*Math.random(),Math.sin(s)*(2+3*Math.random())),spin:new r.Pq0(8*Math.random(),8*Math.random(),8*Math.random()),t:0})}})(m,T.length),f=Math.round(100*f)/100,x=Math.round(100*x)/100}else{Q=0;let a=Math.abs(h),n=h>0?s+i/2+a/2:s-i/2-a/2,o=V("x"===t?a:e.sx,"x"===t?e.sz:a,"x"===t?n:e.x,m,"x"===t?e.z:n,T.length);Y.push({mesh:o,vy:0,vr:h>0?-2.5:2.5,fade:0}),(0,d._O)("tap")}U(J.mesh),J=null;let b="x"===t?f:e.sx,M="x"===t?e.sz:f,v="x"===t?x:e.x,z="x"===t?e.z:x,P=V(b,M,v,m,z,T.length);T.push({mesh:P,x:v,z,sx:b,sz:M,pop:.18*!!p}),y.current+=1,l(y.current),w(y.current),y.current%10==0&&(S.current("\uD83C\uDFC6 ".concat(y.current," FLOORS!"),"text-amber-300"),(0,d._O)("clear")),X()};let K=0,ee=performance.now(),et=e=>{let t=Math.min((e-ee)/1e3,.033);if(ee=e,"running"===g.current&&J){let e=Math.min(1.1+.022*y.current,2.4);J.t+=t*e;let a=J.t%2,n=a<1?-7.5+2*a*7.5:7.5-(a-1)*15;"x"===J.axis?J.mesh.position.x=n:J.mesh.position.z=n}for(let e of Y){if(e.vy+=30*t,e.mesh.position.y-=e.vy*t,e.mesh.rotation.x+=e.vr*t*.6,e.mesh.rotation.z+=e.vr*t,!e.bounced&&e.mesh.position.y<=.1&&e.vy>0){e.bounced=!0,e.vy=-(.3*e.vy),e.vr*=.4;let t=e.mesh.material;t.transparent=!0,t.needsUpdate=!0}e.bounced&&(e.fade+=1.4*t,e.mesh.material.opacity=Math.max(0,1-e.fade))}for(let e of(Y=Y.filter(e=>!(e.fade>=1)&&!(e.mesh.position.y<-40)||(U(e.mesh),!1)),T))if(e.pop>0){e.pop-=t;let a=1+.45*Math.max(e.pop,0);e.mesh.scale.set(a,1,a)}W=W.filter(e=>(e.t+=t,e.vel.y-=9*t,e.mesh.position.addScaledVector(e.vel,t),e.mesh.rotation.x+=e.spin.x*t,e.mesh.rotation.y+=e.spin.y*t,e.mesh.rotation.z+=e.spin.z*t,e.mesh.material.opacity=Math.max(1-e.t/1.1,0),!(e.t>=1.1)||(o.remove(e.mesh),e.mesh.material.dispose(),!1))),O=O.filter(e=>(e.t+=2.4*t,e.mesh.scale.setScalar(1+3.2*e.t),e.mesh.material.opacity=Math.max(.9-e.t,0),!(e.t>=1)||(o.remove(e.mesh),e.mesh.geometry.dispose(),e.mesh.material.dispose(),!1)));let a=T.length;for(let t of(C.rotation.z=Math.sin(e/1400)*Math.min(.02,7e-4*a),C.rotation.x=Math.cos(e/1700)*Math.min(.016,5e-4*a),J&&(J.mesh.position.y=+T.length+.05*Math.sin(e/260)),I.rotation.y=3e-5*e,B)){let a=e/1e3*t.sp+t.off;t.g.position.set(Math.cos(a)*t.r,t.y+.6*Math.sin(e/900+t.off),Math.sin(a)*t.r),t.g.rotation.y=-a-Math.PI/2;let n=.7*Math.sin(e/90+t.off);t.wl.rotation.z=n,t.wr.rotation.z=-n}let l=+T.length;$+=(l+7-$)*Math.min(3*t,1),s.position.set(11,$,11),s.lookAt(0,$-5.5,0),z.position.y=$-8,v.position.y=$-10,p.position.set(8,l+18,6),p.target.position.set(0,l,0);let i=r.cj9.clamp(($-8)/45,0,1),d=v.material;i<.5?d.color.lerpColors(E,F,2*i):d.color.lerpColors(F,R,(i-.5)*2),o.fog.color.lerpColors(_,D,i),z.material.opacity=.1+.9*i,p.intensity=1.6-.
16*i,m.intensity=.55-.15*i,f.intensity=.35+.45*i,n.render(),K=requestAnimationFrame(et)};return K=requestAnimationFrame(et),()=>{cancelAnimationFrame(K),N.dispose(),x.dispose(),Z.dispose(),G.dispose(),q.dispose(),n.dispose()}},[]),(0,o.useEffect)(()=>{let e=e=>{("Space"===e.code||"Enter"===e.key)&&(e.preventDefault(),"running"===g.current?M.current():b.current())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,n.jsxs)("div",{className:"select-none",children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsxs)("div",{className:"rounded-xl bg-white/10 px-4 py-2 text-center",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-zinc-400",children:"Floors"}),(0,n.jsx)("div",{className:"text-xl font-bold text-white",children:s})]}),(0,n.jsxs)("div",{className:"rounded-xl bg-white/10 px-4 py-2 text-center",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-zinc-400",children:"Best"}),(0,n.jsx)("div",{className:"text-xl font-bold text-amber-300",children:x})]})]}),(0,n.jsx)("button",{onClick:()=>b.current(),className:"rounded-xl bg-gradient-to-r from-cyan-500 to-blue-500 px-4 py-2 font-bold text-white transition hover:scale-105",children:"running"===t?"Restart":"Start"})]}),(0,n.jsxs)("div",{"data-board":!0,ref:e,className:"relative mx-auto aspect-square w-full touch-none overflow-hidden rounded-2xl border border-white/10 sm:aspect-[4/3]",style:{maxWidth:"min(100%, calc(82vh * 1.333))"},onPointerDown:()=>{"running"===g.current?M.current():"idle"===g.current&&b.current()},role:"application","aria-label":"Stack 3D game. Tap or press space to drop the sliding block.",children:[(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-[18%] z-10 flex flex-col items-center gap-1",children:p.map(e=>(0,n.jsx)("div",{className:"animate-bounce-in text-xl font-extrabold drop-shadow-[0_2px_4px_rgba(0,0,0,0.7)] sm:text-2xl ".concat(e.cls),children:e.text},e.id))}),"running"!==t&&(0,n.jsxs)("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/60 backdrop-blur-[2px]",children:["over"===t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"animate-bounce-in text-3xl font-extrabold text-white",children:"\uD83E\uDDCA Tower toppled!"}),(0,n.jsxs)("p",{className:"text-zinc-200",children:[s," floors",s>0&&s>=x&&(0,n.jsx)("span",{className:"ml-2 font-bold text-amber-300",children:"New best!"})]})]}):(0,n.jsx)("p",{className:"animate-float text-5xl","aria-hidden":!0,children:"\uD83E\uDDCA"}),(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),b.current()},className:"rounded-xl bg-gradient-to-r from-cyan-500 to-blue-500 px-6 py-3 font-bold text-white transition hover:scale-105",children:"over"===t?"Stack again":"▶ Start stacking"})]})]}),(0,n.jsx)("p",{className:"mt-4 text-center text-sm text-zinc-500",children:"⌨️ Space / \uD83D\uDCF1 Tap to drop \xb7 Perfect drops regrow your block"})]})}},2773:(e,t,a)=>{a.d(t,{GL:()=>c,Gp:()=>l,Nc:()=>s,_y:()=>i,mA:()=>d});var n=a(2115);let o=null,r=new Set;function s(e){if(o!==e)for(let t of(o=e,r))t(e)}function l(e){return r.add(e),()=>r.delete(e)}let i={title:"Leave this game?",body:"You're mid-game — your progress in this round will be lost."},d={title:"Leave the match?",body:"The match is still live — leaving counts as a loss and your opponent takes the win."};function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,{title:a,body:o}=t;(0,n.useEffect)(()=>e?(s({title:a,body:o}),()=>s(null)):void s(null),[e,a,o])}},3557:(e,t,a)=>{a.d(t,{g:()=>o});var n=a(2115);function o(e){let[t,a]=(0,n.useState)(0);return(0,n.useEffect)(()=>{try{let t=window.localStorage.getItem("funnudge:".concat(e));t&&a(Number(t)||0)}catch(e){}},[e]),{best:t,submit:(0,n.useCallback)(t=>{a(a=>{if(t<=a)return a;try{window.localStorage.setItem("funnudge:".concat(e),String(t))}catch(e){}return t})},[e])}}}}]);

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.