PageSourceSearch

https://www.funnudge.com/_next/static/chunks/8755.274655c8280c7b1e.js

js funnudge.com collected 2026-10-02 01:31:45 UTC 10,905 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8755],{2773:(e,t,r)=>{r.d(t,{GL:()=>s,Gp:()=>c,Nc:()=>i,_y:()=>o,mA:()=>u});var l=r(2115);let n=null,a=new Set;function i(e){if(n!==e)for(let t of(n=e,a))t(e)}function c(e){return a.add(e),()=>a.delete(e)}let o={title:"Leave this game?",body:"You're mid-game — your progress in this round will be lost."},u={title:"Leave the match?",body:"The match is still live — leaving counts as a loss and your opponent takes the win."};function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,{title:r,body:n}=t;(0,l.useEffect)(()=>e?(i({title:r,body:n}),()=>i(null)):void i(null),[e,r,n])}},2932:(e,t,r)=>{function l(e,t,r){let l=window.devicePixelRatio||1,n=Math.max(1,Math.min((e.clientWidth||t)*l/t,4)),a=Math.round(t*n),i=Math.round(r*n);(e.width!==a||e.height!==i)&&(e.width=a,e.height=i);let c=e.getContext("2d");return c&&c.setTransform(n,0,0,n,0,0),c}function n(e,t,r,l,n){let a=r.getBoundingClientRect(),i=Math.min(a.width/l,a.height/n)||1,c=a.left+(a.width-l*i)/2,o=a.top+(a.height-n*i)/2;return{x:(e-c)/i,y:(t-o)/i}}r.d(t,{c:()=>l,f:()=>n})},3557:(e,t,r)=>{r.d(t,{g:()=>n});var l=r(2115);function n(e){let[t,r]=(0,l.useState)(0);return(0,l.useEffect)(()=>{try{let t=window.localStorage.getItem("funnudge:".concat(e));t&&r(Number(t)||0)}catch(e){}},[e]),{best:t,submit:(0,l.useCallback)(t=>{r(r=>{if(t<=r)return r;try{window.localStorage.setItem("funnudge:".concat(e),String(t))}catch(e){}return t})},[e])}}},8755:(e,t,r)=>{r.r(t),r.d(t,{default:()=>s});var l=r(5155),n=r(2115),a=r(2932),i=r(1175),c=r(4107),o=r(3557),u=r(2773);function s(){let e=(0,n.useRef)(null),[t,r]=(0,n.useState)("idle");(0,u.GL)("running"===t);let[s,f]=(0,n.useState)(0),[d,h]=(0,n.useState)([]),{best:x,submit:p}=(0,o.g)("flappy-wings"),g=(0,n.useRef)({y:240,vy:0,rot:0}),m=(0,n.useRef)([]),b=(0,n.useRef)([]),y=(0,n.useRef)(0),v=(0,n.useRef)("idle"),w=(0,n.useRef)(0),M=(0,n.useRef)(0),S=(0,n.useRef)(0),R=(0,n.useRef)(0),C=(0,n.useRef)(10),N=(0,n.useRef)(0),j=(0,n.useRef)(-1),P=(0,n.useRef)(0),k=(0,n.useRef)(Array.from({length:6},(e,t)=>({x:115*t+20,y:40+t%3*55,s:.6+t%3*.3}))),D=(0,n.useRef)(Array.from({length:36},()=>({x:640*Math.random(),y:480*Math.random()*.55,r:.6+1.2*Math.random(),ph:6.28*Math.random()}))),T=(0,n.useRef)(Array.from({length:16},(e,t)=>({x:44*t,w:26+22*Math.random(),h:40+70*Math.random()})));v.current=t;let A=(e,t)=>{let r=++P.current;h(l=>[...l.slice(-2),{id:r,text:e,cls:t}]),window.setTimeout(()=>{h(e=>e.filter(e=>e.id!==r))},1200)},_=(0,n.useRef)(A);_.current=A;let I=()=>Math.min(290,150+6*y.current),E=e=>{let t=Math.max(112,165-2.5*y.current);R.current+=1,m.current.push({x:e,gapY:90+Math.random()*(300-t),gap:t,passed:!1,golden:R.current%7==0})},L=function(e,t,r){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:14;for(let n=0;n<l;n++){let l=Math.random()*Math.PI*2,n=80+220*Math.random();b.current.push({x:e,y:t,vx:Math.cos(l)*n,vy:Math.sin(l)*n,life:.6+.4*Math.random(),color:r})}},Y=(0,n.useCallback)(t=>{let r=e.current;if(!r)return;let l=(0,a.c)(r,640,480);if(!l)return;let n=performance.now();l.save(),N.current>.01&&(l.translate((Math.random()-.5)*N.current*16,(Math.random()-.5)*N.current*16),N.current*=Math.exp(-(6*t)));let i=l.createLinearGradient(0,0,0,480);for(let e of(i.addColorStop(0,"#1e1b4b"),i.addColorStop(1,"#312e81"),l.fillStyle=i,l.fillRect(-10,-10,660,500),D.current))l.globalAlpha=.35+.5*Math.abs(Math.sin(n/900+e.ph)),l.fillStyle="#e0e7ff",l.beginPath(),l.arc(e.x,e.y,e.r,0,2*Math.PI),l.fill();for(let e of(l.globalAlpha=1,l.fillStyle="#fef3c7",l.beginPath(),l.arc(550,66,24,0,2*Math.PI),l.fill(),l.fillStyle="rgba(30,27,75,0.25)",l.beginPath(),l.arc(542,60,6,0,2*Math.PI),l.arc(558,72,4,0,2*Math.PI),l.fill(),l.fillStyle="rgba(15,14,48,0.9)",T.current)){"running"===v.current&&j.current<0&&(e.x-=7*t,e.x<-60&&(e.x+=704)),l.fillRect(e.x,466-e.h,e.w,e.h),l.fillStyle="rgba(253,224,71,0.25)";for(let t=472-e.h;t<456;t+=14)l.fillRect(e.x+5,t,3,4),e.w>30&&l.fillRect(e.x+e.w-9,t,3,4);l.fillStyle="rgba(15,14,48,0.9)"}for(let e of(l.fillStyle="rgba(255,255,255,0.08)",k.current))"running"===v.current&&j.current<0&&(e.x-=18*e.s*t,e.x<-60&&(e.x=700)),l.beginPath(),l.ellipse(e.x,e.y,36*e.s,14*e.s,0,0,2*Math.PI),l.fill();for(let e of m.current){let t=l.createLinearGradient(e.x,0,e.x+64,0);e.golden?(t.addColorStop(0,"#d97706"),t.addColorStop(.5,"#fbbf24"),t.addColorStop(1,"#b45309"),l.shadowColor="#fbbf24",l.shadowBlur=18):(t.addColorStop(0,"#22c55e"),t.addColorStop(.5,"#4ade80"),t.addColorStop(1,"#16a34a")),l.fillStyle=t,l.fillRect(e.x,0,64,e.gapY-e.gap/2),l.fillRect(e.x-5,e.gapY-e.gap/2-22,74,22),l.fillRect(e.x,e.gapY+e.gap/2,64,480-e.gapY-e.gap/2),l.fillRect(e.x-5,e.gapY+e.gap/2,74,22),l.shadowBlur=0}"running"===v.current&&(S.current=(S.current+I()*t)%28),l.fillStyle="#16a34a",l.fillRect(0,466,640,14),l.fillStyle="#15803d";
1for(let e=-S.current;e<640;e+=28)l.beginPath(),l.moveTo(e,480),l.lineTo(e+14,466),l.lineTo(e+24,466),l.lineTo(e+10,480),l.closePath(),l.fill();for(let e of(b.current=b.current.filter(e=>e.life>0),b.current))e.x+=e.vx*t,e.y+=e.vy*t,e.vy+=500*t,e.life-=t,l.globalAlpha=Math.max(e.life,0),l.fillStyle=e.color,l.fillRect(e.x-3,e.y-3,6,6);l.globalAlpha=1;let c=g.current;l.save(),l.translate(100,c.y),l.rotate(c.rot),l.fillStyle="#facc15",l.beginPath(),l.ellipse(0,0,17,13,0,0,2*Math.PI),l.fill(),l.fillStyle="#f59e0b",l.beginPath(),l.ellipse(-4,c.vy<0?-4:4,9,6,-.4,0,2*Math.PI),l.fill(),l.fillStyle="#fff",l.beginPath(),l.arc(7,-4,4.5,0,2*Math.PI),l.fill(),l.fillStyle="#000",l.beginPath(),l.arc(8.5,-4,2,0,2*Math.PI),l.fill(),l.fillStyle="#fb923c",l.beginPath(),l.moveTo(14,0),l.lineTo(24,3),l.lineTo(14,7),l.closePath(),l.fill(),l.restore(),"idle"!==v.current&&(l.fillStyle="rgba(255,255,255,0.95)",l.font="bold 42px system-ui, sans-serif",l.textAlign="center",l.shadowColor="rgba(0,0,0,0.5)",l.shadowBlur=8,l.fillText(String(y.current),320,64),l.shadowBlur=0),l.restore()},[]),O=(0,n.useRef)(!1),F=(0,n.useCallback)(()=>{O.current||(O.current=!0,j.current=0,N.current=1,L(100,g.current.y,"#facc15",22),(0,i._O)("explode"))},[]),z=(0,n.useCallback)(e=>{let t=Math.min((e-M.current)/1e3,.033);if(M.current=e,"running"===v.current&&j.current<0){let e=g.current;e.vy+=1500*t,e.y+=e.vy*t,e.rot=Math.max(-.5,Math.min(1.2,e.vy/500));let r=I();for(let e of m.current)e.x-=r*t;for(let t of(m.current.length&&m.current[m.current.length-1].x<410&&E(660),m.current=m.current.filter(e=>e.x>-84),m.current)){if(!t.passed&&t.x+64<83){t.passed=!0;let r=t.golden?3:1;y.current+=r,f(y.current),L(100,e.y,t.golden?"#fbbf24":"#4ade80",t.golden?14:6),t.golden?(_.current("✨ GOLDEN +3","text-yellow-300"),(0,i._O)("combo")):(t.gap/2-Math.abs(e.y-t.gapY)-11<18&&_.current("⚡ CLOSE!","text-cyan-300"),(0,i._O)("score")),y.current>=C.current&&(_.current("\uD83C\uDFC1 ".concat(C.current,"!"),"text-amber-300"),(0,i._O)("clear"),C.current+=10)}let r=114>t.x&&86<t.x+64,l=e.y-11>t.gapY-t.gap/2&&e.y+11<t.gapY+t.gap/2;if(r&&!l){F();break}}(e.y>455||e.y<11)&&F()}else if("running"===v.current&&j.current>=0){j.current+=1e3*t;let e=g.current;e.vy+=1500*t,e.y=Math.min(455,e.y+e.vy*t),e.rot=Math.min(1.6,e.rot+5*t),j.current>700&&(r("over"),p(y.current),(0,c.q7)("flappy-wings",y.current))}Y(t),w.current=requestAnimationFrame(z)},[Y,F]);(0,n.useEffect)(()=>(M.current=performance.now(),w.current=requestAnimationFrame(z),()=>cancelAnimationFrame(w.current)),[z]);let B=(0,n.useCallback)(()=>{g.current={y:240,vy:-420,rot:0},m.current=[],b.current=[],R.current=0,C.current=10,j.current=-1,N.current=0,E(740),y.current=0,O.current=!1,f(0),r("running")},[]),G=(0,n.useCallback)(()=>{if("running"===v.current&&j.current<0){g.current.vy=-420;for(let e=0;e<3;e++)b.current.push({x:92+8*Math.random(),y:g.current.y+10,vx:-40-40*Math.random(),vy:60+50*Math.random(),life:.3,color:"rgba(255,255,255,0.7)"});(0,i._O)("flap")}else"idle"===v.current&&B()},[B]);return(0,n.useEffect)(()=>{let e=e=>{if("Space"===e.code||"ArrowUp"===e.key){if(e.preventDefault(),"over"===v.current)return;G()}("Space"===e.code||"Enter"===e.key)&&"over"===v.current&&(e.preventDefault(),B())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[G,B]),(0,l.jsxs)("div",{className:"select-none",children:[(0,l.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsxs)("div",{className:"rounded-xl bg-white/10 px-4 py-2 text-center",children:[(0,l.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-zinc-400",children:"Score"}),(0,l.jsx)("div",{className:"text-xl font-bold text-white",children:s})]}),(0,l.jsxs)("div",{className:"rounded-xl bg-white/10 px-4 py-2 text-center",children:[(0,l.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-zinc-400",children:"Best"}),(0,l.jsx)("div",{className:"text-xl font-bold text-amber-300",children:x})]})]}),(0,l.jsx)("button",{onClick:B,className:"rounded-xl bg-gradient-to-r from-amber-500 to-orange-500 px-4 py-2 font-bold text-white transition hover:scale-105",children:"running"===t?"Restart":"Start"})]}),(0,l.jsxs)("div",{"data-board":!0,className:"relative mx-auto w-full touch-none overflow-hidden rounded-2xl border border-white/10",style:{maxWidth:"min(100%, calc(82vh * 1.333))"},onPointerDown:e=>{e.preventDefault(),"over"!==v.current&&G()},role:"application","aria-label":"Flappy Wings game. Tap or press space to flap.",children:[(0,l.jsx)("canvas",{ref:e,width:640,height:480,className:"block h-auto w-full"}),(0,l.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-[22%] z-10 flex flex-col items-center gap-1",children:d.map(e=>(0,l.jsx)("div",{className:"animate-bounce-in text-xl font-extrabold drop-shadow-[0_2px_4px_rgba(0,0,0,0.8)] sm:text-2xl ".concat(e.cls),children:e.text},e.id))}),"running"!==t&&(0,l.jsxs)("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-4 bg-black/60 backdrop-blur-[2px]",children:["over"===t?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"animate-bounce-in text-3xl font-extrabold text-white",children:"\uD83D\uDCA5 Ouch!"}),(0,l.jsxs)("p",{className:"text-zinc-200",children:["Score: ",(0,l.jsx)("span",{className:"font-bold text-white",children:s}),s>0&&s>=x&&(0,l.jsx)("span",{className:"ml-2 font-bold text-amber-300",children:"New best
1!"})]})]}):(0,l.jsx)("p",{className:"animate-float text-5xl","aria-hidden":!0,children:"\uD83D\uDC24"}),(0,l.jsx)("button",{onClick:e=>{e.stopPropagation(),B()},className:"rounded-xl bg-gradient-to-r from-amber-500 to-orange-500 px-6 py-3 font-bold text-white transition hover:scale-105",children:"over"===t?"Try again":"▶ Tap to fly"})]})]}),(0,l.jsx)("p",{className:"mt-4 text-center text-sm text-zinc-500",children:"⌨️ Space / ↑ to flap \xb7 \uD83D\uDCF1 Tap anywhere \xb7 ✨ golden pipes pay +3"})]})}}}]);

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.