From 55bee6d052c377ec124ef842443fe5dac75102b1 Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Sat, 9 Mar 2024 06:36:46 +0000 Subject: [PATCH] Updates --- assets/{index-xtR2dqzK.js => index-JRMhePbq.js} | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename assets/{index-xtR2dqzK.js => index-JRMhePbq.js} (99%) diff --git a/assets/index-xtR2dqzK.js b/assets/index-JRMhePbq.js similarity index 99% rename from assets/index-xtR2dqzK.js rename to assets/index-JRMhePbq.js index f58f1f8..b129b5f 100644 --- a/assets/index-xtR2dqzK.js +++ b/assets/index-JRMhePbq.js @@ -153,4 +153,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho ${e.palette.mode==="light"?rb(Fe(e.palette.divider,1),.88):nb(Fe(e.palette.divider,1),.68)}`,textAlign:"left",padding:16},t.variant==="head"&&{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},t.variant==="body"&&{color:(e.vars||e).palette.text.primary},t.variant==="footer"&&{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},t.size==="small"&&{padding:"6px 16px",[`&.${g8.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},t.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},t.padding==="none"&&{padding:0},t.align==="left"&&{textAlign:"left"},t.align==="center"&&{textAlign:"center"},t.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},t.align==="justify"&&{textAlign:"justify"},t.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default})),C8=C.forwardRef(function(t,n){const r=ke({props:t,name:"MuiTableCell"}),{align:o="inherit",className:i,component:a,padding:l,scope:s,size:u,sortDirection:c,variant:d}=r,p=q(r,v8),g=C.useContext(zx),v=C.useContext(hc),y=v&&v.variant==="head";let R;a?R=a:R=y?"th":"td";let m=s;R==="td"?m=void 0:!m&&y&&(m="col");const f=d||v&&v.variant,h=x({},r,{align:o,component:R,padding:l||(g&&g.padding?g.padding:"normal"),size:u||(g&&g.size?g.size:"medium"),sortDirection:c,stickyHeader:f==="head"&&g&&g.stickyHeader,variant:f}),b=b8(h);let k=null;return c&&(k=c==="asc"?"ascending":"descending"),S.jsx(x8,x({as:R,ref:n,className:X(b.root,i),"aria-sort":k,scope:m,ownerState:h},p))}),Js=C8;function S8(e){return Ce("MuiTableContainer",e)}be("MuiTableContainer",["root"]);const w8=["className","component"],k8=e=>{const{classes:t}=e;return we({root:["root"]},S8,t)},R8=G("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),P8=C.forwardRef(function(t,n){const r=ke({props:t,name:"MuiTableContainer"}),{className:o,component:i="div"}=r,a=q(r,w8),l=x({},r,{component:i}),s=k8(l);return S.jsx(R8,x({ref:n,as:i,className:X(s.root,o),ownerState:l},a))}),T8=P8;function E8(e){return Ce("MuiTableHead",e)}be("MuiTableHead",["root"]);const $8=["className","component"],I8=e=>{const{classes:t}=e;return we({root:["root"]},E8,t)},A8=G("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),O8={variant:"head"},lv="thead",M8=C.forwardRef(function(t,n){const r=ke({props:t,name:"MuiTableHead"}),{className:o,component:i=lv}=r,a=q(r,$8),l=x({},r,{component:i}),s=I8(l);return S.jsx(hc.Provider,{value:O8,children:S.jsx(A8,x({as:i,className:X(s.root,o),ref:n,role:i===lv?null:"rowgroup",ownerState:l},a))})}),_8=M8;function N8(e){return Ce("MuiTableRow",e)}const L8=be("MuiTableRow",["root","selected","hover","head","footer"]),sv=L8,j8=["className","component","hover","selected"],z8=e=>{const{classes:t,selected:n,hover:r,head:o,footer:i}=e;return we({root:["root",n&&"selected",r&&"hover",o&&"head",i&&"footer"]},N8,t)},F8=G("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${sv.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${sv.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Fe(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Fe(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}})),uv="tr",D8=C.forwardRef(function(t,n){const r=ke({props:t,name:"MuiTableRow"}),{className:o,component:i=uv,hover:a=!1,selected:l=!1}=r,s=q(r,j8),u=C.useContext(hc),c=x({},r,{component:i,hover:a,selected:l,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),d=z8(c);return S.jsx(F8,x({as:i,ref:n,className:X(d.root,o),role:i===uv?null:"row",ownerState:c},s))}),Fx=D8;function B8(e){return Ce("MuiTooltip",e)}const U8=be("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Ir=U8,W8=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function H8(e){return Math.round(e*1e5)/1e5}const V8=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:o,placement:i}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",o&&"touch",`tooltipPlacement${W(i.split("-")[0])}`],arrow:["arrow"]};return we(a,B8,t)},G8=G(fc,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(({theme:e,ownerState:t,open:n})=>x({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Ir.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Ir.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Ir.arrow}`]:x({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Ir.arrow}`]:x({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),K8=G("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${W(n.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>x({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Fe(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${H8(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Ir.popper}[data-popper-placement*="left"] &`]:x({transformOrigin:"right center"},t.isRtl?x({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):x({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Ir.popper}[data-popper-placement*="right"] &`]:x({transformOrigin:"left center"},t.isRtl?x({marginRight:"14px"},t.touch&&{marginRight:"24px"}):x({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Ir.popper}[data-popper-placement*="top"] &`]:x({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Ir.popper}[data-popper-placement*="bottom"] &`]:x({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),q8=G("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Fe(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let Gl=!1,hd=null,ra={x:0,y:0};function Kl(e,t){return n=>{t&&t(n),e(n)}}const Y8=C.forwardRef(function(t,n){var r,o,i,a,l,s,u,c,d,p,g,v,y,R,m,f,h,b,k;const P=ke({props:t,name:"MuiTooltip"}),{arrow:w=!1,children:E,components:A={},componentsProps:T={},describeChild:L=!1,disableFocusListener:N=!1,disableHoverListener:D=!1,disableInteractive:M=!1,disableTouchListener:F=!1,enterDelay:j=100,enterNextDelay:U=0,enterTouchDelay:I=700,followCursor:z=!1,id:H,leaveDelay:re=0,leaveTouchDelay:ne=1500,onClose:he,onOpen:Y,open:te,placement:le="bottom",PopperComponent:Te,PopperProps:oe={},slotProps:se={},slots:ze={},title:pe,TransitionComponent:fe=Dp,TransitionProps:ue}=P,ge=q(P,W8),ie=C.isValidElement(E)?E:S.jsx("span",{children:E}),J=Ii(),ut=J.direction==="rtl",[ae,Be]=C.useState(),[Ae,Re]=C.useState(null),We=C.useRef(!1),Ne=M||z,ve=C.useRef(),Ze=C.useRef(),Ke=C.useRef(),ct=C.useRef(),[de,K]=mo({controlled:te,default:!1,name:"Tooltip",state:"open"});let Oe=de;const Nt=Ei(H),gt=C.useRef(),Z=C.useCallback(()=>{gt.current!==void 0&&(document.body.style.WebkitUserSelect=gt.current,gt.current=void 0),clearTimeout(ct.current)},[]);C.useEffect(()=>()=>{clearTimeout(ve.current),clearTimeout(Ze.current),clearTimeout(Ke.current),Z()},[Z]);const ye=ce=>{clearTimeout(hd),Gl=!0,K(!0),Y&&!Oe&&Y(ce)},Pe=gn(ce=>{clearTimeout(hd),hd=setTimeout(()=>{Gl=!1},800+re),K(!1),he&&Oe&&he(ce),clearTimeout(ve.current),ve.current=setTimeout(()=>{We.current=!1},J.transitions.duration.shortest)}),St=ce=>{We.current&&ce.type!=="touchstart"||(ae&&ae.removeAttribute("title"),clearTimeout(Ze.current),clearTimeout(Ke.current),j||Gl&&U?Ze.current=setTimeout(()=>{ye(ce)},Gl?U:j):ye(ce))},Pn=ce=>{clearTimeout(Ze.current),clearTimeout(Ke.current),Ke.current=setTimeout(()=>{Pe(ce)},re)},{isFocusVisibleRef:Eo,onBlur:Bt,onFocus:Tn,ref:dn}=Pu(),[,er]=C.useState(!1),Fn=ce=>{Bt(ce),Eo.current===!1&&(er(!1),Pn(ce))},qr=ce=>{ae||Be(ce.currentTarget),Tn(ce),Eo.current===!0&&(er(!0),St(ce))},Yr=ce=>{We.current=!0;const Tt=ie.props;Tt.onTouchStart&&Tt.onTouchStart(ce)},Qr=St,$o=Pn,gl=ce=>{Yr(ce),clearTimeout(Ke.current),clearTimeout(ve.current),Z(),gt.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ct.current=setTimeout(()=>{document.body.style.WebkitUserSelect=gt.current,St(ce)},I)},vr=ce=>{ie.props.onTouchEnd&&ie.props.onTouchEnd(ce),Z(),clearTimeout(Ke.current),Ke.current=setTimeout(()=>{Pe(ce)},ne)};C.useEffect(()=>{if(!Oe)return;function ce(Tt){(Tt.key==="Escape"||Tt.key==="Esc")&&Pe(Tt)}return document.addEventListener("keydown",ce),()=>{document.removeEventListener("keydown",ce)}},[Pe,Oe]);const vt=it(ie.ref,dn,Be,n);!pe&&pe!==0&&(Oe=!1);const et=C.useRef(),Xt=ce=>{const Tt=ie.props;Tt.onMouseMove&&Tt.onMouseMove(ce),ra={x:ce.clientX,y:ce.clientY},et.current&&et.current.update()},br={},Xr=typeof pe=="string";L?(br.title=!Oe&&Xr&&!D?pe:null,br["aria-describedby"]=Oe?Nt:null):(br["aria-label"]=Xr?pe:null,br["aria-labelledby"]=Oe&&!Xr?Nt:null);const Lt=x({},br,ge,ie.props,{className:X(ge.className,ie.props.className),onTouchStart:Yr,ref:vt},z?{onMouseMove:Xt}:{}),tr={};F||(Lt.onTouchStart=gl,Lt.onTouchEnd=vr),D||(Lt.onMouseOver=Kl(Qr,Lt.onMouseOver),Lt.onMouseLeave=Kl($o,Lt.onMouseLeave),Ne||(tr.onMouseOver=Qr,tr.onMouseLeave=$o)),N||(Lt.onFocus=Kl(qr,Lt.onFocus),Lt.onBlur=Kl(Fn,Lt.onBlur),Ne||(tr.onFocus=qr,tr.onBlur=Fn));const Io=C.useMemo(()=>{var ce;let Tt=[{name:"arrow",enabled:!!Ae,options:{element:Ae,padding:4}}];return(ce=oe.popperOptions)!=null&&ce.modifiers&&(Tt=Tt.concat(oe.popperOptions.modifiers)),x({},oe.popperOptions,{modifiers:Tt})},[Ae,oe]),En=x({},P,{isRtl:ut,arrow:w,disableInteractive:Ne,placement:le,PopperComponentProp:Te,touch:We.current}),$n=V8(En),nr=(r=(o=ze.popper)!=null?o:A.Popper)!=null?r:G8,O=(i=(a=(l=ze.transition)!=null?l:A.Transition)!=null?a:fe)!=null?i:Dp,$=(s=(u=ze.tooltip)!=null?u:A.Tooltip)!=null?s:K8,V=(c=(d=ze.arrow)!=null?d:A.Arrow)!=null?c:q8,ee=da(nr,x({},oe,(p=se.popper)!=null?p:T.popper,{className:X($n.popper,oe==null?void 0:oe.className,(g=(v=se.popper)!=null?v:T.popper)==null?void 0:g.className)}),En),Ee=da(O,x({},ue,(y=se.transition)!=null?y:T.transition),En),tt=da($,x({},(R=se.tooltip)!=null?R:T.tooltip,{className:X($n.tooltip,(m=(f=se.tooltip)!=null?f:T.tooltip)==null?void 0:m.className)}),En),at=da(V,x({},(h=se.arrow)!=null?h:T.arrow,{className:X($n.arrow,(b=(k=se.arrow)!=null?k:T.arrow)==null?void 0:b.className)}),En);return S.jsxs(C.Fragment,{children:[C.cloneElement(ie,Lt),S.jsx(nr,x({as:Te??fc,placement:le,anchorEl:z?{getBoundingClientRect:()=>({top:ra.y,left:ra.x,right:ra.x,bottom:ra.y,width:0,height:0})}:ae,popperRef:et,open:ae?Oe:!1,id:Nt,transition:!0},tr,ee,{popperOptions:Io,children:({TransitionProps:ce})=>S.jsx(O,x({timeout:J.transitions.duration.shorter},ce,Ee,{children:S.jsxs($,x({},tt,{children:[pe,w?S.jsx(V,x({},at,{ref:Re})):null]}))}))}))]})}),Up=Y8;function Q8(e,t){const r=(e+t)/2;return Math.abs(e-t)/r<=.1}function Dx(e,t){const n=e===t||typeof t=="number"&&typeof e=="number"&&Q8(t,e),r=!n&&typeof t=="number"&&e>t,o=!n&&typeof t=="number"&&e["Continent","Population","Landlocked","Religion","Avg. Temp.","Gov."];function rD(e,t){switch(Dx(e,t)){case"🟥":return cv;case"🟩":return eD;case"🔼":return tD;case"🔽":return nD;default:return cv}}const oD=({population:e,landlocked:t,religion:n,temperatureCelsius:r,continent:o,government:i})=>{const a=r===0?"N/A":`${Math.round(r)}°C / ${Math.round(X8(r))}°F`,l=t?"Landlocked":"Coastal",s=J8(e);return[o,s,l,n,a,i]};function iD({guessData:e,correctData:t}){const{country:n,population:r,landlocked:o,religion:i,temperatureCelsius:a,continent:l,government:s}=e,u=[l,r,o,i,a,s],c=[t.continent,t.population,t.landlocked,t.religion,t.temperatureCelsius,t.government],d=oD(e),p=Hx(),g=S.jsx("div",{style:{whiteSpace:"pre-line",textAlign:"center"},children:p.map((v,y)=>`${v}: ${d[y]}`).join(` `)});return S.jsxs(Fx,{children:[S.jsx(Js,{component:"th",scope:"row",sx:{minWidth:"2rem",overflow:"auto"},children:S.jsx(Up,{title:g,children:S.jsx(jx,{sx:{width:"100%",textDecoration:"underline dotted",textDecorationThickness:"2px"},children:n})})}),d.map((v,y)=>S.jsx(Js,{align:"center",sx:{cursor:"pointer"},children:S.jsx(Up,{title:v,children:rD(c[y],u[y])})},v))]})}function Vx({guessesData:e,correctData:t}){const n=["Continent matches the correct country","Population within 10% of correct country","A landlocked country does not have territory connected to an ocean","Most common religion matches the correct country","Temperature within 10% of correct country","Government type matches the correct country"],r=Hx();return e.length>0?S.jsx(Xn,{sx:{overflow:"auto",margin:"0 10%"},children:S.jsx(Xn,{sx:{width:"100%",maxWidth:"97w",marginBottom:"10vh",display:"table",tableLayout:"fixed"},children:S.jsx(T8,{children:S.jsxs(a8,{children:[S.jsx(_8,{sx:{borderBottom:"2px solid #4d4d4d"},children:S.jsxs(Fx,{children:[S.jsx(Js,{}),r.map((o,i)=>S.jsx(Up,{title:n[i],sx:{cursor:"pointer"},children:S.jsx(Js,{align:"center",children:S.jsx(jx,{variant:"body1",sx:{textDecoration:"underline dotted",textDecorationThickness:"2px",margin:"0 auto",whiteSpace:"nowrap"},children:o})})},o))]})}),S.jsx(m8,{children:e.map(o=>S.jsx(iD,{guessData:o,correctData:t},o.country))})]})})})}):null}var Mm={},aD=T1;Object.defineProperty(Mm,"__esModule",{value:!0});var Gx=Mm.default=void 0,lD=aD(lb()),sD=S,uD=(0,lD.default)((0,sD.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");Gx=Mm.default=uD;const cD=S.jsx("img",{src:Wx,className:"emoji-icon",style:{width:"1rem",height:"1rem",padding:"0 0.5rem"},alt:"Red Square"}),dv=S.jsx("img",{src:Ux,className:"emoji-icon",style:{width:"1rem",height:"1rem",padding:"0 0.5rem"},alt:"Green Square"}),dD=S.jsx("img",{src:Bx,className:"emoji-icon",style:{width:"1rem",height:"1rem",padding:"0 0.5rem"},alt:"Upwards Arrow"});function pD(){return S.jsx("a",{href:"https://ko-fi.com/D1D5V1DSF",target:"_blank",children:S.jsx("img",{height:"36",style:{border:0,height:"36px"},src:"https://storage.ko-fi.com/cdn/kofi4.png?v=3",alt:"Buy Me a Coffee at ko-fi.com"})})}function fD(){return S.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",padding:"2rem",width:"75%"},children:[S.jsx("div",{style:{display:"flex",alignContent:"center",justifyContent:"center",gap:"0.5rem"},children:S.jsx(pD,{})}),S.jsxs("div",{style:{display:"flex",alignContent:"center",justifyContent:"center",gap:"0.5rem"},children:[S.jsx(Gx,{}),S.jsx(At,{variant:"h5",sx:{fontWeight:600},children:"How to Play"})]}),S.jsx(At,{children:"Figure out the secret country in 7 guesses!"}),S.jsx(At,{children:"Each guess must be a country that appears in the search box. Only the 100 most populated countries are in this game."}),S.jsx(At,{children:"After each guess, you will get a hint about how different your guess is from the correct country."}),S.jsx(At,{children:"You are given hints about the following categories: Continent, Population, Landlocked, Religion, Temperature, and Government."}),S.jsx(At,{children:"For example:"}),S.jsx(Vx,{guessesData:[{country:"Australia",continent:"Oceania",population:25e6,landlocked:!1,religion:"Christianity",temperatureCelsius:22,government:"Federation Constitutional Monarchy"}],correctData:{country:"Ivory Coast",continent:"Africa",population:251e5,landlocked:!1,religion:"N/A",temperatureCelsius:26,government:"Republic"}}),S.jsxs(At,{children:["You guess Australia, but it's in the wrong continent from the correct country, so it shows",cD]}),S.jsxs(At,{children:["The population is within 10% of the correct country's population, so it shows",dv]}),S.jsxs(At,{children:["Landlocked refers to whether the country is surrounded by land. Australia is not landlocked, as it is surrounded by ocean, so it is coastal. Both countries have the same landlocked status - they are both coastal, so it shows",dv]}),S.jsxs(At,{children:["The average temperature of the correct country is at least 10% higher than Australia's, so it shows",dD]}),S.jsx(At,{children:"Hover over the boxes to get information on your guess's data."}),S.jsx(At,{children:"Hover over the category titles to get more information on what it means."}),S.jsx(At,{children:"If you had fun, please share this game with your friends!"})]})}function _m({guessesData:e}){const[t,n]=C.useState(null),r=!!t,o=e.map(({population:l,landlocked:s,religion:u,temperatureCelsius:c,continent:d,government:p})=>[[Ax,d],[Tx,l],[Ex,s],[$x,u],[Ix,c],[Ox,p]]).map(l=>l.map(([s,u])=>Dx(s,u)).join("")).join(` `),i=`geodle.me ${Si} ${e.length}/7`,a=l=>{const s=`${i} -${o}`;navigator.clipboard.writeText(s),n(l.currentTarget)};return S.jsxs(S.Fragment,{children:[S.jsx(Lx,{variant:"contained",onClick:a,type:"button",children:"Share 📋"}),S.jsx(Cx,{open:r,anchorEl:t,onClose:()=>n(null),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:S.jsx(jn,{variant:"body1",sx:{padding:"0.5rem",border:"1px solid #4d4d4d",borderRadius:"4px",userSelect:"none"},children:"Copied results to clipboard"})})]})}function mD(){return S.jsx("div",{className:"title-container",children:S.jsxs(At,{variant:"h1",className:"title-text",children:[S.jsx("span",{children:"G"}),S.jsx("span",{children:"e"}),S.jsx("span",{children:"o"}),S.jsx("span",{children:"d"}),S.jsx("span",{children:"l"}),S.jsx("span",{children:"e"})]})})}const hD={continent:Ax,population:Tx,landlocked:Ex,religion:$x,temperatureCelsius:Ix,government:Ox,country:wi};function ql({topText:e,bottomText:t}){return S.jsxs(Xn,{sx:{display:"flex",flexDirection:"column",alignContent:"center",justifyContent:"center",alignItems:"center",width:"fit-content"},children:[S.jsx(jn,{variant:"body1",sx:{fontWeight:500,fontSize:"1.25rem"},children:e}),S.jsx(jn,{variant:"overline",sx:{lineHeight:1.5},children:t})]})}function Kx({guessesData:e,isWon:t}){const[n,r]=C.useState(!1),o=so.get("statistics")?JSON.parse(so.get("statistics")||"{}"):{won:0,total:0,streak:0,longestStreak:0,distribution:[0,0,0,0,0,0,0],lastDayNumber:0};C.useEffect(()=>{setTimeout(()=>r(!0),2e3),o.lastDayNumber!==Si&&(o.lastDayNumber=Si,o.streak=t?o.streak+1:0,o.longestStreak=Math.max(o.streak,o.longestStreak),o.won+=t?1:0,o.total+=1,o.distribution[e.length-1]+=1,so.set("statistics",JSON.stringify(o),{expires:500}))},[]);const i=()=>{r(!1)};return S.jsx(C.Fragment,{children:S.jsxs(G6,{open:n,onClose:i,TransitionComponent:k_,fullWidth:!0,children:[S.jsxs(Xn,{sx:{display:"flex",flexDirection:"column",alignContent:"center",justifyContent:"center",alignItems:"center",gap:"1rem 0",margin:"1rem 0"},children:[S.jsx(jn,{variant:"h6",sx:{fontWeight:"bold"},children:"Statistics"}),S.jsxs(Xn,{sx:{display:"flex",flexDirection:"row",alignContent:"center",justifyContent:"center",alignItems:"center",gap:"0 7%",width:"80%"},children:[S.jsx(ql,{bottomText:"Played",topText:o.total}),S.jsx(ql,{bottomText:"Win Rate",topText:Math.round(100*o.won/o.total)+"%"}),S.jsx(ql,{bottomText:"Streak",topText:o.streak}),S.jsx(ql,{bottomText:"Longest Streak",topText:o.longestStreak})]})]}),S.jsx(J6,{sx:{display:"flex",flexDirection:"row",alignContent:"center",justifyContent:"center",alignItems:"center",gap:"0 1rem",marginBottom:"1rem"},children:S.jsx(_m,{guessesData:e})})]})})}function yD({guessesData:e}){return S.jsxs(S.Fragment,{children:[S.jsxs(jn,{variant:"body1",children:["You win! The secret country was ",S.jsx("strong",{children:wi}),"!"]}),S.jsx(f_,{style:{position:"absolute",top:"50vh",left:"50vw"},duration:3e3,force:.6}),S.jsx(Kx,{guessesData:e,isWon:!0}),S.jsx(_m,{guessesData:e})]})}function gD({guessesData:e}){return S.jsxs(S.Fragment,{children:[S.jsxs(jn,{variant:"body1",children:["You ran out of guesses! The secret country was ",S.jsx("strong",{children:wi}),"!"]}),S.jsx(Kx,{guessesData:e,isWon:!1}),S.jsx(_m,{guessesData:e})]})}function vD(){const[e,t]=C.useState([]),[n,r]=C.useState(!1),i=7-e.length,a=!n&&i<=0,l=so.get("lastAttempt"),s=so.get("lastAttemptData");C.useEffect(()=>{if(l&&parseInt(l,10)===Si&&s){const c=JSON.parse(s);t(c),r(c.some(d=>d.country.toLowerCase().trim()===wi.toLowerCase().trim()))}},[]),C.useEffect(()=>{(n||a)&&(so.set("lastAttempt",Si.toString(),{expires:1}),so.set("lastAttemptData",JSON.stringify(e),{expires:1}))},[n,a]);const u=c=>{const d=(c||"").toLowerCase().trim(),p=e.some(g=>g.country.toLowerCase()===d);if(d&&!p){const g=Om(c);g.country=c,t(e.concat(g)),d===wi.toLowerCase().trim()&&r(!0)}};return S.jsx("main",{children:S.jsxs(Xn,{sx:{display:"flex",flexDirection:"column",alignContent:"center",justifyContent:"center",alignItems:"center",gap:"3rem 0"},children:[S.jsx(jn,{variant:"h5",sx:{fontWeight:600},children:n||a?S.jsx(S.Fragment,{children:"Come back tomorrow for a new country!"}):S.jsxs(S.Fragment,{children:["Guess which country I'm thinking of! You have ",S.jsx("span",{style:{fontWeight:900},children:i})," guess",i===1?"":"es"," left."]})}),!n&&!a&&S.jsx(ZF,{onSubmit:u}),n&&S.jsx(yD,{guessesData:e}),a&&S.jsx(gD,{guessesData:e}),S.jsx(Vx,{guessesData:e,correctData:hD}),e.length===0&&S.jsx(fD,{})]})})}function pv({sx:e={}}){return S.jsx(cb,{href:`mailto:${atob("aGVsbG9AZ2VvZGxlLm1l")}`,sx:e,children:S.jsx(sb,{})})}function bD(){return S.jsxs("header",{className:"App-header",style:{width:"100%"},children:[S.jsxs(Xn,{sx:{display:"flex",flexDirection:"row",alignContent:"center",justifyContent:"space-between",alignItems:"center",margin:"0 5vw"},children:[S.jsx(pv,{sx:{visibility:"hidden"}}),S.jsx(mD,{}),S.jsx(pv,{})]}),S.jsxs(jn,{variant:"h6",align:"center",sx:{fontWeight:500},children:["A daily Wordle-ish geography game by ",S.jsx(XF,{href:"https://muhashi.github.io",children:"Muhashi"})]})]})}function xD(){return S.jsx(CP,{theme:JF,children:S.jsx("div",{className:"App",children:S.jsxs(Xn,{sx:{display:"flex",flexDirection:"column",alignContent:"center",justifyContent:"center",alignItems:"center",margin:"5vh 0"},children:[S.jsx(bD,{}),S.jsx(vD,{})]})})})}const CD=gd.createRoot(document.getElementById("root"));CD.render(S.jsx(ht.StrictMode,{children:S.jsx(xD,{})}))});export default SD(); +${o}`;navigator.clipboard.writeText(s),n(l.currentTarget)};return S.jsxs(S.Fragment,{children:[S.jsx(Lx,{variant:"contained",onClick:a,type:"button",children:"Share 📋"}),S.jsx(Cx,{open:r,anchorEl:t,onClose:()=>n(null),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:S.jsx(jn,{variant:"body1",sx:{padding:"0.5rem",border:"1px solid #4d4d4d",borderRadius:"4px",userSelect:"none"},children:"Copied results to clipboard"})})]})}function mD(){return S.jsx("div",{className:"title-container",children:S.jsxs(At,{variant:"h1",className:"title-text",children:[S.jsx("span",{children:"G"}),S.jsx("span",{children:"e"}),S.jsx("span",{children:"o"}),S.jsx("span",{children:"d"}),S.jsx("span",{children:"l"}),S.jsx("span",{children:"e"})]})})}const hD={continent:Ax,population:Tx,landlocked:Ex,religion:$x,temperatureCelsius:Ix,government:Ox,country:wi};function ql({topText:e,bottomText:t}){return S.jsxs(Xn,{sx:{display:"flex",flexDirection:"column",alignContent:"center",justifyContent:"center",alignItems:"center",width:"fit-content"},children:[S.jsx(jn,{variant:"body1",sx:{fontWeight:600,fontSize:"1.125rem"},children:e}),S.jsx(jn,{variant:"overline",sx:{lineHeight:1.5,fontSize:"0.75rem"},children:t})]})}function Kx({guessesData:e,isWon:t}){const[n,r]=C.useState(!1),o=so.get("statistics")?JSON.parse(so.get("statistics")||"{}"):{won:0,total:0,streak:0,longestStreak:0,distribution:[0,0,0,0,0,0,0],lastDayNumber:0};C.useEffect(()=>{setTimeout(()=>r(!0),2e3),o.lastDayNumber!==Si&&(o.lastDayNumber=Si,o.streak=t?o.streak+1:0,o.longestStreak=Math.max(o.streak,o.longestStreak),o.won+=t?1:0,o.total+=1,o.distribution[e.length-1]+=1,so.set("statistics",JSON.stringify(o),{expires:500}))},[]);const i=()=>{r(!1)};return S.jsx(C.Fragment,{children:S.jsxs(G6,{open:n,onClose:i,TransitionComponent:k_,fullWidth:!0,children:[S.jsxs(Xn,{sx:{display:"flex",flexDirection:"column",alignContent:"center",justifyContent:"center",alignItems:"center",gap:"1rem 0",margin:"1rem 0"},children:[S.jsx(jn,{variant:"h6",sx:{fontWeight:"bold"},children:"Statistics"}),S.jsxs(Xn,{sx:{display:"flex",flexDirection:"row",alignContent:"center",justifyContent:"center",alignItems:"center",gap:"0 7%",width:"80%"},children:[S.jsx(ql,{bottomText:"Played",topText:o.total}),S.jsx(ql,{bottomText:"Win %",topText:Math.round(100*o.won/o.total)+"%"}),S.jsx(ql,{bottomText:"Streak",topText:o.streak}),S.jsx(ql,{bottomText:"Max Streak",topText:o.longestStreak})]})]}),S.jsx(J6,{sx:{display:"flex",flexDirection:"row",alignContent:"center",justifyContent:"center",alignItems:"center",gap:"0 1rem",marginBottom:"1rem"},children:S.jsx(_m,{guessesData:e})})]})})}function yD({guessesData:e}){return S.jsxs(S.Fragment,{children:[S.jsxs(jn,{variant:"body1",children:["You win! The secret country was ",S.jsx("strong",{children:wi}),"!"]}),S.jsx(f_,{style:{position:"absolute",top:"50vh",left:"50vw"},duration:3e3,force:.6}),S.jsx(Kx,{guessesData:e,isWon:!0}),S.jsx(_m,{guessesData:e})]})}function gD({guessesData:e}){return S.jsxs(S.Fragment,{children:[S.jsxs(jn,{variant:"body1",children:["You ran out of guesses! The secret country was ",S.jsx("strong",{children:wi}),"!"]}),S.jsx(Kx,{guessesData:e,isWon:!1}),S.jsx(_m,{guessesData:e})]})}function vD(){const[e,t]=C.useState([]),[n,r]=C.useState(!1),i=7-e.length,a=!n&&i<=0,l=so.get("lastAttempt"),s=so.get("lastAttemptData");C.useEffect(()=>{if(l&&parseInt(l,10)===Si&&s){const c=JSON.parse(s);t(c),r(c.some(d=>d.country.toLowerCase().trim()===wi.toLowerCase().trim()))}},[]),C.useEffect(()=>{(n||a)&&(so.set("lastAttempt",Si.toString(),{expires:1}),so.set("lastAttemptData",JSON.stringify(e),{expires:1}))},[n,a]);const u=c=>{const d=(c||"").toLowerCase().trim(),p=e.some(g=>g.country.toLowerCase()===d);if(d&&!p){const g=Om(c);g.country=c,t(e.concat(g)),d===wi.toLowerCase().trim()&&r(!0)}};return S.jsx("main",{children:S.jsxs(Xn,{sx:{display:"flex",flexDirection:"column",alignContent:"center",justifyContent:"center",alignItems:"center",gap:"3rem 0"},children:[S.jsx(jn,{variant:"h5",sx:{fontWeight:600},children:n||a?S.jsx(S.Fragment,{children:"Come back tomorrow for a new country!"}):S.jsxs(S.Fragment,{children:["Guess which country I'm thinking of! You have ",S.jsx("span",{style:{fontWeight:900},children:i})," guess",i===1?"":"es"," left."]})}),!n&&!a&&S.jsx(ZF,{onSubmit:u}),n&&S.jsx(yD,{guessesData:e}),a&&S.jsx(gD,{guessesData:e}),S.jsx(Vx,{guessesData:e,correctData:hD}),e.length===0&&S.jsx(fD,{})]})})}function pv({sx:e={}}){return S.jsx(cb,{href:`mailto:${atob("aGVsbG9AZ2VvZGxlLm1l")}`,sx:e,children:S.jsx(sb,{})})}function bD(){return S.jsxs("header",{className:"App-header",style:{width:"100%"},children:[S.jsxs(Xn,{sx:{display:"flex",flexDirection:"row",alignContent:"center",justifyContent:"space-between",alignItems:"center",margin:"0 5vw"},children:[S.jsx(pv,{sx:{visibility:"hidden"}}),S.jsx(mD,{}),S.jsx(pv,{})]}),S.jsxs(jn,{variant:"h6",align:"center",sx:{fontWeight:500},children:["A daily Wordle-ish geography game by ",S.jsx(XF,{href:"https://muhashi.github.io",children:"Muhashi"})]})]})}function xD(){return S.jsx(CP,{theme:JF,children:S.jsx("div",{className:"App",children:S.jsxs(Xn,{sx:{display:"flex",flexDirection:"column",alignContent:"center",justifyContent:"center",alignItems:"center",margin:"5vh 0"},children:[S.jsx(bD,{}),S.jsx(vD,{})]})})})}const CD=gd.createRoot(document.getElementById("root"));CD.render(S.jsx(ht.StrictMode,{children:S.jsx(xD,{})}))});export default SD(); diff --git a/index.html b/index.html index b5d438a..f994b60 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@ gtag('config', 'G-RKEL5SMCTC'); - +