From b7af626273d20356fd3c777d66a0510c1df3ded1 Mon Sep 17 00:00:00 2001 From: 0xjaqbek Date: Fri, 26 Jul 2024 15:12:57 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=200xjaqbek?= =?UTF-8?q?/twa@c086f06c45cad3ae321ba709fa8ed0e260e9da74=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/{index-069b4c75.js => index-9e4ecd0a.js} | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename assets/{index-069b4c75.js => index-9e4ecd0a.js} (99%) diff --git a/assets/index-069b4c75.js b/assets/index-9e4ecd0a.js similarity index 99% rename from assets/index-069b4c75.js rename to assets/index-9e4ecd0a.js index 570eae4..5d88d2d 100644 --- a/assets/index-069b4c75.js +++ b/assets/index-9e4ecd0a.js @@ -2856,7 +2856,7 @@ Values: max-width: 400px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); text-align: center; -`,TN=({elapsedTime:e,onClose:t,userId:r,firstName:n,userName:a,lastName:i})=>{const o=II(!0),[s,l]=dt.useState([]),[u,c]=dt.useState(0),[h,f]=dt.useState(!1);dt.useState(!1);const p=3;dt.useEffect(()=>{(async()=>{const oe=await wre();l(oe)})()},[]);const y=async()=>{f(!0)},b=async()=>{try{if(!r&&!o){alert("Please connect your wallet.");return}const V={address:o||"",time:e,playerId:r||o||"",userName:a||""},oe=s.find(j=>j.address===o||j.playerId===(r||o));if(oe)if(e_.address===o||_.playerId===(r||o)?V:_);l(j),await zC(j),console.log(`Wallet Address: ${o}`),console.log(`Elapsed Time: ${e.toFixed(3)} seconds`),console.log(`User ID: ${r}`),console.log(`User Name: ${a}`),console.log(`User First Name: ${n}`)}else{const j=(e-oe.time).toFixed(3);alert(`You were slower by ${j} seconds than your best.`)}else{const j=[...s,V];l(j),await zC(j),console.log(`Wallet Address: ${o}`),console.log(`Elapsed Time: ${e.toFixed(3)} seconds`),console.log(`User ID: ${r}`),console.log(`User Name: ${a}`),console.log(`User First Name: ${n}`)}f(!1)}catch(V){console.error("Error saving score:",V)}},S=V=>{const oe=V.reduce((_,v)=>((!_[v.address||v.playerId]||_[v.address||v.playerId].time>v.time)&&(_[v.address||v.playerId]=v),_),{});return Object.values(oe).sort((_,v)=>_.time-v.time)},x=(V,oe)=>oe||(V.length<=9?V:`${V.slice(0,5)}...${V.slice(-4)}`),E=()=>{c(V=>V+1)},A=()=>{c(V=>Math.max(V-1,0))},P=()=>{f(!1)},D=S(s),U=D.slice(u*p,(u+1)*p),H=async()=>{try{console.log("OnChain Race clicked"),console.log(`Wallet Address: ${o}`),console.log(`User ID: ${r}`),console.log(`User Name: ${a}`),console.log(`Elapsed Time: ${e.toFixed(3)} seconds`),await xue(o,e)}catch(V){console.error("Error during OnChain Race:",V)}},Z=async()=>{try{if(!o){alert("Please connect your wallet.");return}const V=await Ng({network:"testnet"}),oe=new Qa.TonClient({endpoint:V}),j=Qa.Address.parse("kQDW1VLFvS3FJW5rl2tyNfQ-mOfN5nPYGPAHh1vueJsRywwm");await AN(oe,j)}catch(V){console.error("Error during OnChain Race Data retrieval:",V)}};return Ur(kue,{children:[Ur(Eue,{children:[e>0&&Ur(H0,{children:[Ur(Mue,{style:{marginBottom:"20px"},children:["Your current time:",Xe("br",{}),e.toFixed(3)," seconds"]}),Xe(_0,{children:Xe(Vi,{onClick:y,style:{marginBottom:"10px"},children:"Save Score"})})]}),Xe("h1",{style:{color:"white"},children:"Top"}),Xe(_0,{children:u>0&&Xe(x0,{onClick:A,children:"Previous"})}),Xe(Aue,{children:U.map((V,oe)=>Ur(Tue,{children:[u*p+oe+1,". ",x(V.address,V.userName)," - ",V.time.toFixed(3)," seconds"]},oe))}),Xe(_0,{children:(u+1)*p{const[t,r]=dt.useState(!1),[n,a]=dt.useState(!1),[i,o]=dt.useState(0),[s,l]=dt.useState(!1),u=()=>{r(!0),a(!1)},c=()=>{a(!0),r(!1)},h=()=>{r(!1),a(!1)};return dt.useEffect(()=>{let f,p;const y=()=>{f=setInterval(()=>{o(b=>b===8?(l(!0),clearInterval(f),p=setTimeout(()=>{l(!1),o(0),y()},800),b):b+1)},300)};return t&&y(),()=>{clearInterval(f),clearTimeout(p)}},[t]),Ur("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999,fontSize:"0.8rem"},children:[Ur("div",{style:{backgroundColor:"black",padding:"20px",borderRadius:"10px",maxWidth:"80%",textAlign:"center",fontSize:"0.7rem"},children:[Ur("h1",{style:{textShadow:"5px 5px rgba(255, 255, 255, 0.5)",fontSize:"1.2rem",padding:"15px"},children:["Tap",Xe("br",{}),"Race",Xe("br",{}),"Sprint"]}),Xe("br",{}),Ur("div",{style:{display:"flex",flexDirection:"column",gap:"10px",alignItems:"center"},children:[Xe(Vi,{onClick:u,children:"Instructions"}),Xe("br",{}),Xe(Vi,{onClick:c,children:"Leaderboard"}),Xe("br",{}),Xe(Vi,{onClick:e,children:"Start Game"}),Xe("br",{})]}),t&&Xe("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:Ur("div",{style:{backgroundColor:"black",padding:"20px",borderRadius:"10px",maxWidth:"80%",textAlign:"center",fontSize:"0.7rem"},children:[Xe("h2",{style:{fontSize:"1.0rem"},children:"How to play:"}),Ur("ol",{style:{fontSize:"0.6rem"},children:[Xe("li",{children:"Click on the car image to move forward."}),Xe("br",{}),Xe("li",{children:"Every 10 clicks will reveal the gear that disables clicking on the car."}),Xe("br",{}),Xe("li",{children:"Click on the gear image to activate further car clicks."}),Xe("br",{}),Xe("li",{children:"Your goal is to reach 69 clicks as fast as possible!"}),Xe("br",{})]}),Ur("div",{className:"animated-images",style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[Xe("div",{style:{height:"100px",position:"relative"},children:s&&Xe("img",{src:BN,className:"gear-animation",alt:"gear",style:{height:"55px",position:"absolute",top:0,left:-25,right:100,bottom:0,margin:"auto",animation:"appear-disappear 0.8s"}})}),Xe("img",{src:IN,className:"bryka-animation",alt:"bryka",style:{height:"100px",animation:s?"none":"clicking 0.3s infinite"}})]}),Xe(Vi,{onClick:h,children:"Close"})]})}),n&&Xe(TN,{elapsedTime:0,onClose:h,userId:null,firstName:"",userName:"",lastName:""})]}),Xe("style",{children:` +`,TN=({elapsedTime:e,onClose:t,userId:r,firstName:n,userName:a,lastName:i})=>{const o=II(!0),[s,l]=dt.useState([]),[u,c]=dt.useState(0),[h,f]=dt.useState(!1);dt.useState(!1);const p=3;dt.useEffect(()=>{(async()=>{const oe=await wre();l(oe)})()},[]);const y=async()=>{f(!0)},b=async()=>{try{if(!r&&!o){alert("Please connect your wallet.");return}const V={address:o||"",time:e,playerId:r||o||"",userName:a||""},oe=s.find(j=>j.address===o||j.playerId===(r||o));if(oe)if(e_.address===o||_.playerId===(r||o)?V:_);l(j),await zC(j),console.log(`Wallet Address: ${o}`),console.log(`Elapsed Time: ${e.toFixed(3)} seconds`),console.log(`User ID: ${r}`),console.log(`User Name: ${a}`),console.log(`User First Name: ${n}`)}else{const j=(e-oe.time).toFixed(3);alert(`You were slower by ${j} seconds than your best.`)}else{const j=[...s,V];l(j),await zC(j),console.log(`Wallet Address: ${o}`),console.log(`Elapsed Time: ${e.toFixed(3)} seconds`),console.log(`User ID: ${r}`),console.log(`User Name: ${a}`),console.log(`User First Name: ${n}`)}f(!1)}catch(V){console.error("Error saving score:",V)}},S=V=>{const oe=V.reduce((_,v)=>((!_[v.address||v.playerId]||_[v.address||v.playerId].time>v.time)&&(_[v.address||v.playerId]=v),_),{});return Object.values(oe).sort((_,v)=>_.time-v.time)},x=(V,oe)=>oe||(V.length<=9?V:`${V.slice(0,5)}...${V.slice(-4)}`),E=()=>{c(V=>V+1)},A=()=>{c(V=>Math.max(V-1,0))},P=()=>{f(!1)},D=S(s),U=D.slice(u*p,(u+1)*p),H=async()=>{try{console.log("OnChain Race clicked"),console.log(`Wallet Address: ${o}`),console.log(`User ID: ${r}`),console.log(`User Name: ${a}`),console.log(`Elapsed Time: ${e.toFixed(3)} seconds`),await xue(o,e)}catch(V){console.error("Error during OnChain Race:",V)}},Z=async()=>{try{if(!o){alert("Please connect your wallet.");return}const V=await Ng({network:"testnet"}),oe=new Qa.TonClient({endpoint:V}),j=Qa.Address.parse("kQDW1VLFvS3FJW5rl2tyNfQ-mOfN5nPYGPAHh1vueJsRywwm");await AN(oe,j)}catch(V){console.error("Error during OnChain Race Data retrieval:",V)}};return Ur(kue,{children:[Ur(Eue,{children:[e>0&&Ur(H0,{children:[Ur(Mue,{style:{marginBottom:"20px"},children:["Your current time:",Xe("br",{}),e.toFixed(3)," seconds"]}),Xe(_0,{children:Xe(Vi,{onClick:y,style:{marginBottom:"10px"},children:"Save Score"})})]}),Xe("h1",{style:{color:"white"},children:"Top"}),Xe(_0,{children:u>0&&Xe(x0,{onClick:A,children:"Previous"})}),Xe(Aue,{children:U.map((V,oe)=>Ur(Tue,{children:[u*p+oe+1,". ",x(V.address,V.userName)," - ",V.time.toFixed(3)," seconds"]},oe))}),Xe(_0,{children:(u+1)*p{const[t,r]=dt.useState(!1),[n,a]=dt.useState(!1),[i,o]=dt.useState(0),[s,l]=dt.useState(!1),u=()=>{r(!0),a(!1)},c=()=>{a(!0),r(!1)},h=()=>{r(!1),a(!1)};return dt.useEffect(()=>{let f,p;const y=()=>{f=setInterval(()=>{o(b=>b===8?(l(!0),clearInterval(f),p=setTimeout(()=>{l(!1),o(0),y()},800),b):b+1)},300)};return t&&y(),()=>{clearInterval(f),clearTimeout(p)}},[t]),Ur("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999,fontSize:"0.8rem"},children:[Ur("div",{style:{backgroundColor:"black",padding:"20px",borderRadius:"10px",maxWidth:"80%",textAlign:"center",fontSize:"0.7rem"},children:[Ur("h1",{style:{textShadow:"5px 5px rgba(255, 255, 255, 0.5)",fontSize:"1.2rem",padding:"15px"},children:["Tap",Xe("br",{}),"Race",Xe("br",{}),"Sprint"]}),Xe("br",{}),Ur("div",{style:{display:"flex",flexDirection:"column",gap:"10px",alignItems:"center"},children:[Xe(Vi,{onClick:u,children:"Instructions"}),Xe("br",{}),Xe(Vi,{onClick:c,children:"Leaderboard"}),Xe("br",{}),Xe(Vi,{onClick:e,children:"Start Game"}),Xe("br",{})]}),t&&Xe("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:Ur("div",{style:{backgroundColor:"black",padding:"20px",borderRadius:"10px",maxWidth:"80%",textAlign:"center",fontSize:"0.7rem"},children:[Xe("h2",{style:{fontSize:"1.0rem"},children:"How to play:"}),Ur("ol",{style:{fontSize:"0.6rem"},children:[Xe("li",{children:"Click on the car image to move forward."}),Xe("br",{}),Xe("li",{children:"Every 10 clicks will reveal the gear that disables clicking on the car."}),Xe("br",{}),Xe("li",{children:"Click on the gear image to activate further car clicks."}),Xe("br",{}),Xe("li",{children:"Your goal is to reach 69 clicks as fast as possible!"}),Xe("br",{})]}),Ur("div",{className:"animated-images",style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[Xe("div",{style:{height:"100px",position:"relative"},children:s&&Xe("img",{src:BN,className:"gear-animation",alt:"gear",style:{height:"55px",position:"absolute",top:0,left:-25,right:100,bottom:0,margin:"auto",animation:"appear-disappear 0.8s"}})}),Xe("img",{src:IN,className:"bryka-animation",alt:"bryka",style:{height:"100px",animation:s?"none":"clicking 0.3s infinite"}})]}),Xe(Vi,{onClick:h,children:"Close"})]})}),n&&Xe(TN,{elapsedTime:0,onClose:h,userId:null,firstName:"",userName:"",lastName:""})]}),Xe("style",{children:` @keyframes clicking { 0%, 100% { transform: scale(1); diff --git a/index.html b/index.html index b41d9d7..c078b40 100644 --- a/index.html +++ b/index.html @@ -56,7 +56,7 @@ TapRaceSprint by jaqbek - +