(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[979],{2015:()=>{},3193:(a,e,s)=>{Promise.resolve().then(s.bind(s,7313))},4120:()=>{},6052:()=>{},7313:(a,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>c});var l=s(5155),t=s(2115),r=s(6766);s(2015),s(4120),s(6052);let o=()=>{let[a,e]=(0,t.useState)(null),[s,o]=(0,t.useState)(null),[c,i]=(0,t.useState)(!0),[n,d]=(0,t.useState)("fallback"),[m,p]=(0,t.useState)(""),[h,_]=(0,t.useState)(null),[g,u]=(0,t.useState)(!1),[y,x]=(0,t.useState)(null),[v,j]=(0,t.useState)(!1),b="https://ns5j6tzwu4.execute-api.ap-southeast-2.amazonaws.com/prod",N=async()=>{try{let a=await fetch("".concat(b,"/leaderboard?limit=10"));if(!a.ok)throw Error("Failed to fetch leaderboard");let s=await a.json();s.leaderboard.length>0?(console.log("Successfully fetched leaderboard from API"),d("api"),e(s)):(console.log("API returned empty leaderboard"),d("fallback"),e({leaderboard:[{username:"GameMaster42",highest_score:312,total_score:2150,games_played:11,total_playtime:1650,last_played:"2025-07-26T08:10:00Z"},{username:"ProGamer2025",highest_score:287,total_score:1980,games_played:10,total_playtime:1400,last_played:"2025-07-26T07:55:00Z"},{username:"YuuMaster",highest_score:245,total_score:1240,games_played:8,total_playtime:1200,last_played:"2025-07-26T08:00:00Z"},{username:"FlappyFan",highest_score:234,total_score:1580,games_played:9,total_playtime:1340,last_played:"2025-07-26T06:45:00Z"},{username:"WingCommander",highest_score:201,total_score:1205,games_played:8,total_playtime:980,last_played:"2025-07-25T18:10:00Z"},{username:"PixelHunter",highest_score:189,total_score:920,games_played:6,total_playtime:900,last_played:"2025-07-25T15:30:00Z"},{username:"Flappyologist",highest_score:178,total_score:890,games_played:6,total_playtime:720,last_played:"2025-07-26T07:20:00Z"},{username:"SkyDancer",highest_score:167,total_score:1010,games_played:7,total_playtime:850,last_played:"2025-07-25T20:15:00Z"},{username:"YuuEnthusiast",highest_score:156,total_score:780,games_played:5,total_playtime:650,last_played:"2025-07-25T14:40:00Z"},{username:"BirdBrain",highest_score:98,total_score:456,games_played:5,total_playtime:600,last_played:"2025-07-24T12:20:00Z"}],total_shown:10,limit:10}))}catch(a){console.error("Error fetching leaderboard:",a),d("fallback"),e({leaderboard:[{username:"GameMaster42",highest_score:312,total_score:2150,games_played:11,total_playtime:1650,last_played:"2025-07-26T08:10:00Z"},{username:"ProGamer2025",highest_score:287,total_score:1980,games_played:10,total_playtime:1400,last_played:"2025-07-26T07:55:00Z"},{username:"YuuMaster",highest_score:245,total_score:1240,games_played:8,total_playtime:1200,last_played:"2025-07-26T08:00:00Z"},{username:"FlappyFan",highest_score:234,total_score:1580,games_played:9,total_playtime:1340,last_played:"2025-07-26T06:45:00Z"},{username:"WingCommander",highest_score:201,total_score:1205,games_played:8,total_playtime:980,last_played:"2025-07-25T18:10:00Z"},{username:"PixelHunter",highest_score:189,total_score:920,games_played:6,total_playtime:900,last_played:"2025-07-25T15:30:00Z"},{username:"Flappyologist",highest_score:178,total_score:890,games_played:6,total_playtime:720,last_played:"2025-07-26T07:20:00Z"},{username:"SkyDancer",highest_score:167,total_score:1010,games_played:7,total_playtime:850,last_played:"2025-07-25T20:15:00Z"},{username:"YuuEnthusiast",highest_score:156,total_score:780,games_played:5,total_playtime:650,last_played:"2025-07-25T14:40:00Z"},{username:"BirdBrain",highest_score:98,total_score:456,games_played:5,total_playtime:600,last_played:"2025-07-24T12:20:00Z"}],total_shown:10,limit:10})}},f=async()=>{try{let a=await fetch("".concat(b,"/stats/global"));if(a.ok){let e=await a.json();o(e);return}let e=null;for(let a of["globalstats","global-stats","global_stats","stats"])try{let s=await fetch("".concat(b,"/").concat(a));if(s.ok){e=await s.json();break}}catch(e){console.log("Endpoint ".concat(a," failed, trying next..."))}e?o(e):o({global_stats:{total_players:11,total_games_played:79,total_score:12245,total_playtime:10620,average_score_per_game:Math.round(155),average_playtime_per_game:Math.round(10620/79),average_games_per_player:Math.round(79/11)},computed:{total_players:11,total_games_played:79,total_score:12245,total_playtime:10620,average_score_per_game:Math.round(155),average_playtime_per_game:Math.round(10620/79),average_games_per_player:Math.round(79/11)},raw_stats:{total_players:11,total_games_played:79,total_score:12245,total_playtime:10620,average_score_per_game:0,average_playtime_per_game:0,average_games_per_player:0}})}catch(a){console.error("Error fetching global stats"),o({global_stats:{total_players:11,total_games_played:79,total_score:12245,total_playtime:10620,average_score_per_game:Math.round(155),average_playtime_per_game:Math.round(10620/79),average_games_per_player:Math.round(79/11)},computed:{total_players:11,total_games_played:79,total_score:12245,total_playtime:10620,average_score_per_game:Math.round(155),average_playtime_per_game:Math.round(10620/79),average_games_per_player:Math.round(79/11)},raw_stats:{total_players:11,total_games_played:79,total_score:12245,total_playtime:10620,average_score_per_game:0,average_playtime_per_game:0,average_games_per_player:0}})}},Q=async a=>{if(!a.trim())return void x("Please enter a username");u(!0),x(null);try{let e=await fetch("".concat(b,"/leaderboard/around/").concat(encodeURIComponent(a.trim()),"?range=5"));if(404===e.status){x("Player not found"),u(!1);return}if(!e.ok)throw Error("Failed to fetch player leaderboard");let s=await e.json();_(s),j(!0),console.log("Successfully fetched player leaderboard from API")}catch(a){console.error("Error searching for player:",a),x("Failed to search for player. Please try again.")}finally{u(!1)}};(0,t.useEffect)(()=>{(async()=>{i(!0),await Promise.all([N(),f()]),i(!1)})()},[]);let w=a=>{try{let e=new Date(a),s=new Date,l=Math.abs(s.getTime()-e.getTime()),t=Math.floor(l/864e5);if(0===t)return"Today";if(1===t)return"Yesterday";if(t<7)return"".concat(t," days ago");return e.toLocaleDateString()}catch(a){return"Unknown"}};return c?(0,l.jsx)("div",{className:"flappy-leaderboard-container",children:(0,l.jsxs)("div",{className:"leaderboard-loading",children:[(0,l.jsx)("div",{className:"loading-spinner"}),(0,l.jsx)("p",{children:"Loading leaderboard..."})]})}):(0,l.jsxs)("div",{className:"flappy-leaderboard-container",children:[(0,l.jsx)("h2",{className:"leaderboard-title",children:"\uD83C\uDFC6 Flappy Yuu Leaderboard"}),(0,l.jsxs)("div",{className:"leaderboard-section",children:[(0,l.jsxs)("div",{className:"section-header",children:[(0,l.jsx)("h3",{children:v?'Players around "'.concat(null==h?void 0:h.username,'"'):"Top 10 Players"}),(0,l.jsx)("div",{className:"search-controls",children:(0,l.jsxs)("form",{onSubmit:a=>{a.preventDefault(),Q(m)},className:"player-search-form",children:[(0,l.jsx)("input",{type:"text",value:m,onChange:a=>p(a.target.value),placeholder:"Search for player...",className:"search-input",disabled:g}),(0,l.jsx)("button",{type:"submit",className:"search-button",disabled:g||!m.trim(),children:g?"\uD83D\uDD04":"\uD83D\uDD0D"}),v&&(0,l.jsx)("button",{type:"button",onClick:()=>{j(!1),_(null),p(""),x(null)},className:"clear-search-button",children:"↩️"})]})}),(0,l.jsx)("div",{className:"data-status ".concat("api"===n?"live":"fallback"),children:"api"===n?"\uD83D\uDFE2 Live Data":"\uD83D\uDCCA Sample Data"})]}),y&&(0,l.jsx)("div",{className:"search-error",children:(0,l.jsxs)("p",{children:["⚠️ ",y]})}),(v?h:a)&&(v?h.leaderboard.length>0:a.leaderboard.length>0)?(0,l.jsxs)("div",{className:"leaderboard-table",children:[(0,l.jsxs)("div",{className:"leaderboard-header",children:[(0,l.jsx)("div",{className:"rank-col",children:"Rank"}),(0,l.jsx)("div",{className:"player-col",children:"Player"}),(0,l.jsx)("div",{className:"score-col",children:"High Score"}),(0,l.jsx)("div",{className:"total-col",children:"Total Score"}),(0,l.jsx)("div",{className:"games-col",children:"Games"}),(0,l.jsx)("div",{className:"time-col",children:"Last Played"})]}),(v?h.leaderboard:a.leaderboard).map(e=>{let s=v?e.rank||0:a.leaderboard.indexOf(e)+1,t=v&&e.is_current_player;return(0,l.jsxs)("div",{className:"leaderboard-row ".concat(s<=3?"rank-".concat(s):""," ").concat(t?"current-player":""),children:[(0,l.jsx)("div",{className:"rank-col",children:s<=3?(0,l.jsx)("span",{className:"medal",children:(0,l.jsx)(r.default,{src:"/images/icons/medals/yuucoin-".concat(1===s?"gold":2===s?"silver":"bronze",".webp"),alt:"".concat(1===s?"Gold":2===s?"Silver":"Bronze"," Medal"),className:"medal-image",width:24,height:24})}):(0,l.jsxs)("span",{className:"rank-number",children:["#",s]})}),(0,l.jsx)("div",{className:"player-col",children:(0,l.jsxs)("span",{className:"player-name ".concat(t?"current-player-name":""),children:[e.username,t&&" \uD83D\uDC64"]})}),(0,l.jsx)("div",{className:"score-col",children:(0,l.jsx)("span",{className:"high-score",children:e.highest_score.toLocaleString()})}),(0,l.jsx)("div",{className:"total-col",children:(0,l.jsx)("span",{className:"total-score",children:e.total_score.toLocaleString()})}),(0,l.jsx)("div",{className:"games-col",children:(0,l.jsx)("span",{className:"games-count",children:e.games_played})}),(0,l.jsx)("div",{className:"time-col",children:(0,l.jsx)("span",{className:"last-played",children:w(e.last_played)})})]},e.username)})]}):(0,l.jsx)("div",{className:"no-data",children:(0,l.jsx)("p",{children:"\uD83C\uDFAE No players found. Be the first to set a high score!"})})]}),(0,l.jsxs)("div",{className:"stats-section",children:[(0,l.jsx)("h3",{children:"Global Statistics"}),s?(0,l.jsxs)("div",{className:"stats-grid",children:[(0,l.jsxs)("div",{className:"stat-card",children:[(0,l.jsx)("div",{className:"stat-icon",children:"\uD83D\uDC65"}),(0,l.jsxs)("div",{className:"stat-content",children:[(0,l.jsx)("div",{className:"stat-number",children:s.global_stats.total_players.toLocaleString()}),(0,l.jsx)("div",{className:"stat-label",children:"Total Players"})]})]}),(0,l.jsxs)("div",{className:"stat-card",children:[(0,l.jsx)("div",{className:"stat-icon",children:"\uD83C\uDFAE"}),(0,l.jsxs)("div",{className:"stat-content",children:[(0,l.jsx)("div",{className:"stat-number",children:s.global_stats.total_games_played.toLocaleString()}),(0,l.jsx)("div",{className:"stat-label",children:"Games Played"})]})]}),(0,l.jsxs)("div",{className:"stat-card",children:[(0,l.jsx)("div",{className:"stat-icon",children:"⭐"}),(0,l.jsxs)("div",{className:"stat-content",children:[(0,l.jsx)("div",{className:"stat-number",children:s.global_stats.total_score.toLocaleString()}),(0,l.jsx)("div",{className:"stat-label",children:"Total Score"})]})]}),(0,l.jsxs)("div",{className:"stat-card",children:[(0,l.jsx)("div",{className:"stat-icon",children:"⏱️"}),(0,l.jsxs)("div",{className:"stat-content",children:[(0,l.jsx)("div",{className:"stat-number",children:(a=>{let e=Math.floor(a/3600),s=Math.floor(a%3600/60);return e>0?"".concat(e,"h ").concat(s,"m"):"".concat(s,"m")})(s.global_stats.total_playtime)}),(0,l.jsx)("div",{className:"stat-label",children:"Total Playtime"})]})]}),(0,l.jsxs)("div",{className:"stat-card",children:[(0,l.jsx)("div",{className:"stat-icon",children:"\uD83D\uDCCA"}),(0,l.jsxs)("div",{className:"stat-content",children:[(0,l.jsx)("div",{className:"stat-number",children:s.global_stats.average_score_per_game.toFixed(2)}),(0,l.jsx)("div",{className:"stat-label",children:"Avg Score/Game"})]})]}),(0,l.jsxs)("div",{className:"stat-card",children:[(0,l.jsx)("div",{className:"stat-icon",children:"\uD83C\uDFAF"}),(0,l.jsxs)("div",{className:"stat-content",children:[(0,l.jsx)("div",{className:"stat-number",children:s.global_stats.average_games_per_player.toFixed(2)}),(0,l.jsx)("div",{className:"stat-label",children:"Avg Games/Player"})]})]})]}):(0,l.jsx)("div",{className:"no-data",children:(0,l.jsx)("p",{children:"\uD83D\uDCCA Unable to load global statistics"})})]})]})};function c(){return(0,l.jsxs)("div",{className:"temp-game-layout navbar-spaced",children:[(0,l.jsxs)("div",{className:"temp-video-section video-section-with-navbar",children:[(0,l.jsx)("video",{src:"/game-background-videos/flappyyuu-backgroundvideo.mp4",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"temp-video"}),(0,l.jsx)("div",{className:"temp-logo-container",children:(0,l.jsx)(r.default,{src:"/images/games/flappy-yuu/GameLogo-FlappyYuu.webp",alt:"Flappy Yuu Game Logo",className:"temp-logo-image",width:400,height:200})}),(0,l.jsxs)("div",{className:"temp-scroll-arrow",onClick:()=>{let a=document.querySelector(".temp-content-box");a&&a.scrollIntoView({behavior:"smooth",block:"start"})},children:[(0,l.jsx)("div",{className:"temp-scroll-arrow-clickable"}),(0,l.jsx)(r.default,{src:"/images/icons/general/triangle-64px.png",alt:"Scroll down",className:"temp-scroll-arrow-image",width:64,height:64})]})]}),(0,l.jsx)("div",{className:"temp-wave-transition",children:(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 3200 64",className:"temp-wave-svg",children:[(0,l.jsx)("defs",{children:(0,l.jsx)("filter",{id:"topShadow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:(0,l.jsx)("feDropShadow",{dx:"0",dy:"-6",stdDeviation:"4",floodColor:"rgba(0,0,0,0.3)",floodOpacity:"1"})})}),(0,l.jsx)("path",{d:"M-800,32 Q-750,12 -700,32 Q-650,52 -600,32 Q-550,12 -500,32 Q-450,52 -400,32 Q-350,12 -300,32 Q-250,52 -200,32 Q-150,12 -100,32 Q-50,52 0,32 Q50,12 100,32 Q150,52 200,32 Q250,12 300,32 Q350,52 400,32 Q450,12 500,32 Q550,52 600,32 Q650,12 700,32 Q750,52 800,32 Q850,12 900,32 Q950,52 1000,32 Q1050,12 1100,32 Q1150,52 1200,32 Q1250,12 1300,32 Q1350,52 1400,32 Q1450,12 1500,32 Q1550,52 1600,32 Q1650,12 1700,32 Q1750,52 1800,32 Q1850,12 1900,32 Q1950,52 2000,32 Q2050,12 2100,32 Q2150,52 2200,32 Q2250,12 2300,32 Q2350,52 2400,32 Q2450,12 2500,32 Q2550,52 2600,32 Q2650,12 2700,32 Q2750,52 2800,32 Q2850,12 2900,32 Q2950,52 3000,32 Q3050,12 3100,32 Q3150,52 3200,32 L3200,64 L-800,64 Z",fill:"white"}),(0,l.jsx)("path",{d:"M-800,32 Q-750,12 -700,32 Q-650,52 -600,32 Q-550,12 -500,32 Q-450,52 -400,32 Q-350,12 -300,32 Q-250,52 -200,32 Q-150,12 -100,32 Q-50,52 0,32 Q50,12 100,32 Q150,52 200,32 Q250,12 300,32 Q350,52 400,32 Q450,12 500,32 Q550,52 600,32 Q650,12 700,32 Q750,52 800,32 Q850,12 900,32 Q950,52 1000,32 Q1050,12 1100,32 Q1150,52 1200,32 Q1250,12 1300,32 Q1350,52 1400,32 Q1450,12 1500,32 Q1550,52 1600,32 Q1650,12 1700,32 Q1750,52 1800,32 Q1850,12 1900,32 Q1950,52 2000,32 Q2050,12 2100,32 Q2150,52 2200,32 Q2250,12 2300,32 Q2350,52 2400,32 Q2450,12 2500,32 Q2550,52 2600,32 Q2650,12 2700,32 Q2750,52 2800,32 Q2850,12 2900,32 Q2950,52 3000,32 Q3050,12 3100,32 Q3150,52 3200,32 L3200,0 L-800,0 Z",fill:"transparent",filter:"url(#topShadow)"})]})}),(0,l.jsxs)("div",{className:"temp-content-box",children:[(0,l.jsxs)("div",{className:"temp-content-layout",children:[(0,l.jsxs)("div",{className:"temp-download-section",children:[(0,l.jsx)("h2",{children:"Download Links"}),(0,l.jsxs)("a",{href:"https://play.google.com/store/apps/details?id=com.liliovali.flappyyuu",target:"_blank",rel:"noopener noreferrer",className:"temp-download-btn googleplay-btn",children:[(0,l.jsx)(r.default,{src:"/images/icons/game-platforms/googleplay-64px.png",alt:"Google Play",className:"platform-icon",width:64,height:64}),"Google Play"]}),(0,l.jsxs)("a",{href:"https://liliovali.itch.io/flappy-yuu",target:"_blank",rel:"noopener noreferrer",className:"temp-download-btn itchio-btn",children:[(0,l.jsx)(r.default,{src:"/images/icons/game-platforms/itchio-64px.png",alt:"itch.io",className:"platform-icon",width:64,height:64}),"itch.io"]})]}),(0,l.jsxs)("div",{className:"temp-description-section",children:[(0,l.jsx)("h1",{children:"Flappy Yuu"}),(0,l.jsxs)("p",{children:["I made Flappy Yuu as a quick way to show off my mobile game dev skills. It features my character ",(0,l.jsx)("a",{href:"/art?character=yuu",className:"yuui-link",children:"Yuu"}),", showing off their design and charm in a simple but fun game."]}),(0,l.jsx)("h2",{children:"More Than Just a Game"}),(0,l.jsxs)("p",{children:["Flappy Yuu also lives inside my ",(0,l.jsx)("a",{href:"/apps?app=yuui",className:"yuui-link",children:"Yuui desktop app"})," as a little minigame. I use it as a productivity tool - when I need a quick break from coding, I can play a round to reset my brain and stay motivated."]}),(0,l.jsx)("p",{children:"It's a neat example of how I like to make things that work together and serve multiple purposes."}),(0,l.jsx)("h2",{children:"Tools Used"}),(0,l.jsx)("p",{children:"Unity, C#, BFXR, Krita, Ableton"})]}),(0,l.jsx)("div",{className:"temp-margin-section"})]}),(0,l.jsx)("div",{className:"temp-leaderboard-section",children:(0,l.jsx)(o,{})})]})]})}}},a=>{var e=e=>a(a.s=e);a.O(0,[270,597,766,441,684,358],()=>e(3193)),_N_E=a.O()}]);