PageSourceSearch

https://metool.online/_assets/js/dinoGame.DQFbkA02.js

js metool.online collected 2026-10-04 19:06:19 UTC 23,305 bytes, 2 lines download raw bytes

1/* © 2024-2026 MeTool.online. All rights reserved. Unauthorized copying or redistribution is prohibited. */
2import{G as wt,a as Ct}from"./GameShareDialog.BcU-hiee.js";import{d as ot,o as Tt,I as bt,q as Z,v as N,y as s,F as St,P as d,G as ae,J as R,B as M,C as _,c as Y,z as ie,a1 as Ke,A as Dt,e as D,f as w,E as Gt}from"./vue.BHwQAC8Z.js";import{G as At}from"./GameShareIconButton.MaXfr9Av.js";import{u as Zt}from"./composables.Ke7ssj2i.js";import{f as nt,_ as Ot,r as It,o as Et,y as Bt,C as Nt}from"./entry.q2vg8f26.js";import"./AppSiteFooterBar.DaI0tcoG.js";import"./ToolBreadcrumb.W6i9Er2k.js";import"./AppIcon.kB3f-rsX.js";import"./iconLibrary.DB9GK0r4.js";import"./FavoriteStarButton.DO1P1yzW.js";import"./useUserLibrary.GGsQQArI.js";import"./useFeedback.Dr-ufl2w.js";import"./FeedbackBoard.Cymm3wDa.js";import"./McpRobotBadge.BEno9mQJ.js";import"./enabledPages.generated.XTfMY2ra.js";import"./FeedbackItem.CJlWzvMS.js";import"./FeedbackStatusBadge.C241fylf.js";import"./useToolPageRef.DiCFXJE6.js";import"./useToolGa4.HZ1kdNPy.js";import"./useToolGroup.D6DXaJBJ.js";import"./useGameTools.Cea25uJs.js";import"./useImageTools.DnXsyVeV.js";import"./useMagicTools.CMgTWyzO.js";import"./useDocTools.M0St8VTC.js";import"./brandSvgs.3qwNwPst.js";
2import"./useMarkdownTools.MAZnT9yn.js";import"./use3DTools.B2gNq-E_.js";import"./useDevTools.Du8khQc-.js";import"./useVideoTools.wfF_hwIl.js";import"./useAISkillTools.DxAcHgjm.js";import"./useLatexTools.CNuf4UvK.js";import"./useHtmlTools.eon9ygLT.js";import"./datetime.BZOVVxYr.js";import"./FeedbackFlowDiagram.x0-i03m6.js";import"./FeedbackSubmitForm.CWaGJF1f.js";import"./ImagePreviewModal.hZok-81e.js";import"./TurnstileWidget.CKVAXgA9.js";import"./cosFeedbackUpload.DAGAjSUC.js";import"./AuthLoginPanel.6BO_3-aa.js";import"./useReadQueryParam.d9oDta5j.js";import"./safeRedirect.ChHJvCig.js";import"./ToolFAQSection.DnMByl9i.js";import"./ToolArticleSection.C-jF13aY.js";import"./ArticleImageLightbox.BBWuunJm.js";import"./useShareChain.DAaPApmT.js";import"./ToolRelatedArticlesSection.CqA7QVWD.js";import"./BlogCard.LzNShGVa.js";import"./useBlog.Berx1qpe.js";import"./_index.generated.Cngq438q.js";import"./useRelatedTools.DFXR-u5P.js";import"./useGameShare.BhlITz07.js";import"./browser.DhZUQ6or.js";const Pt={class:"flex flex-col h-full select-none"},Ut={class:"absolute top-3 right-4 pointer-events-none z-10 flex items-center gap-3"},Wt={key:0,class:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},jt={key:1,class:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},qt={class:"text-center px-4"},zt={key:0,class:"absolute inset-0 hidden landscape:flex flex-col items-center justify-center gap-2 pointer-events-none"},Ht={class:"text-center px-4"},Xt={class:"text-sm font-bold tracking-widest uppercase opacity-70"},Vt={class:"text-sm font-bold tracking-widest uppercase opacity-70"},A=450,p=338,Me=.45,v=.5343,Yt="M169.895,88.699C167.27,71.887 152.695,58.984 135.156,58.984C128.559,58.984 122.219,60.809 116.719,64.215C108.355,50.156 93.293,41.406 76.563,41.406C50.715,41.406 29.688,62.434 29.688,88.281C29.688,88.441 29.688,88.609 29.691,88.766C13.082,91.566 0,106.047 0,123.438C0,142.824 16.16,158.594 35.547,158.594L164.453,158.594C183.84,158.594 200,142.824 200,123.438C200,105.898 186.707,91.324 169.895,88.699Z",Ft="M57.449,111.191L85.246,111.191L85.246,200.145L118.605,200.145L118.605,137.137L142.695,137.137C149.859,137.137 155.668,131.328 155.668,124.164L155.668,59.301C155.668,52.137 149.859,46.328 142.695,46.328C135.531,46.328 129.723,52.137 129.723,59.301L129.723,111.191L118.605,111.191L118.605,16.68C118.605,7.469 111.137,0 101.926,0C92.715,0 85.246,7.469 85.246,16.68L85.246,85.246L70.422,85.246L70.422,37.063C70.422,29.898 64.613,24.09 57.449,24.09C50.285,24.09 44.477,29.898 44.477,37.063L44.477,98.219C44.477,105.383 50.285,111.191 57.449,111.191Z",Kt="M93.027,18.996L173.41,18.996L173.41,60.836L93.027,60.836ZM99.27,14.727L167.168,14.727L167.168,56.57L99.27,56.57ZM93.027,37.715L127.531,37.715L127.531,79.555L93.027,79.555ZM93.027,71.113L153.223,71.113L153.223,79.555L93.027,79.555ZM107.113,25.676L115.113,25.676L115.113,33.676L107.113,33.676ZM93.027,37.715L120.188,37.715L120.188,122.5L93.027,122.5ZM93.027,98.848L136.707,98.848L136.707,107.289L93.027,107.289ZM130.098,99.008L136.707,99.008L136.707,114.422L130.098,114.422ZM86.629,84.328L113.789,84.328L113.789,137.914L86.629,137.914ZM73.828,91.793L105.762,91.793L105.762,145.379L73.828,145.379ZM63.16,99.262L90.324,99.262L90.324,152.848L63.16,152.848ZM64.953,106.727L79.656,106.727L79.656,160.313L64.953,160.313ZM86.629,106.727L96.539,106.727L96.539,160.313L86.629,160.313ZM91.031,106.727L96.539,106.727L96.539,185.273L91.031,185.273ZM91.031,179.766L106.082,179.766L106.082,185.273L91.031,185.273ZM63.301,106.727L68.805,106.727L68.805,170.59L63.301,170.59ZM63.301,165.086L78.348,165.086L78.348,170.59L63.301,170.59ZM54.285,106.727L68.988,106.727L68.988,153.566L54.285,153.566ZM45.695,106.727L58.324,106.727L58.324,146.301L45.695,146.301ZM39.293,99.25L49.789,99.25L49.789,137.766L39.293,137.766ZM31.828,91.781L42.324,91.781L42.324,130.301L31.828,130.301ZM26.59,84.316L32.723,84.316L32.723,122.832L26.59,122.832Z",Jt="M93.027,18.996L173.41,18.996L173.41,60.836L93.027,60.836ZM99.27,14.727L167.168,14.727L167.168,56.57L99.27,56.57ZM93.027,37.715L127.531,37.715L127.531,79.555L93.027,79.555ZM93.027,71.113L153.223,71.113L153.223,79.555L93.027,79.555ZM107.113,25.676L115.113,25.676L115.113,33.676L107.113,33.676ZM93.027,37.715L120.188,37.715L120.188,122.5L93.027,122.5ZM93.027,98.848L136.707,98.848L136.707,107.289L93.027,107.289ZM130.098,99.008L136.707,99.008L136.707,114.422L130.098,114.422ZM86.629,84.328L113.789,84.328L113.789,137.914L86.629,137.914ZM73.828,91.793L105.762,91.793L105.762,145.379L73.828,145.379ZM63.16,99.262L90.324,99.262L90.324,152.848L63.16,152.848ZM64.953,106.727L79.656,106.727L79.656,160.313L64.953,160.313ZM86.629,106.727L96.539,106.727L96.539,160.313L86.629,160.313ZM91.031,106.727L96.539,106.727L96.539,165.273L91.031,165.273ZM91.031,164.766L106.082,164.766L106.082,170.273L91.031,170.273ZM63.301,106.727L68.805,106.727L68.805,185.59L63.301,185.59ZM63.301,187.086L78.348,187.086L78.348,180.59L63.301,180.59ZM54.285,106.727L68.988,106.727L68.988,153.566L54.285,153.566ZM45.695,106.727L58.324,106.727L58.324,146.301L45.695,146.301ZM39.293,99.25L49.789,99.25L49.789,137.766L39.293,137.766ZM31.828,91.781L42.324,91.781L42.324,130.301L31.828,130.301ZM26.59,84.316L32.723,84.316L32.723,122.832L26.59,122.832Z",Je=26.59,$t=173.41,Qt=14.727,ke=185.273,$e=44.477,X=155.668,_e=200.145,eo=41.406,we=60,Qe=20,se=3,to=2,oo=120,no=14,et=45,lo=100,ao=3,so=120,V=300,tt=1.2,io=-11,ro=.3,co=1,y=8,uo=80,fo=3,mo=3,po=20,Ce=.68,vo=ot
2({__name:"DinoGame",emits:["ready"],setup(lt,{emit:g}){const F=g,{t:r,locale:Te}=nt(),be=Zt(),C=D(null),K=D(null),re=D(null),f=D("idle"),u=D(0),J=D(0),ce=D(!1),U=D(!0),T=w(()=>be.value==="dark"),Se=w(()=>T.value?"#1a1a1a":"#f8f8f8"),W=w(()=>T.value?"#888":"#535353"),ue=w(()=>T.value?"#aaaaaa":"#535353"),at=w(()=>T.value?"#aaaaaa":"#535353"),st=w(()=>T.value?"#555":"#d8d8d8"),O=w(()=>T.value?"#aaa":"#535353"),fe=w(()=>T.value?"#aaa":"#535353");let b=1,c=800;const it=($t-Je)*v,$=(ke-Qt)*v,rt=200*v,ct=p-$*.33,ut=p-$*1.06,ft=p-$*1.5;function De(){const t=Math.random();return t<.4?ct:t<.7?ut:ft}function me(){return Ge()*60*1.5}const mt=[[6,4,18,4],[32,8,10,3],[58,5,24,3],[88,7,12,4],[116,4,6,3],[138,10,20,3],[164,5,14,4],[190,7,8,3],[218,4,22,4],[248,9,10,3],[270,5,16,4],[292,7,18,3]],I=[120,350,700],S=[[2,3],[3,4],[4,5],[5,6]];function Ge(){let t;if(u.value<I[0]){const o=u.value/I[0];t=S[0][0]+(S[0][1]-S[0][0])*o}else if(u.value<I[1]){const o=(u.value-I[0])/(I[1]-I[0]);t=S[1][0]+(S[1][1]-S[1][0])*o}else{const o=Math.min((u.value-I[1])/200,1);t=S[2][0]+(S[2][1]-S[2][0])*o}return t*c/800}function Ae(t){const o=v*t.scale,e=X*o*Ce;return t.x+X*o+(t.cluster-1)*e}function Ze(){const t=Math.random();return u.value<120?1:u.value<350?t<.6?1:t<.85?3:4:t<.45?1:t<.75?3:4}function Oe(t){return t===1?[1]:Array.from({length:t},()=>E(.6,1.3))}let pe=null,de=null,ve=[];function pt(){pe=new Path2D(Yt),de=new Path2D(Ft),ve=[new Path2D(Kt),new Path2D(Jt)]}let a={x:0,y:0,vy:0,grav:0,jumping:!1,crouching:!1,kf:0,kfc:0},x=[],Q=[],h=[],j=[],ge=!1,Le=!1,ee=0,te=0;function L(t,o){return Math.floor(Math.random()*(o-t+1))+t}function E(t,o){return Math.random()*(o-t)+t}function Ie(){a={x:uo,y:p,vy:0,grav:0,jumping:!1,crouching:!1,kf:0,kfc:0}}function Ee(){x=[];const t=Math.floor(c*.4);let o=c+60;for(let e=0;e<fo;e++){const i=Ze(),m=i===1?E(1,1.3):i===3?E(.7,.9):E(.65,.8);x.push({x:o,scale:m,cluster:i,varScales:Oe(i)}),o+=t+L(0,t)}}function Be(){Q=[];let t=100;for(let o=0;o<mo;o++)Q.push({x:t,y:L(30,Math.floor(p*.35))}),t+=L(Math.floor(c*.25),Math.floor(c*.45))}function dt(){h=[];const t=he()+me(),o=Math.floor(c*.5);let e=Math.max(t,c+o);for(let i=0;i<to;i++)h.push({x:e,y:De(),kf:0,kfc:0}),e+=o+L(0,o);ge=!0}function vt(){j=[];let t=c+L(100,300);for(let o=0;o<ao;o++)j.push({x:t,size:L(14,22),rotation:0}),t+=L(Math.floor(c*.3),Math.floor(c*.6));Le=!0}function he(){const t=x.length?Math.max(...x.map(e=>Ae(e))):0,o=h.length?Math.max(...h.map(e=>e.x+we)):0;return Math.max(t,o,c)}function gt(){return a.crouching?{x:a.x+y,y:a.y-et+y,w:lo-y*2,h:et-y*2}:{x:a.x+Je*v+y,y:a.y-ke*v+y,w:it-y*2,h:$-y*2}}function Lt(t){const o=v*t.scale,e=X*o*Ce,i=(X-$e)*o+(t.cluster-1)*e;return{x:t.x+$e*o+y,y:p-_e*o+y,w:i-y*2,h:_e*o-y*2}}function ht(t){return{x:t.x+se,y:t.y-Qe/2+se,w:we-se*2,h:Qe-se*2}}function Ne(t,o){return t.x<o.x+o.w&&t.x+t.w>o.x&&t.y<o.y+o.h&&t.y+t.h>o.y}let oe=null;function Pe(){return oe||(oe=new AudioContext),oe}function yt(){if(U.value)try{const t=Pe();t.state==="suspended"&&t.resume();const o=t.createOscillator(),e=t.createGain();o.connect(e),e.connect(t.destination),o.type="square",o.frequency.setValueAtTime(440,t.currentTime),o.frequency.exponentialRampToValueAtTime(880,t.currentTime+.08),e.gain.setValueAtTime(.15,t.currentTime),e.gain.exponentialRampToValueAtTime(.001,t.currentTime+.15),o.start(t.currentTime),o.stop(t.currentTime+.15)}catch{}}function xt(){if(U.value)try{const t=Pe();t.state==="suspended"&&t.resume(),[0,.12,.24].forEach((o,e)=>{const i=t.createOscillator(),m=t.createGain();i.connect(m),m.connect(t.destination),i.type="square",i.frequency.value=[330,262,196][e]??196,m.gain.setValueAtTime(.15,t.currentTime+o),m.gain.exponentialRampToValueAtTime(.001,t.currentTime+o+.1),i.start(t.currentTime+o),i.stop(t.currentTime+o+.1)})}catch{}}let q=0;function Ue(){if(f.value!=="playing")return;a.y+=a.vy,a.vy+=a.grav,a.y>=p&&(a.y=p,a.vy=0,a.grav=0,a.jumping=!1),a.jumping||(a.kfc++,a.kfc>=po&&(a.kfc=0,a.kf^=1)),ee++,ee>=2&&(ee=0,u.value=u.value+.1),!ge&&u.value>=oo&&dt(),!Le&&u.value>=so&&vt();
2const t=Ge();te=(te+t)%V;for(const e of x)e.x-=t;if(x.length&&Ae(x[0])<0){x.shift();const e=Math.floor(c*.35),m=he()+me()+L(0,e),P=Ze(),Re=P===1?E(1,1.3):P===3?E(.7,.9):E(.65,.8);x.push({x:m,scale:Re,cluster:P,varScales:Oe(P)})}for(const e of h)e.x-=t,e.kfc++,e.kfc>=no&&(e.kfc=0,e.kf^=1);if(h.length&&(h[0]?.x??0)+we<0){h.shift();const e=Math.floor(c*.4),i=he()+me();h.push({x:i+L(0,e),y:De(),kf:0,kfc:0})}for(const e of j)e.x-=t,e.rotation+=t*.06,e.x+e.size*2<0&&(e.x=c+L(200,400),e.size=L(14,22),e.rotation=0);for(const e of Q)e.x-=co,e.x+rt<0&&(e.x=c+L(0,200),e.y=L(30,Math.floor(p*.35)));const o=gt();for(const e of x)if(Ne(o,Lt(e))){je();return}for(const e of h)if(Ne(o,ht(e))){je();return}ye(),q=requestAnimationFrame(Ue)}function We(){const t=C.value;if(!t)return;const o=t.height*Me/A,e=Math.round((t.height-A*o)/2),i=Math.round(A*o),m=document.createElement("canvas");m.width=i,m.height=i,m.getContext("2d")?.drawImage(t,0,e,i,i,0,0,i,i),re.value=m}function je(){f.value="over",u.value>J.value&&(J.value=u.value),xt(),We(),ye(!0),cancelAnimationFrame(q)}function ye(t=!1){const o=C.value;if(!o||!pe||!de||!ve.length)return;const e=o.getContext("2d");if(!e)return;const i=o.width,m=o.height;b=m*Me/A,c=i/b;const P=(m-A*b)/2;e.fillStyle=Se.value,e.fillRect(0,0,i,m),e.save(),e.translate(0,P),e.scale(b,b),e.strokeStyle=st.value,e.lineWidth=1.5/v;for(const n of Q)e.save(),e.translate(n.x,n.y-eo*v),e.scale(v,v),e.stroke(pe),e.restore();e.strokeStyle=W.value,e.lineWidth=3/b,e.beginPath(),e.moveTo(0,p),e.lineTo(c,p),e.stroke(),e.fillStyle=W.value;const Re=te%V;for(const[n,l,H,k]of mt){let B=(n-Re+V)%V;for(;B<c;)e.fillRect(B,p+l,H,k),B+=V}e.fillStyle=at.value;for(const n of x){const l=v*n.scale,H=X*l*Ce;for(let k=0;k<n.cluster;k++){const B=(n.varScales[k]??1)*l;e.save(),e.translate(n.x+k*H,p-_e*B),e.scale(B,B),e.fill(de),e.restore()}}if(e.fillStyle=ue.value,a.crouching){const n=a.x,l=p;e.fillRect(n+0,l-45,3,3),e.fillRect(n+69,l-45,33,3),e.fillRect(n+0,l-42,12,3),e.fillRect(n+27,l-42,33,3),e.fillRect(n+69,l-42,33,3),e.fillRect(n+0,l-39,75,3),e.fillRect(n+78,l-39,24,3),e.fillRect(n+0,l-36,102,3),e.fillRect(n+3,l-33,99,3),e.fillRect(n+6,l-30,96,3),e.fillRect(n+9,l-27,93,3),e.fillRect(n+12,l-24,90,3),e.fillRect(n+15,l-21,72,3),e.fillRect(n+18,l-18,45,3),e.fillRect(n+69,l-18,27,3),e.fillRect(n+21,l-15,42,3),e.fillStyle="#fff",e.fillRect(n+75,l-39,3,3),e.fillStyle=ue.value,a.kf===0?(e.fillRect(n+21,l-12,3,3),e.fillRect(n+30,l-12,15,3),e.fillRect(n+54,l-12,6,3),e.fillRect(n+21,l-9,6,3),e.fillRect(n+30,l-9,12,3),e.fillRect(n+54,l-9,9,3),e.fillRect(n+21,l-6,6,3),e.fillRect(n+30,l-6,9,3),e.fillRect(n+30,l-3,6,3)):(e.fillRect(n+21,l-12,6,3),e.fillRect(n+30,l-12,15,3),e.fillRect(n+54,l-12,3,3),e.fillRect(n+21,l-9,6,3),e.fillRect(n+30,l-9,12,3),e.fillRect(n+54,l-9,6,3),e.fillRect(n+21,l-6,6,3),e.fillRect(n+30,l-6,9,3),e.fillRect(n+21,l-3,6,3))}else{const n=ve[a.kf];n&&(e.save(),e.translate(a.x,a.y-ke*v),e.scale(v,v),e.fill(n),e.restore())}e.fillStyle=ue.value;for(const n of h)e.save(),e.translate(n.x,n.y),e.scale(tt,tt),n.kf===0?(e.fillRect(21,-20,2,3),e.fillRect(21,-17,5,3),e.fillRect(21,-14,8,2),e.fillRect(23,-12,5,1),e.fillRect(23,-11,8,2),e.fillRect(23,-9,9,1),e.fillRect(23,-8,12,3),e.fillRect(23,-5,14,3),e.fillRect(23,-2,17,2),e.fillRect(0,0,40,2),e.fillRect(12,-11,5,2),e.fillRect(12,-9,5,1),e.fillRect(10,-8,8,3),e.fillRect(7,-5,14,3),e.fillRect(4,-2,17,2),e.fillRect(18,2,23,1),e.fillRect(18,3,26,2),e.fillRect(21,5,23,1),e.fillRect(21,6,39,3),e.fillRect(23,9,29,3),e.fillRect(26,12,31,1),e.fillRect(29,14,20,3),e.fillRect(24,2,6,8),e.fillRect(32,2,6,8)):(e.fillRect(11,-11,6,3),e.fillRect(9,-9,9,3),e.fillRect(6,-6,14,3),e.fillRect(3,-3,17,3),e.fillRect(0,0,40,3),e.fillRect(17,3,26,3),e.fillRect(20,6,40,3),e.fillRect(23,9,31,3),e.fillRect(23,11,34,3),e.fillRect(23,14,29,3),e.fillRect(23,17,14,3),e.fillRect(23,20,11,3),e.fillRect(23,23,9,3),e.fillRect(23,26,6,6),e.fillRect(24,3,6,8),e.fillRect(32,3,6,8)),e.restore();e.strokeStyle=W.value;for(const n of j){const l=n.x+n.size,H=p-n.size;e.save(),e.translate(l,H),e.rotate(n.rotation),e.lineWidth=1.2/b;
2for(let k=0;k<5;k++)e.save(),e.rotate(k*Math.PI/5),e.beginPath(),e.ellipse(0,0,n.size,n.size*.32,0,0,Math.PI*2),e.stroke(),e.restore();e.restore()}t&&(e.fillStyle=T.value?"rgba(0,0,0,0.5)":"rgba(255,255,255,0.5)",e.fillRect(0,0,c,A),e.fillStyle=T.value?"#fff":"#222",e.font="bold 32px monospace",e.textAlign="center",e.letterSpacing="6px",e.fillText(r("pages.games.dinoGame.gameOver"),c/2,A*.42),e.letterSpacing="0px"),e.restore()}function Rt(){f.value==="idle"?G():f.value==="playing"&&ne()}function ne(){a.crouching||!a.jumping&&a.y>=p&&(a.jumping=!0,a.vy=io,a.grav=ro,yt())}function z(){f.value==="playing"&&(a.jumping||(a.crouching=!0))}function le(){a.crouching=!1}function qe(){if(f.value==="idle"){G();return}f.value==="playing"&&ne()}function ze(){if(f.value==="idle"){G();return}f.value==="playing"&&z()}function Mt(){le()}function G(){const t=C.value;t&&(Ye(t),u.value=0,ee=0,ge=!1,Le=!1,h=[],j=[],te=0,Ie(),Ee(),Be(),f.value="playing",cancelAnimationFrame(q),q=requestAnimationFrame(Ue))}function kt(){re.value=null,G()}function He(){const t=f.value==="over";ce.value=!1,t&&kt()}const _t=w(()=>({gameName:r("meta.games.dinoGame.shortName"),gameEmoji:"🦖",isWin:!1,playerTitle:u.value>=400?r("pages.games.dinoGame.playerTitleLegend"):u.value>=200?r("pages.games.dinoGame.playerTitleRunner"):r("pages.games.dinoGame.playerTitleEgg"),heroTitle:r("pages.games.dinoGame.heroTitle"),primaryLabel:r("pages.games.dinoGame.primaryLabel"),primaryValue:String(Math.floor(u.value)),bestLabel:r("pages.games.dinoGame.bestLabel"),bestValue:String(Math.floor(J.value)),secondaryStats:[],shareText:r("pages.games.dinoGame.shareText").replace("{score}",String(Math.floor(u.value))),gameTagline:r("pages.games.dinoGame.gameTagline")}));function Xe(t){(t.code==="Space"||t.code==="ArrowUp")&&(t.preventDefault(),Rt()),t.code==="ArrowDown"&&(t.preventDefault(),z())}function Ve(t){t.code==="ArrowDown"&&le()}let xe=null;function Ye(t){const o=window.devicePixelRatio||1;t.width=Math.floor(t.clientWidth*o),t.height=Math.floor(t.clientHeight*o),b=t.height*Me/A,c=t.width/b}function Fe(){const t=C.value;t&&(Ye(t),Ie(),Ee(),Be(),ye())}return Tt(()=>{pt(),Fe(),window.addEventListener("keydown",Xe),window.addEventListener("keyup",Ve),xe=new ResizeObserver(()=>{f.value!=="playing"&&Fe()}),K.value&&xe.observe(K.value),F("ready")}),bt(()=>{cancelAnimationFrame(q),window.removeEventListener("keydown",Xe),window.removeEventListener("keyup",Ve),xe?.disconnect(),oe?.close()}),(t,o)=>(Z(),N("div",Pt,[s("div",{ref_key:"gameAreaRef",ref:K,class:"h-[55vw] landscape:flex-1 landscape:min-h-0 relative overflow-hidden"},[s("canvas",{ref_key:"canvasRef",ref:C,class:"block w-full h-full"},null,512),f.value==="playing"?(Z(),N(St,{key:0},[s("div",{class:"absolute inset-x-0 top-0 z-[5] hidden landscape:block",style:{height:"60%"},onClick:d(ne,["stop"]),onTouchstart:d(ne,["prevent","stop"])},null,32),s("div",{class:"absolute inset-x-0 bottom-0 z-[5] hidden landscape:block",style:{height:"40%"},onClick:d(z,["stop"]),onTouchstart:d(z,["prevent","stop"]),onTouchend:d(le,["prevent","stop"]),onMousedown:d(z,["stop"]),onMouseup:d(le,["stop"])},null,32)],64)):ae("",!0),f.value==="idle"?(Z(),N("div",{key:1,class:"absolute inset-0 z-[5] hidden landscape:block cursor-pointer",onClick:d(G,["stop"]),onTouchstart:d(G,["prevent","stop"])},null,32)):ae("",!0),s("div",Ut,[s("span",{class:"font-mono text-sm font-bold",style:R({color:fe.value})},M(_(r)("pages.games.dinoGame.titleHi"))+" "+M(String(Math.floor(J.value)).padStart(5,"0")),5),s("span",{class:"font-mono text-sm font-bold",style:R({color:fe.value})},M(String(Math.floor(u.value)).padStart(5,"0")),5)]),s("div",{class:"absolute top-3 left-3 z-20",onClick:o[1]||(o[1]=d(()=>{},["stop"]))},[Y(At,{"theme-class":"bg-black/20 text-slate-700 dark:text-white/80 hover:bg-black/30",onClick:o[0]||(o[0]=()=>{We(),ce.value=!0})})]),s("button",{class:"absolute top-3 left-14 z-20 w-10 h-10 flex items-center justify-center rounded-full bg-black/20 hover:bg-black/30 transition",style:R({color:fe.value}),onClick:o[2]||(o[2]=d(e=>U.value=!U.value,["stop"]))},[U.value?(Z(),N("svg",Wt,[...o[4]||(o[4]=[s("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},null,-1),s("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"},null,-1)])])):(Z(),N("svg",jt,[...o[5]||(o[5]=[s("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},null,-1),s("line",{x1:"23",y1:"9",x2:"17",y2:"15"},null,-1),s("line",{x1:"17",y1:"9",x2:"23",y2:"15"},null,-1)])]))],4),Y(Ke,{name:"dino-overlay"},{default:ie(()=>[f.value==="idle"?(Z(),N("div",{key:0,class:"absolute inset-0 landscape:hidden flex flex-col items-center justify-center gap-2 cursor-pointer",onClick:G,onTouchstart:d(G,["prevent"])},[s("div",qt,[s("div",{class:"font-black text-2xl tracking-tight",style:R({color:O.value})},M(_(r)("pages.games.dinoGame.tapToStart")),5),s("div",{class:"mt-1 text-sm opacity-60",style:R({color:O.value})},M(_(r)("pages.games.dinoGame.spaceOrTap")),5)])],32)):ae("",!0)]),_:1}),Y(Ke,{name:"dino-overlay"},{default:ie(()=>[f.value==="idle"?(Z(),N("div",zt,[s("div",Ht,[s("div",{class:"font-black text-2xl tracking-tight",style:R({color:O.value})},M(_(r)("pages.games.dinoGame.tapToStart")),5),s("div",{class:"mt-1 text-sm opacity-60",style:R({color:O.value})},M(_(r)("pages.games.dinoGame.spaceOrTap")),5),s("div",{class:"mt-2 text-xs opacity-40",style:R({color:O.value})},M(_(r)("pages.games.dinoGame.tapZoneHint")),5)])])):ae("",!0)]),_:1})],512),s("div",{class:"flex landscape:hidden flex-1 flex-col items-center justify-center gap-4 px-6 py-6",style:R({background:Se.value})},[s("button",{class:"w-full max-w-sm flex-1 rounded-3xl flex flex-col items-center justify-center gap-2 transition-all active:scale-[0.97] mobile-btn",style:R({color:O.value,borderColor:W.value}),onTouchstart:d(qe,["prevent"]),onClick:qe},[o[6]||(o[6]=s("svg",{class:"w-8 h-8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[s("polyline",{points:"18 15 12 9 6 15"}
2)],-1)),s("span",Xt,M(_(r)("pages.games.dinoGame.btnJump")),1)],36),s("button",{class:"w-full max-w-sm flex-1 rounded-3xl flex flex-col items-center justify-center gap-2 transition-all active:scale-[0.97] mobile-btn",style:R({color:O.value,borderColor:W.value}),onTouchstart:d(ze,["prevent"]),onTouchend:d(Mt,["prevent"]),onClick:ze},[o[7]||(o[7]=s("svg",{class:"w-8 h-8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[s("polyline",{points:"6 9 12 15 18 9"})],-1)),s("span",Vt,M(_(r)("pages.games.dinoGame.btnDuck")),1)],36)],4),Y(wt,{show:f.value==="over"||ce.value,achievement:_t.value,"thumbnail-source":re.value??C.value,onClose:He},{actions:ie(()=>[s("button",{class:"inline-flex items-center gap-1.5 px-5 py-2 rounded-xl text-sm font-bold transition-all active:scale-95 bg-slate-800 text-white hover:bg-slate-700 shadow-lg",onClick:o[3]||(o[3]=e=>He())},[o[8]||(o[8]=s("svg",{class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[s("polyline",{points:"1 4 1 10 7 10"}),s("path",{d:"M3.51 15a9 9 0 1 0 .49-4.9"})],-1)),Dt(" "+M(_(r)("pages.games.dinoGame.retry")),1)])]),_:1},8,["show","achievement","thumbnail-source"])]))}}),go=Object.assign(Ot(vo,[["__scopeId","data-v-f890cab2"]]),{__name:"GamesDinoGame"}),gn=ot({__name:"dinoGame",setup(lt){const{t:g}=nt(),F=D(!1);It({title:g("meta.games.dinoGame.title"),description:g("meta.games.dinoGame.description"),keywords:g("meta.games.dinoGame.keywords")});const r=[{question:g("pages.games.dinoGame.faq1q"),answer:g("pages.games.dinoGame.faq1a")},{question:g("pages.games.dinoGame.faq2q"),answer:g("pages.games.dinoGame.faq2a")},{question:g("pages.games.dinoGame.faq3q"),answer:g("pages.games.dinoGame.faq3a")}],{steps:Te}=Et("games/dinoGame");return Bt({name:g("meta.games.dinoGame.title"),description:g("meta.games.dinoGame.description"),category:"GameApplication",howToSteps:w(()=>Nt(Te.value)),faqs:r}),(be,C)=>(Z(),Gt(Ct,{"tool-id":"dinoGame",title:_(g)("meta.games.dinoGame.shortName"),faqs:r,"is-ready":F.value,"game-bg-class":"bg-[#f8f8f8] dark:bg-[#1a1a1a]"},{default:ie(()=>[Y(go,{class:"flex-1 min-h-0",onReady:C[0]||(C[0]=K=>F.value=!0)})]),_:1},8,["title","is-ready"]))}});export{gn 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.