diff --git a/assets/index-Z1lcrCWw.js b/assets/index-HBRUUCdX.js similarity index 87% rename from assets/index-Z1lcrCWw.js rename to assets/index-HBRUUCdX.js index af5dbc4..37e19f9 100644 --- a/assets/index-Z1lcrCWw.js +++ b/assets/index-HBRUUCdX.js @@ -65,4 +65,4 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ni(){return Ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function fm(e){let{fallbackElement:t,router:n,future:r}=e,[l,i]=C.useState(n.state),[o,a]=C.useState(),[s,u]=C.useState({isTransitioning:!1}),[c,p]=C.useState(),[h,k]=C.useState(),[S,g]=C.useState(),x=C.useRef(new Map),{v7_startTransition:d}=r||{},f=C.useCallback(_=>{d?cm(_):_()},[d]),m=C.useCallback((_,L)=>{let{deletedFetchers:z,unstable_flushSync:I,unstable_viewTransitionOpts:q}=L;z.forEach(W=>x.current.delete(W)),_.fetchers.forEach((W,oe)=>{W.data!==void 0&&x.current.set(oe,W.data)});let B=n.window==null||typeof n.window.document.startViewTransition!="function";if(!q||B){I?Lr(()=>i(_)):f(()=>i(_));return}if(I){Lr(()=>{h&&(c&&c.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:q.currentLocation,nextLocation:q.nextLocation})});let W=n.window.document.startViewTransition(()=>{Lr(()=>i(_))});W.finished.finally(()=>{Lr(()=>{p(void 0),k(void 0),a(void 0),u({isTransitioning:!1})})}),Lr(()=>k(W));return}h?(c&&c.resolve(),h.skipTransition(),g({state:_,currentLocation:q.currentLocation,nextLocation:q.nextLocation})):(a(_),u({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}))},[n.window,h,c,x,f]);C.useLayoutEffect(()=>n.subscribe(m),[n,m]),C.useEffect(()=>{s.isTransitioning&&!s.flushSync&&p(new dm)},[s]),C.useEffect(()=>{if(c&&o&&n.window){let _=o,L=c.promise,z=n.window.document.startViewTransition(async()=>{f(()=>i(_)),await L});z.finished.finally(()=>{p(void 0),k(void 0),a(void 0),u({isTransitioning:!1})}),k(z)}},[f,o,c,n.window]),C.useEffect(()=>{c&&o&&l.location.key===o.location.key&&c.resolve()},[c,h,l.location,o]),C.useEffect(()=>{!s.isTransitioning&&S&&(a(S.state),u({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),g(void 0))},[s.isTransitioning,S]),C.useEffect(()=>{},[]);let P=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:_=>n.navigate(_),push:(_,L,z)=>n.navigate(_,{state:L,preventScrollReset:z==null?void 0:z.preventScrollReset}),replace:(_,L,z)=>n.navigate(_,{replace:!0,state:L,preventScrollReset:z==null?void 0:z.preventScrollReset})}),[n]),R=n.basename||"/",v=C.useMemo(()=>({router:n,navigator:P,static:!1,basename:R}),[n,P,R]);return C.createElement(C.Fragment,null,C.createElement(Wi.Provider,{value:v},C.createElement(Zf.Provider,{value:l},C.createElement(am.Provider,{value:x.current},C.createElement(om.Provider,{value:s},C.createElement(tm,{basename:R,location:l.location,navigationType:l.historyAction,navigator:P,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},l.initialized||n.future.v7_partialHydration?C.createElement(pm,{routes:n.routes,future:n.future,state:l}):t))))),null)}function pm(e){let{routes:t,future:n,state:r}=e;return H2(t,void 0,r,n)}var gc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(gc||(gc={}));var yc;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(yc||(yc={}));function Pi(){return Pi=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[l]=e[l]);return n}function La(e,t){return La=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,l){return r.__proto__=l,r},La(e,t)}function js(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,La(e,t)}function hm(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function mm(e,t){e.classList?e.classList.add(t):hm(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function wc(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function vm(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=wc(e.className,t):e.setAttribute("class",wc(e.className&&e.className.baseVal||"",t))}const xc={disabled:!1},_i=Ye.createContext(null);var n0=function(t){return t.scrollTop},Fr="unmounted",pn="exited",hn="entering",In="entered",ja="exiting",Ot=function(e){js(t,e);function t(r,l){var i;i=e.call(this,r,l)||this;var o=l,a=o&&!o.isMounting?r.enter:r.appear,s;return i.appearStatus=null,r.in?a?(s=pn,i.appearStatus=hn):s=In:r.unmountOnExit||r.mountOnEnter?s=Fr:s=pn,i.state={status:s},i.nextCallback=null,i}t.getDerivedStateFromProps=function(l,i){var o=l.in;return o&&i.status===Fr?{status:pn}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(l){var i=null;if(l!==this.props){var o=this.state.status;this.props.in?o!==hn&&o!==In&&(i=hn):(o===hn||o===In)&&(i=ja)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var l=this.props.timeout,i,o,a;return i=o=a=l,l!=null&&typeof l!="number"&&(i=l.exit,o=l.enter,a=l.appear!==void 0?l.appear:o),{exit:i,enter:o,appear:a}},n.updateStatus=function(l,i){if(l===void 0&&(l=!1),i!==null)if(this.cancelNextCallback(),i===hn){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Or.findDOMNode(this);o&&n0(o)}this.performEnter(l)}else this.performExit();else this.props.unmountOnExit&&this.state.status===pn&&this.setState({status:Fr})},n.performEnter=function(l){var i=this,o=this.props.enter,a=this.context?this.context.isMounting:l,s=this.props.nodeRef?[a]:[Or.findDOMNode(this),a],u=s[0],c=s[1],p=this.getTimeouts(),h=a?p.appear:p.enter;if(!l&&!o||xc.disabled){this.safeSetState({status:In},function(){i.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:hn},function(){i.props.onEntering(u,c),i.onTransitionEnd(h,function(){i.safeSetState({status:In},function(){i.props.onEntered(u,c)})})})},n.performExit=function(){var l=this,i=this.props.exit,o=this.getTimeouts(),a=this.props.nodeRef?void 0:Or.findDOMNode(this);if(!i||xc.disabled){this.safeSetState({status:pn},function(){l.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:ja},function(){l.props.onExiting(a),l.onTransitionEnd(o.exit,function(){l.safeSetState({status:pn},function(){l.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(l,i){i=this.setNextCallback(i),this.setState(l,i)},n.setNextCallback=function(l){var i=this,o=!0;return this.nextCallback=function(a){o&&(o=!1,i.nextCallback=null,l(a))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},n.onTransitionEnd=function(l,i){this.setNextCallback(i);var o=this.props.nodeRef?this.props.nodeRef.current:Or.findDOMNode(this),a=l==null&&!this.props.addEndListener;if(!o||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],u=s[0],c=s[1];this.props.addEndListener(u,c)}l!=null&&setTimeout(this.nextCallback,l)},n.render=function(){var l=this.state.status;if(l===Fr)return null;var i=this.props,o=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=Ls(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ye.createElement(_i.Provider,{value:null},typeof o=="function"?o(l,a):Ye.cloneElement(Ye.Children.only(o),a))},t}(Ye.Component);Ot.contextType=_i;Ot.propTypes={};function On(){}Ot.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:On,onEntering:On,onEntered:On,onExit:On,onExiting:On,onExited:On};Ot.UNMOUNTED=Fr;Ot.EXITED=pn;Ot.ENTERING=hn;Ot.ENTERED=In;Ot.EXITING=ja;const gm=Ot;var ym=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return mm(t,r)})},Lo=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return vm(t,r)})},Ds=function(e){js(t,e);function t(){for(var r,l=arguments.length,i=new Array(l),o=0;ot?e:t+1}var Lm=fl.exports;const xt=Da(Lm),jm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M784-120%20532-372q-30%2024-69%2038t-83%2014q-109%200-184.5-75.5T120-580q0-109%2075.5-184.5T380-840q109%200%20184.5%2075.5T640-580q0%2044-14%2083t-38%2069l252%20252-56%2056ZM380-400q75%200%20127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75%200-127.5%2052.5T200-580q0%2075%2052.5%20127.5T380-400Z'/%3e%3c/svg%3e",i0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20style='margin:%20auto;%20background:%20none;%20display:%20block;%20shape-rendering:%20auto;%20animation-play-state:%20running;%20animation-delay:%200s;'%20width='200px'%20height='200px'%20viewBox='0%200%20100%20100'%20preserveAspectRatio='xMidYMid'%3e%3ccircle%20cx='50'%20cy='50'%20fill='none'%20stroke='%23bfbfbf'%20stroke-width='10'%20r='35'%20stroke-dasharray='164.93361431346415%2056.97787143782138'%20style='animation-play-state:%20running;%20animation-delay:%200s;'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20repeatCount='indefinite'%20dur='1s'%20values='0%2050%2050;360%2050%2050'%20keyTimes='0;1'%20style='animation-play-state:%20running;%20animation-delay:%200s;'%3e%3c/animateTransform%3e%3c/circle%3e%3c!--%20[ldio]%20generated%20by%20https://loading.io/%20--%3e%3c/svg%3e";function Dm({gameTitle:e,gameImage:t,onClick:n}){return w.jsxs("div",{className:"search-bar-result",onClick:n,children:[w.jsx("img",{className:"search-bar-game-image",src:t,onClick:n}),w.jsx("h3",{className:"search-bar-game-title",onClick:n,children:e})]})}function Mm({navigate:e,handleStoreData:t,onStorePage:n,onSectionChange:r,handleSearched:l,handleClickedSearch:i}){const[o,a]=C.useState(""),[s,u]=C.useState([]),[c,p]=C.useState(!1),[h,k]=C.useState(!1),S=C.useRef(!1),g="abd1d4cf1d5944b3903754265695d018";C.useEffect(()=>{const R=v=>{const _=document.querySelector(".search-area"),L=document.querySelector(".search-results");_&&!_.contains(v.target)&&L&&!L.contains(v.target)&&k(!1)};return document.addEventListener("click",R),()=>{document.removeEventListener("click",R)}},[]);function x(R){a(R.target.value),sessionStorage.setItem("searchInputValue",R.target.value)}C.useEffect(()=>{a(sessionStorage.getItem("searchInputValue")||"");const R=sessionStorage.getItem("searchData");R&&u(JSON.parse(R)),n&&R&&(t(JSON.parse(R)),r(`Search results for "${sessionStorage.getItem("searchInputValue")}"`))},[]),C.useEffect(()=>{const R=setTimeout(()=>{o&&S.current&&d(o),o||u([]),S.current=!0},500);return()=>clearTimeout(R)},[o]);async function d(R){p(!0);const v=await fetch(`https://api.rawg.io/api/games?key=${g}&search=${R}&search_exact=true&ordering=-added&exclude_additions=true`);if(!v.ok)throw new Error("server error");const _=await v.json();p(!1),u(_.results),sessionStorage.setItem("searchData",JSON.stringify(_.results))}function f(R){R.key=="Enter"&&s.length>0&&(n?c||(t(s),r(`Search results for "${o}"`)):(l(!0),e()))}function m(){n?c||(t(s),r(`Search results for "${o}"`)):(l(!0),e())}function P(R){R.currentTarget.outerText!=""&&i(R.currentTarget.outerText),n?(t(s),r(`Search results for "${o}"`)):(l(!0),e()),k(!1)}return w.jsxs("div",{className:"search-bar",onClick:()=>k(!0),children:[w.jsxs("div",{className:"search-area",children:[w.jsx("input",{type:"text",placeholder:"Search games...",value:o,onChange:x,onKeyDown:f}),w.jsx("button",{id:"search-button",onClick:m,children:w.jsx("img",{id:"search-icon",src:jm,alt:"search icon"})})]}),w.jsx("div",{className:`search-results ${h?"":"hidden"}`,children:!c&&s.map(R=>w.jsx(Dm,{gameTitle:R.name,gameImage:R.background_image,onClick:P},xt()))}),c&&w.jsx("div",{className:"search-results loading",children:w.jsx("img",{id:"loading-icon",src:i0,alt:"loading icon"})})]})}const zm="/game-haven/assets/logo-IYppaM25.png",Om="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M280-80q-33%200-56.5-23.5T200-160q0-33%2023.5-56.5T280-240q33%200%2056.5%2023.5T360-160q0%2033-23.5%2056.5T280-80Zm400%200q-33%200-56.5-23.5T600-160q0-33%2023.5-56.5T680-240q33%200%2056.5%2023.5T760-160q0%2033-23.5%2056.5T680-80ZM246-720l96%20200h280l110-200H246Zm-38-80h590q23%200%2035%2020.5t1%2041.5L692-482q-11%2020-29.5%2031T622-440H324l-44%2080h480v80H280q-45%200-68-39.5t-2-78.5l54-98-144-304H40v-80h130l38%2080Zm134%20280h280-280Z'/%3e%3c/svg%3e";function o0({navigate:e,onStorePage:t,handleStoreData:n,onSectionChange:r,handleSearched:l,handleShowCart:i,handleClickedSearch:o}){return w.jsxs("nav",{className:"nav-bar",children:[w.jsxs("a",{className:"game-haven",href:"/",children:[w.jsx("img",{id:"game-haven-logo",src:zm,alt:"game haven logo"}),w.jsx("h2",{id:"game-haven-text",children:"Game Haven"})]}),w.jsx(Mm,{navigate:e,onStorePage:t,handleStoreData:n,onSectionChange:r,handleSearched:l,handleClickedSearch:o}),w.jsx("button",{className:"shopping-cart-button",onClick:()=>i(!0),children:w.jsx("img",{id:"shopping-cart-icon",src:Om,alt:"shopping cart icon"})})]})}function Fm({gameInfo:e,deleteFromCart:t}){return w.jsxs("div",{className:"cart-game",children:[w.jsx("img",{className:"cart-game-image",src:e.background_image}),w.jsxs("div",{className:"cart-game-info",children:[w.jsx("h3",{className:"cart-game-title",children:e.name}),w.jsx("p",{className:"cart-game-price",children:e.price||e.discountedPrice||e.originalPrice})]}),w.jsx("button",{className:"remove-game-button",onClick:()=>t(e),children:"x"})]})}function Im({isOpen:e,totalItems:t,totalPrice:n}){return e?w.jsx("div",{className:"checkout-modal-background",children:w.jsxs("div",{className:"checkout-modal",children:[w.jsx("h2",{children:"Checkout Successful!"}),w.jsx("div",{className:"checkmark",children:"✓"}),w.jsx("p",{children:`You bought ${t} item(s) for $${n.toFixed(2)}`})]})}):null}function a0({cartInfo:e,handleShowCart:t,deleteFromCart:n,clearCart:r}){const[l,i]=C.useState(!1);function o(c){c.stopPropagation()}const a=e.reduce((c,p)=>p.price!=null?c+parseFloat(p.price.replace("$","")):p.discountedPrice!=null?c+parseFloat(p.discountedPrice.replace("$","")):p.originalPrice!=null?c+parseFloat(p.originalPrice.replace("$","")):c,0);function s(){i(!0),setTimeout(()=>{u(),t(!1)},3e3)}function u(){i(!1),r()}return w.jsxs(w.Fragment,{children:[!l&&w.jsx("div",{className:"cart-background",onClick:()=>t(!1),children:w.jsxs("div",{className:"cart",onClick:o,children:[w.jsxs("div",{className:"cart-header",children:[w.jsx("h2",{children:`${e.length} Games`}),w.jsx("button",{id:"clear-cart-button",onClick:r,children:"Clear"})]}),w.jsx("div",{className:"cart-games",children:e.map(c=>w.jsx(Fm,{gameInfo:c,deleteFromCart:n},c.id))}),w.jsxs("div",{className:"cart-footer",children:[w.jsx("h3",{id:"cart-total",children:`$${a.toFixed(2)}`}),e.length>0&&w.jsx("button",{id:"cart-checkout-button",onClick:s,children:"Checkout"})]})]})}),w.jsx(Im,{isOpen:l,totalItems:e.length,totalPrice:a})]})}const Um="/game-haven/assets/background-video-eodPu5GI.mp4",Am="data:image/svg+xml,%3csvg%20width='98'%20height='96'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M48.854%200C21.839%200%200%2022%200%2049.217c0%2021.756%2013.993%2040.172%2033.405%2046.69%202.427.49%203.316-1.059%203.316-2.362%200-1.141-.08-5.052-.08-9.127-13.59%202.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015%204.934.326%207.523%205.052%207.523%205.052%204.367%207.496%2011.404%205.378%2014.235%204.074.404-3.178%201.699-5.378%203.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283%200-5.378%201.94-9.778%205.014-13.2-.485-1.222-2.184-6.275.486-13.038%200%200%204.125-1.304%2013.426%205.052a46.97%2046.97%200%200%201%2012.214-1.63c4.125%200%208.33.571%2012.213%201.63%209.302-6.356%2013.427-5.052%2013.427-5.052%202.67%206.763.97%2011.816.485%2013.038%203.155%203.422%205.015%207.822%205.015%2013.2%200%2018.905-11.404%2023.06-22.324%2024.283%201.78%201.548%203.316%204.481%203.316%209.126%200%206.6-.08%2011.897-.08%2013.526%200%201.304.89%202.853%203.316%202.364%2019.412-6.52%2033.405-24.935%2033.405-46.691C97.707%2022%2075.788%200%2048.854%200z'%20fill='%2324292f'/%3e%3c/svg%3e";function $m({handleSearched:e,cartInfo:t,showCart:n,handleShowCart:r,deleteFromCart:l,clearCart:i,handleClickedSearch:o}){const a=B2();return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"home-page",children:[w.jsx(o0,{navigate:()=>a("/store"),handleSearched:e,handleShowCart:r,handleClickedSearch:o}),n&&w.jsx(a0,{cartInfo:t,handleShowCart:r,deleteFromCart:l,clearCart:i}),w.jsxs("div",{className:"home-page-content",children:[w.jsxs("div",{className:"welcome",children:[w.jsx("h1",{children:"Game Haven"}),w.jsx("p",{children:"An imitation of a real online game store."}),w.jsxs("a",{className:"github-redir",href:"https://github.com/yari-dewalt",children:[w.jsx("img",{src:Am,alt:"github icon"}),w.jsx("p",{children:"yari-dewalt"})]})]}),w.jsx("a",{className:"to-store",href:"store",children:"To Store →"})]})]}),w.jsx("video",{className:"background-video",autoPlay:!0,loop:!0,muted:!0,children:w.jsx("source",{src:Um,type:"video/mp4"})})]})}const Bm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20640%20512'%3e%3cpath%20d='M528%20448H112c-8.8%200-16%207.2-16%2016v32c0%208.8%207.2%2016%2016%2016h416c8.8%200%2016-7.2%2016-16v-32c0-8.8-7.2-16-16-16zm64-320c-26.5%200-48%2021.5-48%2048%200%207.1%201.6%2013.7%204.4%2019.8L476%20239.2c-15.4%209.2-35.3%204-44.2-11.6L350.3%2085C361%2076.2%20368%2063%20368%2048c0-26.5-21.5-48-48-48s-48%2021.5-48%2048c0%2015%207%2028.2%2017.7%2037l-81.5%20142.6c-8.9%2015.6-28.9%2020.8-44.2%2011.6l-72.3-43.4c2.7-6%204.4-12.7%204.4-19.8%200-26.5-21.5-48-48-48S0%20149.5%200%20176s21.5%2048%2048%2048c2.6%200%205.2-.4%207.7-.8L128%20416h384l72.3-192.8c2.5.4%205.1.8%207.7.8%2026.5%200%2048-21.5%2048-48s-21.5-48-48-48z'/%3e%3c/svg%3e%3c!--%20Font%20Awesome%20Free%205.2.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20(Icons:%20CC%20BY%204.0,%20Fonts:%20SIL%20OFL%201.1,%20Code:%20MIT%20License)%20--%3e",Vm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M160-400q0-105%2050-187t110-138q60-56%20110-85.5l50-29.5v132q0%2037%2025%2058.5t56%2021.5q17%200%2032.5-7t28.5-23l18-22q72%2042%20116%20116.5T800-400q0%2088-43%20160.5T644-125q17-24%2026.5-52.5T680-238q0-40-15-75.5T622-377L480-516%20339-377q-29%2029-44%2064t-15%2075q0%2032%209.5%2060.5T316-125q-70-42-113-114.5T160-400Zm320-4%2085%2083q17%2017%2026%2038t9%2045q0%2049-35%2083.5T480-120q-50%200-85-34.5T360-238q0-23%209-44.5t26-38.5l85-83Z'/%3e%3c/svg%3e",Hm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='m233-80%2065-281L80-550l288-25%20112-265%20112%20265%20288%2025-218%20189%2065%20281-247-149L233-80Z'/%3e%3c/svg%3e",Wm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='m136-240-56-56%20296-298%20160%20160%20208-206H640v-80h240v240h-80v-104L536-320%20376-480%20136-240Z'/%3e%3c/svg%3e",Qm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M280-120v-80h160v-124q-49-11-87.5-41.5T296-442q-75-9-125.5-65.5T120-640v-40q0-33%2023.5-56.5T200-760h80v-80h400v80h80q33%200%2056.5%2023.5T840-680v40q0%2076-50.5%20132.5T664-442q-18%2046-56.5%2076.5T520-324v124h160v80H280Zm0-408v-152h-80v40q0%2038%2022%2068.5t58%2043.5Zm400%200q36-13%2058-43.5t22-68.5v-40h-80v152Z'/%3e%3c/svg%3e",Km="/game-haven/assets/fireworks-gM7YNbWU.svg";function Ym({handleLoading:e,onApiData:t,onSectionChange:n,searched:r}){const l=C.useRef(null);C.useEffect(()=>{r?s():l.current&&l.current.click()},[r]),C.useEffect(()=>{document.getElementById("header-text")&&document.getElementById("header-text").textContent.includes("Search")&&s()},[n]);const i="abd1d4cf1d5944b3903754265695d018";async function o(g,x){e(!0),a(g);const d=await fetch(`https://api.rawg.io/api/games?key=${i}${x}&exclude_additions=true`);if(!d.ok)throw new Error("server error");const f=await d.json();t(f.results),n(g.target.textContent),e(!1)}function a(g){Array.from(g.currentTarget.offsetParent.children).forEach(x=>{Array.from(x.children).forEach(d=>{d.className.includes("selected")&&(d.className="nav-bar-item")})}),g.currentTarget.className+=" selected"}function s(){document.querySelectorAll(".nav-bar-item").forEach(x=>{x.className="nav-bar-item"})}async function u(g){o(g,"&ordering=-added")}async function c(g){o(g,"&ordering=-updated")}async function p(g){o(g,"&dates=2023-01-01,2023-12-31&ordering=-added")}async function h(g){const x=new Date,d=`${x.getFullYear()}-${(x.getMonth()+1).toString().padStart(2,"0")}-${x.getDate().toString().padStart(2,"0")}`;o(g,`&dates=2024-01-01,${d}&ordering=-added`)}async function k(g){const x=new Date,d=new Date(x);d.setDate(d.getDate()-31);const f=`${d.getFullYear()}-${(d.getMonth()+1).toString().padStart(2,"0")}-${d.getDate().toString().padStart(2,"0")}`,m=`${x.getFullYear()}-${(x.getMonth()+1).toString().padStart(2,"0")}-${x.getDate().toString().padStart(2,"0")}`;o(g,`&dates=${f},${m}&ordering=-added`)}async function S(g){const x=new Date,d=new Date(x);d.setDate(d.getDate()-7);const f=`${d.getFullYear()}-${(d.getMonth()+1).toString().padStart(2,"0")}-${d.getDate().toString().padStart(2,"0")}`,m=`${x.getFullYear()}-${(x.getMonth()+1).toString().padStart(2,"0")}-${x.getDate().toString().padStart(2,"0")}`;o(g,`&dates=${f},${m}&ordering=-added`)}return w.jsxs("nav",{className:"side-nav-bar",children:[w.jsxs("div",{className:"top-list",children:[w.jsx("div",{className:"list-header",children:w.jsx("h2",{children:"Top"})}),w.jsxs("div",{className:"nav-bar-item",onClick:c,ref:l,children:[w.jsx("img",{id:"fireworks-icon",src:Km,alt:"featured icon"}),w.jsx("h3",{children:"Featured"})]}),w.jsxs("div",{className:"nav-bar-item",onClick:h,children:[w.jsx("img",{src:Qm,alt:"trophy icon"}),w.jsx("h3",{children:"Best of the year"})]}),w.jsxs("div",{className:"nav-bar-item",onClick:p,children:[w.jsx("img",{src:Wm,alt:"trending icon"}),w.jsx("h3",{children:"Popular in 2023"})]}),w.jsxs("div",{className:"nav-bar-item",onClick:u,children:[w.jsx("img",{src:Bm,alt:"crown icon"}),w.jsx("h3",{children:"All time top"})]})]}),w.jsxs("div",{className:"new-releases",children:[w.jsx("div",{className:"list-header",children:w.jsx("h2",{children:"New Releases"})}),w.jsxs("div",{className:"nav-bar-item",onClick:k,children:[w.jsx("img",{src:Hm,alt:"star icon"}),w.jsx("h3",{children:"Last 30 days"})]}),w.jsxs("div",{className:"nav-bar-item",onClick:S,children:[w.jsx("img",{src:Vm,alt:"fire icon"}),w.jsx("h3",{children:"This week"})]})]})]})}const Gm="/game-haven/assets/playstation-2aJHXBDn.svg",qm="data:image/svg+xml,%3c!--%20Created%20with%20Inkscape%20(http://www.inkscape.org/)%20--%3e%3csvg%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:svg='http://www.w3.org/2000/svg'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20id='svg4136'%20version='1.1'%20inkscape:version='0.91pre4%20r13712'%20width='372.36823'%20height='372.57281'%20viewBox='0%200%20372.36823%20372.57281'%20sodipodi:docname='Xbox%20Logo.svg'%3e%3ctitle%20id='title4166'%3eXbox%20Logo%3c/title%3e%3cmetadata%20id='metadata4142'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3cdc:title%3eXbox%20Logo%3c/dc:title%3e%3c/cc:Work%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%20id='defs4140'%20/%3e%3csodipodi:namedview%20pagecolor='%23ffffff'%20bordercolor='%23666666'%20borderopacity='1'%20objecttolerance='10'%20gridtolerance='10'%20guidetolerance='10'%20inkscape:pageopacity='0'%20inkscape:pageshadow='2'%20inkscape:window-width='1920'%20inkscape:window-height='1017'%20id='namedview4138'%20showgrid='false'%20inkscape:zoom='2.2378738'%20inkscape:cx='120.11921'%20inkscape:cy='190.18765'%20inkscape:window-x='-8'%20inkscape:window-y='-8'%20inkscape:window-maximized='1'%20inkscape:current-layer='g4146'%20fit-margin-top='0'%20fit-margin-left='0'%20fit-margin-right='0'%20fit-margin-bottom='0'%20/%3e%3cg%20id='g4146'%20transform='translate(-1.5706619,12.357467)'%3e%3cpath%20style='fill:%23000000'%20d='M%20169.18811,359.44924%20C%20140.50497,356.70211%20111.4651,346.40125%2086.518706,330.1252%2065.614374,316.48637%2060.893704,310.87967%2060.893704,299.69061%20c%200,-22.47524%2024.711915,-61.84014%2066.992496,-106.71584%2024.01246,-25.48631%2057.46022,-55.36001%2061.0775,-54.55105%207.0309,1.57238%2063.25048,56.41053%2084.29655,82.2252%2033.28077,40.82148%2048.58095,74.24535%2040.808,89.14682%20-5.9087,11.32753%20-42.57224,33.4669%20-69.50775,41.97242%20-22.19984,7.01011%20-51.35538,9.9813%20-75.37239,7.68108%20z%20M%2032.660004,276.3228%20C%2015.288964,249.67326%206.5125436,223.43712%202.2752336,185.49086%20c%20-1.39917002,-12.53%20-0.89778,-19.69701%203.17715,-45.41515%205.0788204,-32.05404%2023.3330104,-69.136381%2045.2671304,-91.957616%209.34191,-9.719732%2010.17624,-9.956543%2021.56341,-6.120482%2013.828357,4.658436%2028.595936,14.857457%2051.498366,35.56661%20l%2013.36254,12.082873%20-7.2969,8.96431%20C%2095.97448,140.22403%2060.217254,199.2085%2046.741444,235.70071%20c%20-7.32599,19.83862%20-10.28084,39.75281%20-7.12868,48.04363%202.12818,5.59752%200.17339,3.51093%20-6.95276,-7.42154%20z%20m%20304.915426,4.53255%20c%201.71605,-8.37719%20-0.4544,-23.76257%20-5.5413,-39.28002%20-11.01667,-33.60598%20-47.83964,-96.12421%20-81.65282,-138.63054%20L%20239.73699,89.563875%20251.25285,78.989784%20c%2015.03631,-13.806637%2025.47602,-22.073835%2036.74025,-29.094513%208.88881,-5.540156%2021.59109,-10.444558%2027.05113,-10.444558%203.36626,0%2015.21723,12.298726%2024.78421,25.720611%2014.81725,20.787711%2025.71782,45.986976%2031.24045,72.219686%203.56833,16.9498%203.8657,53.23126%200.57486,70.13935%20-2.70068,13.87582%20-8.40314,31.87484%20-13.9661,44.08195%20-4.16823,9.14657%20-14.53521,26.91044%20-19.0783,32.69074%20-2.33569,2.97175%20-2.33761,2.96527%20-1.02393,-3.4477%20z%20M%20172.25917,33.104812%20c%20-15.60147,-7.922671%20-39.6696,-16.427164%20-52.96493,-18.715209%20-4.66097,-0.802124%20-12.61193,-1.249474%20-17.6688,-0.994114%20-10.969613,0.55394%20-10.479662,-0.0197%207.11783,-8.3336652%2014.63023,-6.912081%2026.83386,-10.976696%2043.40044,-14.455218%2018.6362,-3.9130858%2053.66559,-3.9590088%2072.00507,-0.0944%2019.80818,4.174105%2043.13297,12.854085%2056.27623,20.9423862%20l%203.90633,2.403927%20-8.96247,-0.452584%20c%20-17.81002,-0.899366%20-43.76575,6.295879%20-71.63269,19.857459%20-8.40538,4.090523%20-15.71788,7.357511%20-16.25,7.25997%20-0.53211,-0.09754%20-7.38426,-3.43589%20-15.22701,-7.418555%20z'%20id='path4148'%20inkscape:connector-curvature='0'%20/%3e%3c/g%3e%3c/svg%3e",Zm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='88'%20width='88'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20d='M0%2012.402l35.687-4.86.016%2034.423-35.67.203zm35.67%2033.529l.028%2034.453L.028%2075.48.026%2045.7zm4.326-39.025L87.314%200v41.527l-47.318.376zm47.329%2039.349l-.011%2041.34-47.318-6.678-.066-34.739z'%20fill='%230078d6'/%3e%3c/svg%3e",Xm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20width='814'%20height='1000'%3e%3cpath%20d='M788.1%20340.9c-5.8%204.5-108.2%2062.2-108.2%20190.5%200%20148.4%20130.3%20200.9%20134.2%20202.2-.6%203.2-20.7%2071.9-68.7%20141.9-42.8%2061.6-87.5%20123.1-155.5%20123.1s-85.5-39.5-164-39.5c-76.5%200-103.7%2040.8-165.9%2040.8s-105.6-57-155.5-127C46.7%20790.7%200%20663%200%20541.8c0-194.4%20126.4-297.5%20250.8-297.5%2066.1%200%20121.2%2043.4%20162.7%2043.4%2039.5%200%20101.1-46%20176.3-46%2028.5%200%20130.9%202.6%20198.3%2099.2zm-234-181.5c31.1-36.9%2053.1-88.1%2053.1-139.3%200-7.1-.6-14.3-1.9-20.1-50.6%201.9-110.8%2033.7-147.1%2075.8-28.5%2032.4-55.1%2083.6-55.1%20135.5%200%207.8%201.3%2015.6%201.9%2018.1%203.2.6%208.4%201.3%2013.6%201.3%2045.4%200%20102.5-30.4%20135.5-71.3z'/%3e%3c/svg%3e",Jm="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%2020010904//EN'%20'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'%3e%3csvg%20version='1.0'%20xmlns='http://www.w3.org/2000/svg'%20width='550.000000pt'%20height='550.000000pt'%20viewBox='0%200%20550.000000%20550.000000'%20preserveAspectRatio='xMidYMid%20meet'%3e%3cmetadata%3e%20Created%20by%20potrace%201.13,%20written%20by%20Peter%20Selinger%202001-2015%20%3c/metadata%3e%3cg%20transform='translate(0.000000,550.000000)%20scale(0.100000,-0.100000)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M1365%205154%20c-481%20-86%20-868%20-442%20-990%20-910%20-44%20-169%20-47%20-268%20-42%20-1579%203%20-1204%204%20-1232%2024%20-1325%20111%20-501%20467%20-858%20973%20-976%2066%20-15%20150%20-18%20691%20-21%20560%20-4%20618%20-3%20633%2012%2015%2015%2016%20208%2016%202396%200%201622%20-3%202386%20-10%202400%20-10%2018%20-27%2019%20-613%2018%20-476%20-1%20-619%20-4%20-682%20-15z%20m905%20-2400%20l0%20-2026%20-407%205%20c-375%204%20-415%206%20-490%2025%20-322%2083%20-561%20331%20-628%20654%20-22%20101%20-22%202589%20-1%202688%2060%20281%20255%20514%20518%20619%20132%2053%20193%2059%20621%2060%20l387%201%200%20-2026z'/%3e%3cpath%20d='M1451%204169%20c-63%20-12%20-159%20-60%20-210%20-105%20-105%20-91%20-157%20-220%20-149%20-372%204%20-79%209%20-100%2041%20-164%2047%20-97%20118%20-168%20215%20-216%2067%20-33%2084%20-37%20171%20-40%2079%20-3%20107%200%20160%2018%20217%2073%20348%20284%20311%20500%20-43%20257%20-287%20429%20-539%20379z'/%3e%3cpath%20d='M3157%205163%20c-4%20-3%20-7%20-1087%20-7%20-2409%200%20-2181%201%20-2402%2016%20-2408%2027%20-10%20803%20-6%20899%204%20406%2046%20764%20293%20959%20660%2025%2047%2058%20126%2075%20175%2063%20188%2061%20138%2061%201575%200%201147%20-2%201318%20-16%201391%20-99%20521%20-496%20914%20-1018%201004%20-70%2012%20-178%2015%20-526%2015%20-240%200%20-440%20-3%20-443%20-7z%20m1068%20-2178%20c156%20-41%20284%20-160%20336%20-312%2033%20-94%2032%20-232%20-1%20-318%20-61%20-158%20-181%20-269%20-335%20-310%20-250%20-65%20-516%2086%20-589%20334%20-22%2076%20-21%20204%204%20282%2075%20245%20335%20389%20585%20324z'/%3e%3c/g%3e%3c/svg%3e",bm="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20version='1.1'%20viewBox='0%200%20117.6206%2058.359901'%20id='svg4'%20width='117.6206'%20height='58.359901'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3cdefs%20id='defs8'%20/%3e%3cpath%20d='m%200.5468,57.4219%20h%209.7266%20V%2016.0159%20H%200.5468%20Z%20m%204.8438,-46.836%20c%203.0469,0%205.4297,-2.3438%205.4297,-5.2734%20C%2010.8203,2.3437%208.4375,0%205.3906,0%202.3828,0%200,2.3438%200,5.3125%20c%200,2.9297%202.3828,5.2734%205.3906,5.2734%20z%20m%2037.267,-10.469%20c%20-16.445,0%20-26.758,11.211%20-26.758,29.141%200,17.93%2010.312,29.102%2026.758,29.102%2016.406,0%2026.719,-11.172%2026.719,-29.102%200,-17.93%20-10.312,-29.141%20-26.719,-29.141%20z%20m%200,8.5938%20c%2010.039,0%2016.445,7.9688%2016.445,20.547%200,12.539%20-6.4062,20.508%20-16.445,20.508%20-10.078,0%20-16.445,-7.9688%20-16.445,-20.508%200,-12.578%206.3672,-20.547%2016.445,-20.547%20z%20m%2030.822,32.852%20c%200.42969,10.391%208.9453,16.797%2021.914,16.797%2013.633,0%2022.227,-6.7188%2022.227,-17.422%200,-8.3984%20-4.8438,-13.125%20-16.289,-15.742%20l%20-6.4844,-1.4844%20c%20-6.9141,-1.6406%20-9.7656,-3.8281%20-9.7656,-7.5781%200,-4.6875%204.2969,-7.8125%2010.664,-7.8125%206.4453,0%2010.859,3.1641%2011.328,8.4375%20h%209.6094%20c%20-0.23438,-9.9219%20-8.4375,-16.641%20-20.859,-16.641%20-12.266,0%20-20.977,6.7578%20-20.977,16.758%200,8.0469%204.9219,13.047%2015.312,15.43%20l%207.3047,1.7188%20c%207.1094,1.6797%2010,4.0234%2010,8.0859%200,4.6875%20-4.7266,8.0469%20-11.523,8.0469%20-6.875,0%20-12.07,-3.3984%20-12.695,-8.5938%20h%20-9.7656%20z'%20id='path2'%20/%3e%3c/svg%3e",ev="data:image/svg+xml,%3c?xml%20version='1.0'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='-147%20-70%20294%20345'%3e%3cg%20fill='%23a4c639'%3e%3cuse%20stroke-width='14.4'%20xlink:href='%23b'%20stroke='%23FFF'/%3e%3cuse%20xlink:href='%23a'%20transform='scale(-1,1)'/%3e%3cg%20id='a'%20stroke='%23FFF'%20stroke-width='7.2'%3e%3crect%20rx='6.5'%20transform='rotate(29)'%20height='86'%20width='13'%20y='-86'%20x='14'/%3e%3crect%20id='c'%20rx='24'%20height='133'%20width='48'%20y='41'%20x='-143'/%3e%3cuse%20y='97'%20x='85'%20xlink:href='%23c'/%3e%3c/g%3e%3cg%20id='b'%3e%3cellipse%20cy='41'%20rx='91'%20ry='84'/%3e%3crect%20rx='22'%20height='182'%20width='182'%20y='20'%20x='-91'/%3e%3c/g%3e%3c/g%3e%3cg%20stroke='%23FFF'%20stroke-width='7.2'%20fill='%23FFF'%3e%3cpath%20d='m-95%2044.5h190'/%3e%3ccircle%20cx='-42'%20r='4'/%3e%3ccircle%20cx='42'%20r='4'/%3e%3c/g%3e%3c/svg%3e",tv="/game-haven/assets/linux-e2kboyAL.svg";function nv({gameInfo:e,onClick:t,cartInfo:n,addToCart:r}){const l=n.some(i=>i.id==e.id);return w.jsxs("div",{id:e.id,className:"game-card",children:[w.jsx("img",{className:"game-card-image",src:e.background_image,onClick:t}),w.jsxs("div",{className:"game-card-info",children:[w.jsxs("div",{className:"purchase-info",children:[l?w.jsx("button",{className:"already-added-button",children:"✓ Added"}):w.jsx("button",{className:"add-to-cart-button",onClick:()=>r(e),children:"Add to cart +"}),w.jsxs("div",{className:"prices",children:[e.discount&&w.jsx("p",{className:"game-card-discounted-price",children:e.discountedPrice}),w.jsx("p",{className:"game-card-price",style:e.discount?{textDecoration:"line-through"}:{},children:e.originalPrice})]})]}),w.jsx("div",{className:"game-card-platforms",children:e.parent_platforms&&e.parent_platforms.map(i=>{if(i.platform.name.includes("PC"))return w.jsx("img",{className:"windows logo",src:Zm,alt:"PC",draggable:!1},xt());if(i.platform.name.includes("Apple"))return w.jsx("img",{className:"mac logo",src:Xm,alt:"Mac",draggable:!1},xt());if(i.platform.name.includes("PlayStation"))return w.jsx("img",{className:"playstation logo",src:Gm,alt:"PlayStation",draggable:!1},xt());if(i.platform.name.includes("Xbox"))return w.jsx("img",{className:"xbox logo",src:qm,alt:"Xbox",draggable:!1},xt());if(i.platform.name.includes("Nintendo"))return w.jsx("img",{className:"nintendo-switch logo",src:Jm,alt:"Nintendo Switch",draggable:!1},xt());if(i.platform.name.includes("iOS"))return w.jsx("img",{className:"ios logo",src:bm,alt:"iOS",draggable:!1},xt());if(i.platform.name.includes("Android"))return w.jsx("img",{className:"android logo",src:ev,alt:"Android",draggable:!1},xt());if(i.platform.name.includes("Linux"))return w.jsx("img",{className:"linux logo",src:tv,alt:"Linux",draggable:!1},xt())})}),w.jsx("h3",{className:"game-card-title",onClick:t,children:e.name})]})]})}const rv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M400-80%200-480l400-400%2071%2071-329%20329%20329%20329-71%2071Z'/%3e%3c/svg%3e",lv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='m321-80-71-71%20329-329-329-329%2071-71%20400%20400L321-80Z'/%3e%3c/svg%3e";function iv({images:e,currentIndex:t,changeIndex:n,isHovered:r}){return w.jsx("div",{className:`image-nav ${r?"shown":""}`,children:e.map((l,i)=>w.jsx("button",{className:`image-nav-circle ${i==t?"selected":""} ${r?" shown":""}`,onClick:()=>n(i)},i))})}function ov({images:e}){const[t,n]=C.useState(0),[r,l]=C.useState(!1);function i(s){n(s)}function o(){n(s=>(s+1)%e.length)}function a(){n(s=>(s-1+e.length)%e.length)}return w.jsxs("div",{className:"image-viewer",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[w.jsx("img",{className:"image-viewer-image",src:e[t].image},t),w.jsx("button",{id:"back-arrow",className:`image-viewer-button ${r?"shown":""}`,onClick:a,children:w.jsx("img",{src:rv,alt:"back arrow"})}),w.jsx("button",{id:"forward-arrow",className:`image-viewer-button ${r?"shown":""}`,onClick:o,children:w.jsx("img",{src:lv,alt:"forward arrow"})}),w.jsx(iv,{images:e,currentIndex:t,changeIndex:i,isHovered:r})]})}function av({previewData:e,closeGamePreview:t,cartInfo:n,addToCart:r}){const[l,i]=C.useState({}),[o,a]=C.useState(!1),s="abd1d4cf1d5944b3903754265695d018";function u(h){h.stopPropagation()}async function c(h){a(!0);const k=await fetch(`https://api.rawg.io/api/games/${h}?key=${s}`);if(!k.ok)throw new Error("server error");const S=await k.json();a(!1),i(S)}C.useEffect(()=>{c(e.id)},[]);const p=n.some(h=>h.id==l.id);return w.jsx("div",{className:"game-preview-background",onClick:t,children:w.jsxs("div",{className:"game-preview",onClick:u,children:[w.jsx(ov,{images:e.short_screenshots||[""]}),w.jsxs("div",{className:"preview-side",children:[w.jsx("h1",{children:e.name}),w.jsxs("div",{className:"side-info",children:[w.jsxs("div",{className:"game-details",children:[w.jsx("h2",{children:"Description"}),w.jsx("p",{children:l.description_raw||l.description||"Loading description..."})]}),p?w.jsx("button",{id:"already-in-cart-button",children:"✓ Added to Cart"}):w.jsx("button",{id:"add-to-cart-button",onClick:()=>{(l.description_raw||l.description)&&r(e)},children:`+ Add to Cart (${e.price})`})]})]})]})})}const sv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M480-345%20240-585l56-56%20184%20184%20184-184%2056%2056-240%20240Z'/%3e%3c/svg%3e";function uv({storeData:e,setSortedStoreData:t}){const[n,r]=C.useState("Popularity"),[l,i]=C.useState(!1),o=C.useRef(null);C.useEffect(()=>{const S=g=>{o.current&&!o.current.contains(g.target)&&i(!1)};return document.addEventListener("click",S),()=>{document.removeEventListener("click",S)}},[o]);function a(){const S=[...e].sort((g,x)=>g.added>x.added?-1:x.added>g.added?1:0);t(S),r("Popularity"),i(!l)}function s(){const S=[...e].sort((g,x)=>g.released>x.released?1:x.released>g.released?-1:0);t(S),r("Release Date ↓"),i(!l)}function u(){const S=[...e].sort((g,x)=>g.released>x.released?-1:x.released>g.released?1:0);t(S),r("Release Date ↑"),i(!l)}function c(){const S=[...e].sort((g,x)=>g.name>x.name?1:x.name>g.name?-1:0);t(S),r("Name (A-Z)"),i(!l)}function p(){const S=[...e].sort((g,x)=>g.name>x.name?-1:x.name>g.name?1:0);t(S),r("Name (Z-A)"),i(!l)}function h(){const S=[...e].sort((g,x)=>g.rating>x.rating?-1:x.rating>g.rating?1:0);t(S),r("Rating"),i(!l)}function k(){i(!l)}return w.jsxs("div",{className:"sort-by",ref:o,onClick:k,children:[w.jsx("p",{children:"Sort By:"}),w.jsx("button",{children:n}),w.jsx("img",{id:"expand-icon",src:sv}),w.jsxs("div",{className:`sort-options ${l?"":"hidden"}`,children:[w.jsx("button",{className:`sort-option ${n=="Popularity"?"selected":""}`,onClick:a,children:"Popularity"}),w.jsx("button",{className:`sort-option ${n=="Release Date ↓"?"selected":""}`,onClick:s,children:"Release Date ↓"}),w.jsx("button",{className:`sort-option ${n=="Release Date ↑"?"selected":""}`,onClick:u,children:"Release Date ↑"}),w.jsx("button",{className:`sort-option ${n=="Name (A-Z)"?"selected":""}`,onClick:c,children:"Name (A-Z)"}),w.jsx("button",{className:`sort-option ${n=="Name (Z-A)"?"selected":""}`,onClick:p,children:"Name (Z-A)"}),w.jsx("button",{className:`sort-option ${n=="Rating"?"selected":""}`,onClick:h,children:"Rating"})]})]})}function cv({searched:e,cartInfo:t,showCart:n,handleShowCart:r,addToCart:l,deleteFromCart:i,clearCart:o,clickedSearch:a,handleClickedSearch:s}){const[u,c]=C.useState([]),[p,h]=C.useState(""),[k,S]=C.useState(!1),[g,x]=C.useState(!1),[d,f]=C.useState([]);let m=C.useRef(null);C.useEffect(()=>{const B=new MutationObserver(()=>{const W=P(a);W.length>1&&(m.current=W[1],m.current&&(m.current.click(),s(""),B.disconnect()))});return B.observe(document.body,{childList:!0,subtree:!0}),m.current=P(a)[1],m.current&&(m.current.click(),s("")),()=>{B.disconnect()}},[a]);function P(B){let W=document.getElementsByTagName("*"),oe=[];for(let me=0;me{e&&(m.current=P(a)[1],m.current&&m.current.click())},[e]);function R(B){const W=B.map(oe=>{let me,We=L(),b=z(We);return We==b?me=!1:me=!0,{...oe,discount:me,originalPrice:We,discountedPrice:b}});c(W)}function v(B){h(B)}function _(B){c(B)}function L(){let B=Math.floor(Math.random()*3),W="";switch(B){case 0:W="$4.99";break;case 1:W="$19.99";break;case 2:W="$59.99";break}return W}function z(B){if(Math.floor(Math.random()*10)<1){let oe=Math.floor(Math.random()*4),me=0;switch(oe){case 0:me=.25;break;case 1:me=.5;break;case 2:me=.75;break;case 3:me=.9;break}return`$${(parseFloat(B.slice(1))*(1-me)).toFixed(2)}`}return B}function I(B){let W="";B.currentTarget.className=="game-card-title"?W=B.currentTarget.parentElement.parentElement.children[1].children[0].children[1].children[0].textContent:W=B.currentTarget.parentElement.children[1].children[0].children[1].children[0].textContent,u.forEach(oe=>{(oe.id==B.currentTarget.parentElement.id||oe.id==B.currentTarget.parentElement.parentElement.id)&&(oe.price=W,f(oe))}),x(!0)}function q(B){x(!1)}return w.jsxs(w.Fragment,{children:[w.jsx(o0,{onEnter:R,onStorePage:!0,handleStoreData:R,onSectionChange:v,handleShowCart:r,handleClickedSearch:s}),n&&w.jsx(a0,{cartInfo:t,handleShowCart:r,deleteFromCart:i,clearCart:o}),g&&w.jsx(av,{previewData:d,closeGamePreview:q,cartInfo:t,addToCart:l}),w.jsxs("div",{className:"store",children:[w.jsx(Ym,{handleLoading:S,onApiData:R,onSectionChange:v,searched:e}),w.jsxs("div",{className:"store-content",children:[!k&&w.jsxs("div",{className:"store-header",children:[w.jsx("h1",{id:"header-text",className:"header",children:p}),w.jsx(uv,{storeData:u,setSortedStoreData:_})]}),!k&&w.jsx("div",{className:"games",children:u.map(B=>w.jsx(nv,{gameInfo:B,onClick:I,cartInfo:t,addToCart:l},xt()))}),k&&w.jsx("div",{className:"loading-content",children:w.jsx("img",{src:i0,alt:"loading icon"})})]})]})]})}function dv(){return w.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[w.jsx("h1",{children:"Uh oh! This page does not exist."}),w.jsx("a",{href:"/",children:"Back to home"})]})}function fv(){const[e,t]=C.useState(!1),[n,r]=C.useState(null),[l,i]=C.useState([]),[o,a]=C.useState(!1);C.useEffect(()=>{const g=localStorage.getItem("cart-info");g&&i(JSON.parse(g))},[]);function s(g){t(g)}function u(g){r(g)}function c(g){a(g)}function p(g){const x=[...l,g];i(x),localStorage.setItem("cart-info",JSON.stringify(x))}function h(g){const x=l.filter(d=>d!=g);i(x),localStorage.setItem("cart-info",JSON.stringify(x))}function k(){i([]),localStorage.setItem("cart-info",JSON.stringify([]))}const S=rm([{path:"/",element:w.jsx(Sc,{timeout:300,classNames:"fade",children:w.jsx($m,{handleSearched:s,cartInfo:l,showCart:o,handleShowCart:c,deleteFromCart:h,clearCart:k,handleClickedSearch:u})},"/"),errorElement:w.jsx(dv,{})},{path:"store",element:w.jsx(Sc,{timeout:300,classNames:"fade",children:w.jsx(cv,{searched:e,cartInfo:l,showCart:o,handleShowCart:c,addToCart:p,deleteFromCart:h,clearCart:k,handleClickedSearch:u,clickedSearch:n})},"store")}]);return w.jsx(fm,{router:S,children:w.jsx(Nm,{className:"transition-group",children:S.routeResults})})}Mo.createRoot(document.getElementById("root")).render(w.jsx(Ye.StrictMode,{children:w.jsx(fv,{})})); + */function Ni(){return Ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function fm(e){let{fallbackElement:t,router:n,future:r}=e,[l,i]=C.useState(n.state),[o,a]=C.useState(),[s,u]=C.useState({isTransitioning:!1}),[c,p]=C.useState(),[h,k]=C.useState(),[S,g]=C.useState(),x=C.useRef(new Map),{v7_startTransition:d}=r||{},f=C.useCallback(_=>{d?cm(_):_()},[d]),m=C.useCallback((_,L)=>{let{deletedFetchers:z,unstable_flushSync:I,unstable_viewTransitionOpts:q}=L;z.forEach(W=>x.current.delete(W)),_.fetchers.forEach((W,oe)=>{W.data!==void 0&&x.current.set(oe,W.data)});let B=n.window==null||typeof n.window.document.startViewTransition!="function";if(!q||B){I?Lr(()=>i(_)):f(()=>i(_));return}if(I){Lr(()=>{h&&(c&&c.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:q.currentLocation,nextLocation:q.nextLocation})});let W=n.window.document.startViewTransition(()=>{Lr(()=>i(_))});W.finished.finally(()=>{Lr(()=>{p(void 0),k(void 0),a(void 0),u({isTransitioning:!1})})}),Lr(()=>k(W));return}h?(c&&c.resolve(),h.skipTransition(),g({state:_,currentLocation:q.currentLocation,nextLocation:q.nextLocation})):(a(_),u({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}))},[n.window,h,c,x,f]);C.useLayoutEffect(()=>n.subscribe(m),[n,m]),C.useEffect(()=>{s.isTransitioning&&!s.flushSync&&p(new dm)},[s]),C.useEffect(()=>{if(c&&o&&n.window){let _=o,L=c.promise,z=n.window.document.startViewTransition(async()=>{f(()=>i(_)),await L});z.finished.finally(()=>{p(void 0),k(void 0),a(void 0),u({isTransitioning:!1})}),k(z)}},[f,o,c,n.window]),C.useEffect(()=>{c&&o&&l.location.key===o.location.key&&c.resolve()},[c,h,l.location,o]),C.useEffect(()=>{!s.isTransitioning&&S&&(a(S.state),u({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),g(void 0))},[s.isTransitioning,S]),C.useEffect(()=>{},[]);let P=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:_=>n.navigate(_),push:(_,L,z)=>n.navigate(_,{state:L,preventScrollReset:z==null?void 0:z.preventScrollReset}),replace:(_,L,z)=>n.navigate(_,{replace:!0,state:L,preventScrollReset:z==null?void 0:z.preventScrollReset})}),[n]),R=n.basename||"/",v=C.useMemo(()=>({router:n,navigator:P,static:!1,basename:R}),[n,P,R]);return C.createElement(C.Fragment,null,C.createElement(Wi.Provider,{value:v},C.createElement(Zf.Provider,{value:l},C.createElement(am.Provider,{value:x.current},C.createElement(om.Provider,{value:s},C.createElement(tm,{basename:R,location:l.location,navigationType:l.historyAction,navigator:P,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},l.initialized||n.future.v7_partialHydration?C.createElement(pm,{routes:n.routes,future:n.future,state:l}):t))))),null)}function pm(e){let{routes:t,future:n,state:r}=e;return H2(t,void 0,r,n)}var gc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(gc||(gc={}));var yc;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(yc||(yc={}));function Pi(){return Pi=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[l]=e[l]);return n}function La(e,t){return La=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,l){return r.__proto__=l,r},La(e,t)}function js(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,La(e,t)}function hm(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function mm(e,t){e.classList?e.classList.add(t):hm(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function wc(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function vm(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=wc(e.className,t):e.setAttribute("class",wc(e.className&&e.className.baseVal||"",t))}const xc={disabled:!1},_i=Ye.createContext(null);var n0=function(t){return t.scrollTop},Fr="unmounted",pn="exited",hn="entering",In="entered",ja="exiting",Ot=function(e){js(t,e);function t(r,l){var i;i=e.call(this,r,l)||this;var o=l,a=o&&!o.isMounting?r.enter:r.appear,s;return i.appearStatus=null,r.in?a?(s=pn,i.appearStatus=hn):s=In:r.unmountOnExit||r.mountOnEnter?s=Fr:s=pn,i.state={status:s},i.nextCallback=null,i}t.getDerivedStateFromProps=function(l,i){var o=l.in;return o&&i.status===Fr?{status:pn}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(l){var i=null;if(l!==this.props){var o=this.state.status;this.props.in?o!==hn&&o!==In&&(i=hn):(o===hn||o===In)&&(i=ja)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var l=this.props.timeout,i,o,a;return i=o=a=l,l!=null&&typeof l!="number"&&(i=l.exit,o=l.enter,a=l.appear!==void 0?l.appear:o),{exit:i,enter:o,appear:a}},n.updateStatus=function(l,i){if(l===void 0&&(l=!1),i!==null)if(this.cancelNextCallback(),i===hn){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Or.findDOMNode(this);o&&n0(o)}this.performEnter(l)}else this.performExit();else this.props.unmountOnExit&&this.state.status===pn&&this.setState({status:Fr})},n.performEnter=function(l){var i=this,o=this.props.enter,a=this.context?this.context.isMounting:l,s=this.props.nodeRef?[a]:[Or.findDOMNode(this),a],u=s[0],c=s[1],p=this.getTimeouts(),h=a?p.appear:p.enter;if(!l&&!o||xc.disabled){this.safeSetState({status:In},function(){i.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:hn},function(){i.props.onEntering(u,c),i.onTransitionEnd(h,function(){i.safeSetState({status:In},function(){i.props.onEntered(u,c)})})})},n.performExit=function(){var l=this,i=this.props.exit,o=this.getTimeouts(),a=this.props.nodeRef?void 0:Or.findDOMNode(this);if(!i||xc.disabled){this.safeSetState({status:pn},function(){l.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:ja},function(){l.props.onExiting(a),l.onTransitionEnd(o.exit,function(){l.safeSetState({status:pn},function(){l.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(l,i){i=this.setNextCallback(i),this.setState(l,i)},n.setNextCallback=function(l){var i=this,o=!0;return this.nextCallback=function(a){o&&(o=!1,i.nextCallback=null,l(a))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},n.onTransitionEnd=function(l,i){this.setNextCallback(i);var o=this.props.nodeRef?this.props.nodeRef.current:Or.findDOMNode(this),a=l==null&&!this.props.addEndListener;if(!o||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],u=s[0],c=s[1];this.props.addEndListener(u,c)}l!=null&&setTimeout(this.nextCallback,l)},n.render=function(){var l=this.state.status;if(l===Fr)return null;var i=this.props,o=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=Ls(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ye.createElement(_i.Provider,{value:null},typeof o=="function"?o(l,a):Ye.cloneElement(Ye.Children.only(o),a))},t}(Ye.Component);Ot.contextType=_i;Ot.propTypes={};function On(){}Ot.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:On,onEntering:On,onEntered:On,onExit:On,onExiting:On,onExited:On};Ot.UNMOUNTED=Fr;Ot.EXITED=pn;Ot.ENTERING=hn;Ot.ENTERED=In;Ot.EXITING=ja;const gm=Ot;var ym=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return mm(t,r)})},Lo=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return vm(t,r)})},Ds=function(e){js(t,e);function t(){for(var r,l=arguments.length,i=new Array(l),o=0;ot?e:t+1}var Lm=fl.exports;const xt=Da(Lm),jm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M784-120%20532-372q-30%2024-69%2038t-83%2014q-109%200-184.5-75.5T120-580q0-109%2075.5-184.5T380-840q109%200%20184.5%2075.5T640-580q0%2044-14%2083t-38%2069l252%20252-56%2056ZM380-400q75%200%20127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75%200-127.5%2052.5T200-580q0%2075%2052.5%20127.5T380-400Z'/%3e%3c/svg%3e",i0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20style='margin:%20auto;%20background:%20none;%20display:%20block;%20shape-rendering:%20auto;%20animation-play-state:%20running;%20animation-delay:%200s;'%20width='200px'%20height='200px'%20viewBox='0%200%20100%20100'%20preserveAspectRatio='xMidYMid'%3e%3ccircle%20cx='50'%20cy='50'%20fill='none'%20stroke='%23bfbfbf'%20stroke-width='10'%20r='35'%20stroke-dasharray='164.93361431346415%2056.97787143782138'%20style='animation-play-state:%20running;%20animation-delay:%200s;'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20repeatCount='indefinite'%20dur='1s'%20values='0%2050%2050;360%2050%2050'%20keyTimes='0;1'%20style='animation-play-state:%20running;%20animation-delay:%200s;'%3e%3c/animateTransform%3e%3c/circle%3e%3c!--%20[ldio]%20generated%20by%20https://loading.io/%20--%3e%3c/svg%3e";function Dm({gameTitle:e,gameImage:t,onClick:n}){return w.jsxs("div",{className:"search-bar-result",onClick:n,children:[w.jsx("img",{className:"search-bar-game-image",src:t,onClick:n}),w.jsx("h3",{className:"search-bar-game-title",onClick:n,children:e})]})}function Mm({navigate:e,handleStoreData:t,onStorePage:n,onSectionChange:r,handleSearched:l,handleClickedSearch:i}){const[o,a]=C.useState(""),[s,u]=C.useState([]),[c,p]=C.useState(!1),[h,k]=C.useState(!1),S=C.useRef(!1),g="abd1d4cf1d5944b3903754265695d018";C.useEffect(()=>{const R=v=>{const _=document.querySelector(".search-area"),L=document.querySelector(".search-results");_&&!_.contains(v.target)&&L&&!L.contains(v.target)&&k(!1)};return document.addEventListener("click",R),()=>{document.removeEventListener("click",R)}},[]);function x(R){a(R.target.value),sessionStorage.setItem("searchInputValue",R.target.value)}C.useEffect(()=>{a(sessionStorage.getItem("searchInputValue")||"");const R=sessionStorage.getItem("searchData");R&&u(JSON.parse(R)),n&&R&&(t(JSON.parse(R)),r(`Search results for "${sessionStorage.getItem("searchInputValue")}"`))},[]),C.useEffect(()=>{const R=setTimeout(()=>{o&&S.current&&d(o),o||u([]),S.current=!0},500);return()=>clearTimeout(R)},[o]);async function d(R){p(!0);const v=await fetch(`https://api.rawg.io/api/games?key=${g}&search=${R}&search_exact=true&ordering=-added&exclude_additions=true`);if(!v.ok)throw new Error("server error");const _=await v.json();p(!1),u(_.results),sessionStorage.setItem("searchData",JSON.stringify(_.results))}function f(R){R.key=="Enter"&&s.length>0&&(n?c||(t(s),r(`Search results for "${o}"`)):(l(!0),e()))}function m(){n?c||(t(s),r(`Search results for "${o}"`)):(l(!0),e())}function P(R){R.currentTarget.outerText!=""&&i(R.currentTarget.outerText),n?(t(s),r(`Search results for "${o}"`)):(l(!0),e()),k(!1)}return w.jsxs("div",{className:"search-bar",onClick:()=>k(!0),children:[w.jsxs("div",{className:"search-area",children:[w.jsx("input",{type:"text",placeholder:"Search games...",value:o,onChange:x,onKeyDown:f}),w.jsx("button",{id:"search-button",onClick:m,children:w.jsx("img",{id:"search-icon",src:jm,alt:"search icon"})})]}),w.jsx("div",{className:`search-results ${h?"":"hidden"}`,children:!c&&s.map(R=>w.jsx(Dm,{gameTitle:R.name,gameImage:R.background_image,onClick:P},xt()))}),c&&w.jsx("div",{className:"search-results loading",children:w.jsx("img",{id:"loading-icon",src:i0,alt:"loading icon"})})]})}const zm="/game-haven/assets/logo-IYppaM25.png",Om="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M280-80q-33%200-56.5-23.5T200-160q0-33%2023.5-56.5T280-240q33%200%2056.5%2023.5T360-160q0%2033-23.5%2056.5T280-80Zm400%200q-33%200-56.5-23.5T600-160q0-33%2023.5-56.5T680-240q33%200%2056.5%2023.5T760-160q0%2033-23.5%2056.5T680-80ZM246-720l96%20200h280l110-200H246Zm-38-80h590q23%200%2035%2020.5t1%2041.5L692-482q-11%2020-29.5%2031T622-440H324l-44%2080h480v80H280q-45%200-68-39.5t-2-78.5l54-98-144-304H40v-80h130l38%2080Zm134%20280h280-280Z'/%3e%3c/svg%3e";function o0({navigate:e,onStorePage:t,handleStoreData:n,onSectionChange:r,handleSearched:l,handleShowCart:i,handleClickedSearch:o}){return w.jsxs("nav",{className:"nav-bar",children:[w.jsxs("a",{className:"game-haven",href:"/game-haven",children:[w.jsx("img",{id:"game-haven-logo",src:zm,alt:"game haven logo"}),w.jsx("h2",{id:"game-haven-text",children:"Game Haven"})]}),w.jsx(Mm,{navigate:e,onStorePage:t,handleStoreData:n,onSectionChange:r,handleSearched:l,handleClickedSearch:o}),w.jsx("button",{className:"shopping-cart-button",onClick:()=>i(!0),children:w.jsx("img",{id:"shopping-cart-icon",src:Om,alt:"shopping cart icon"})})]})}function Fm({gameInfo:e,deleteFromCart:t}){return w.jsxs("div",{className:"cart-game",children:[w.jsx("img",{className:"cart-game-image",src:e.background_image}),w.jsxs("div",{className:"cart-game-info",children:[w.jsx("h3",{className:"cart-game-title",children:e.name}),w.jsx("p",{className:"cart-game-price",children:e.price||e.discountedPrice||e.originalPrice})]}),w.jsx("button",{className:"remove-game-button",onClick:()=>t(e),children:"x"})]})}function Im({isOpen:e,totalItems:t,totalPrice:n}){return e?w.jsx("div",{className:"checkout-modal-background",children:w.jsxs("div",{className:"checkout-modal",children:[w.jsx("h2",{children:"Checkout Successful!"}),w.jsx("div",{className:"checkmark",children:"✓"}),w.jsx("p",{children:`You bought ${t} item(s) for $${n.toFixed(2)}`})]})}):null}function a0({cartInfo:e,handleShowCart:t,deleteFromCart:n,clearCart:r}){const[l,i]=C.useState(!1);function o(c){c.stopPropagation()}const a=e.reduce((c,p)=>p.price!=null?c+parseFloat(p.price.replace("$","")):p.discountedPrice!=null?c+parseFloat(p.discountedPrice.replace("$","")):p.originalPrice!=null?c+parseFloat(p.originalPrice.replace("$","")):c,0);function s(){i(!0),setTimeout(()=>{u(),t(!1)},3e3)}function u(){i(!1),r()}return w.jsxs(w.Fragment,{children:[!l&&w.jsx("div",{className:"cart-background",onClick:()=>t(!1),children:w.jsxs("div",{className:"cart",onClick:o,children:[w.jsxs("div",{className:"cart-header",children:[w.jsx("h2",{children:`${e.length} Games`}),w.jsx("button",{id:"clear-cart-button",onClick:r,children:"Clear"})]}),w.jsx("div",{className:"cart-games",children:e.map(c=>w.jsx(Fm,{gameInfo:c,deleteFromCart:n},c.id))}),w.jsxs("div",{className:"cart-footer",children:[w.jsx("h3",{id:"cart-total",children:`$${a.toFixed(2)}`}),e.length>0&&w.jsx("button",{id:"cart-checkout-button",onClick:s,children:"Checkout"})]})]})}),w.jsx(Im,{isOpen:l,totalItems:e.length,totalPrice:a})]})}const Um="/game-haven/assets/background-video-eodPu5GI.mp4",Am="data:image/svg+xml,%3csvg%20width='98'%20height='96'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M48.854%200C21.839%200%200%2022%200%2049.217c0%2021.756%2013.993%2040.172%2033.405%2046.69%202.427.49%203.316-1.059%203.316-2.362%200-1.141-.08-5.052-.08-9.127-13.59%202.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015%204.934.326%207.523%205.052%207.523%205.052%204.367%207.496%2011.404%205.378%2014.235%204.074.404-3.178%201.699-5.378%203.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283%200-5.378%201.94-9.778%205.014-13.2-.485-1.222-2.184-6.275.486-13.038%200%200%204.125-1.304%2013.426%205.052a46.97%2046.97%200%200%201%2012.214-1.63c4.125%200%208.33.571%2012.213%201.63%209.302-6.356%2013.427-5.052%2013.427-5.052%202.67%206.763.97%2011.816.485%2013.038%203.155%203.422%205.015%207.822%205.015%2013.2%200%2018.905-11.404%2023.06-22.324%2024.283%201.78%201.548%203.316%204.481%203.316%209.126%200%206.6-.08%2011.897-.08%2013.526%200%201.304.89%202.853%203.316%202.364%2019.412-6.52%2033.405-24.935%2033.405-46.691C97.707%2022%2075.788%200%2048.854%200z'%20fill='%2324292f'/%3e%3c/svg%3e";function $m({handleSearched:e,cartInfo:t,showCart:n,handleShowCart:r,deleteFromCart:l,clearCart:i,handleClickedSearch:o}){const a=B2();return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"home-page",children:[w.jsx(o0,{navigate:()=>a("/game-haven/store"),handleSearched:e,handleShowCart:r,handleClickedSearch:o}),n&&w.jsx(a0,{cartInfo:t,handleShowCart:r,deleteFromCart:l,clearCart:i}),w.jsxs("div",{className:"home-page-content",children:[w.jsxs("div",{className:"welcome",children:[w.jsx("h1",{children:"Game Haven"}),w.jsx("p",{children:"An imitation of a real online game store."}),w.jsxs("a",{className:"github-redir",href:"https://github.com/yari-dewalt",children:[w.jsx("img",{src:Am,alt:"github icon"}),w.jsx("p",{children:"yari-dewalt"})]})]}),w.jsx("a",{className:"to-store",href:"/game-haven/store",children:"To Store →"})]})]}),w.jsx("video",{className:"background-video",autoPlay:!0,loop:!0,muted:!0,children:w.jsx("source",{src:Um,type:"video/mp4"})})]})}const Bm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20640%20512'%3e%3cpath%20d='M528%20448H112c-8.8%200-16%207.2-16%2016v32c0%208.8%207.2%2016%2016%2016h416c8.8%200%2016-7.2%2016-16v-32c0-8.8-7.2-16-16-16zm64-320c-26.5%200-48%2021.5-48%2048%200%207.1%201.6%2013.7%204.4%2019.8L476%20239.2c-15.4%209.2-35.3%204-44.2-11.6L350.3%2085C361%2076.2%20368%2063%20368%2048c0-26.5-21.5-48-48-48s-48%2021.5-48%2048c0%2015%207%2028.2%2017.7%2037l-81.5%20142.6c-8.9%2015.6-28.9%2020.8-44.2%2011.6l-72.3-43.4c2.7-6%204.4-12.7%204.4-19.8%200-26.5-21.5-48-48-48S0%20149.5%200%20176s21.5%2048%2048%2048c2.6%200%205.2-.4%207.7-.8L128%20416h384l72.3-192.8c2.5.4%205.1.8%207.7.8%2026.5%200%2048-21.5%2048-48s-21.5-48-48-48z'/%3e%3c/svg%3e%3c!--%20Font%20Awesome%20Free%205.2.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20(Icons:%20CC%20BY%204.0,%20Fonts:%20SIL%20OFL%201.1,%20Code:%20MIT%20License)%20--%3e",Vm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M160-400q0-105%2050-187t110-138q60-56%20110-85.5l50-29.5v132q0%2037%2025%2058.5t56%2021.5q17%200%2032.5-7t28.5-23l18-22q72%2042%20116%20116.5T800-400q0%2088-43%20160.5T644-125q17-24%2026.5-52.5T680-238q0-40-15-75.5T622-377L480-516%20339-377q-29%2029-44%2064t-15%2075q0%2032%209.5%2060.5T316-125q-70-42-113-114.5T160-400Zm320-4%2085%2083q17%2017%2026%2038t9%2045q0%2049-35%2083.5T480-120q-50%200-85-34.5T360-238q0-23%209-44.5t26-38.5l85-83Z'/%3e%3c/svg%3e",Hm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='m233-80%2065-281L80-550l288-25%20112-265%20112%20265%20288%2025-218%20189%2065%20281-247-149L233-80Z'/%3e%3c/svg%3e",Wm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='m136-240-56-56%20296-298%20160%20160%20208-206H640v-80h240v240h-80v-104L536-320%20376-480%20136-240Z'/%3e%3c/svg%3e",Qm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M280-120v-80h160v-124q-49-11-87.5-41.5T296-442q-75-9-125.5-65.5T120-640v-40q0-33%2023.5-56.5T200-760h80v-80h400v80h80q33%200%2056.5%2023.5T840-680v40q0%2076-50.5%20132.5T664-442q-18%2046-56.5%2076.5T520-324v124h160v80H280Zm0-408v-152h-80v40q0%2038%2022%2068.5t58%2043.5Zm400%200q36-13%2058-43.5t22-68.5v-40h-80v152Z'/%3e%3c/svg%3e",Km="/game-haven/assets/fireworks-gM7YNbWU.svg";function Ym({handleLoading:e,onApiData:t,onSectionChange:n,searched:r}){const l=C.useRef(null);C.useEffect(()=>{r?s():l.current&&l.current.click()},[r]),C.useEffect(()=>{document.getElementById("header-text")&&document.getElementById("header-text").textContent.includes("Search")&&s()},[n]);const i="abd1d4cf1d5944b3903754265695d018";async function o(g,x){e(!0),a(g);const d=await fetch(`https://api.rawg.io/api/games?key=${i}${x}&exclude_additions=true`);if(!d.ok)throw new Error("server error");const f=await d.json();t(f.results),n(g.target.textContent),e(!1)}function a(g){Array.from(g.currentTarget.offsetParent.children).forEach(x=>{Array.from(x.children).forEach(d=>{d.className.includes("selected")&&(d.className="nav-bar-item")})}),g.currentTarget.className+=" selected"}function s(){document.querySelectorAll(".nav-bar-item").forEach(x=>{x.className="nav-bar-item"})}async function u(g){o(g,"&ordering=-added")}async function c(g){o(g,"&ordering=-updated")}async function p(g){o(g,"&dates=2023-01-01,2023-12-31&ordering=-added")}async function h(g){const x=new Date,d=`${x.getFullYear()}-${(x.getMonth()+1).toString().padStart(2,"0")}-${x.getDate().toString().padStart(2,"0")}`;o(g,`&dates=2024-01-01,${d}&ordering=-added`)}async function k(g){const x=new Date,d=new Date(x);d.setDate(d.getDate()-31);const f=`${d.getFullYear()}-${(d.getMonth()+1).toString().padStart(2,"0")}-${d.getDate().toString().padStart(2,"0")}`,m=`${x.getFullYear()}-${(x.getMonth()+1).toString().padStart(2,"0")}-${x.getDate().toString().padStart(2,"0")}`;o(g,`&dates=${f},${m}&ordering=-added`)}async function S(g){const x=new Date,d=new Date(x);d.setDate(d.getDate()-7);const f=`${d.getFullYear()}-${(d.getMonth()+1).toString().padStart(2,"0")}-${d.getDate().toString().padStart(2,"0")}`,m=`${x.getFullYear()}-${(x.getMonth()+1).toString().padStart(2,"0")}-${x.getDate().toString().padStart(2,"0")}`;o(g,`&dates=${f},${m}&ordering=-added`)}return w.jsxs("nav",{className:"side-nav-bar",children:[w.jsxs("div",{className:"top-list",children:[w.jsx("div",{className:"list-header",children:w.jsx("h2",{children:"Top"})}),w.jsxs("div",{className:"nav-bar-item",onClick:c,ref:l,children:[w.jsx("img",{id:"fireworks-icon",src:Km,alt:"featured icon"}),w.jsx("h3",{children:"Featured"})]}),w.jsxs("div",{className:"nav-bar-item",onClick:h,children:[w.jsx("img",{src:Qm,alt:"trophy icon"}),w.jsx("h3",{children:"Best of the year"})]}),w.jsxs("div",{className:"nav-bar-item",onClick:p,children:[w.jsx("img",{src:Wm,alt:"trending icon"}),w.jsx("h3",{children:"Popular in 2023"})]}),w.jsxs("div",{className:"nav-bar-item",onClick:u,children:[w.jsx("img",{src:Bm,alt:"crown icon"}),w.jsx("h3",{children:"All time top"})]})]}),w.jsxs("div",{className:"new-releases",children:[w.jsx("div",{className:"list-header",children:w.jsx("h2",{children:"New Releases"})}),w.jsxs("div",{className:"nav-bar-item",onClick:k,children:[w.jsx("img",{src:Hm,alt:"star icon"}),w.jsx("h3",{children:"Last 30 days"})]}),w.jsxs("div",{className:"nav-bar-item",onClick:S,children:[w.jsx("img",{src:Vm,alt:"fire icon"}),w.jsx("h3",{children:"This week"})]})]})]})}const Gm="/game-haven/assets/playstation-2aJHXBDn.svg",qm="data:image/svg+xml,%3c!--%20Created%20with%20Inkscape%20(http://www.inkscape.org/)%20--%3e%3csvg%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:svg='http://www.w3.org/2000/svg'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20id='svg4136'%20version='1.1'%20inkscape:version='0.91pre4%20r13712'%20width='372.36823'%20height='372.57281'%20viewBox='0%200%20372.36823%20372.57281'%20sodipodi:docname='Xbox%20Logo.svg'%3e%3ctitle%20id='title4166'%3eXbox%20Logo%3c/title%3e%3cmetadata%20id='metadata4142'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3cdc:title%3eXbox%20Logo%3c/dc:title%3e%3c/cc:Work%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%20id='defs4140'%20/%3e%3csodipodi:namedview%20pagecolor='%23ffffff'%20bordercolor='%23666666'%20borderopacity='1'%20objecttolerance='10'%20gridtolerance='10'%20guidetolerance='10'%20inkscape:pageopacity='0'%20inkscape:pageshadow='2'%20inkscape:window-width='1920'%20inkscape:window-height='1017'%20id='namedview4138'%20showgrid='false'%20inkscape:zoom='2.2378738'%20inkscape:cx='120.11921'%20inkscape:cy='190.18765'%20inkscape:window-x='-8'%20inkscape:window-y='-8'%20inkscape:window-maximized='1'%20inkscape:current-layer='g4146'%20fit-margin-top='0'%20fit-margin-left='0'%20fit-margin-right='0'%20fit-margin-bottom='0'%20/%3e%3cg%20id='g4146'%20transform='translate(-1.5706619,12.357467)'%3e%3cpath%20style='fill:%23000000'%20d='M%20169.18811,359.44924%20C%20140.50497,356.70211%20111.4651,346.40125%2086.518706,330.1252%2065.614374,316.48637%2060.893704,310.87967%2060.893704,299.69061%20c%200,-22.47524%2024.711915,-61.84014%2066.992496,-106.71584%2024.01246,-25.48631%2057.46022,-55.36001%2061.0775,-54.55105%207.0309,1.57238%2063.25048,56.41053%2084.29655,82.2252%2033.28077,40.82148%2048.58095,74.24535%2040.808,89.14682%20-5.9087,11.32753%20-42.57224,33.4669%20-69.50775,41.97242%20-22.19984,7.01011%20-51.35538,9.9813%20-75.37239,7.68108%20z%20M%2032.660004,276.3228%20C%2015.288964,249.67326%206.5125436,223.43712%202.2752336,185.49086%20c%20-1.39917002,-12.53%20-0.89778,-19.69701%203.17715,-45.41515%205.0788204,-32.05404%2023.3330104,-69.136381%2045.2671304,-91.957616%209.34191,-9.719732%2010.17624,-9.956543%2021.56341,-6.120482%2013.828357,4.658436%2028.595936,14.857457%2051.498366,35.56661%20l%2013.36254,12.082873%20-7.2969,8.96431%20C%2095.97448,140.22403%2060.217254,199.2085%2046.741444,235.70071%20c%20-7.32599,19.83862%20-10.28084,39.75281%20-7.12868,48.04363%202.12818,5.59752%200.17339,3.51093%20-6.95276,-7.42154%20z%20m%20304.915426,4.53255%20c%201.71605,-8.37719%20-0.4544,-23.76257%20-5.5413,-39.28002%20-11.01667,-33.60598%20-47.83964,-96.12421%20-81.65282,-138.63054%20L%20239.73699,89.563875%20251.25285,78.989784%20c%2015.03631,-13.806637%2025.47602,-22.073835%2036.74025,-29.094513%208.88881,-5.540156%2021.59109,-10.444558%2027.05113,-10.444558%203.36626,0%2015.21723,12.298726%2024.78421,25.720611%2014.81725,20.787711%2025.71782,45.986976%2031.24045,72.219686%203.56833,16.9498%203.8657,53.23126%200.57486,70.13935%20-2.70068,13.87582%20-8.40314,31.87484%20-13.9661,44.08195%20-4.16823,9.14657%20-14.53521,26.91044%20-19.0783,32.69074%20-2.33569,2.97175%20-2.33761,2.96527%20-1.02393,-3.4477%20z%20M%20172.25917,33.104812%20c%20-15.60147,-7.922671%20-39.6696,-16.427164%20-52.96493,-18.715209%20-4.66097,-0.802124%20-12.61193,-1.249474%20-17.6688,-0.994114%20-10.969613,0.55394%20-10.479662,-0.0197%207.11783,-8.3336652%2014.63023,-6.912081%2026.83386,-10.976696%2043.40044,-14.455218%2018.6362,-3.9130858%2053.66559,-3.9590088%2072.00507,-0.0944%2019.80818,4.174105%2043.13297,12.854085%2056.27623,20.9423862%20l%203.90633,2.403927%20-8.96247,-0.452584%20c%20-17.81002,-0.899366%20-43.76575,6.295879%20-71.63269,19.857459%20-8.40538,4.090523%20-15.71788,7.357511%20-16.25,7.25997%20-0.53211,-0.09754%20-7.38426,-3.43589%20-15.22701,-7.418555%20z'%20id='path4148'%20inkscape:connector-curvature='0'%20/%3e%3c/g%3e%3c/svg%3e",Zm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='88'%20width='88'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20d='M0%2012.402l35.687-4.86.016%2034.423-35.67.203zm35.67%2033.529l.028%2034.453L.028%2075.48.026%2045.7zm4.326-39.025L87.314%200v41.527l-47.318.376zm47.329%2039.349l-.011%2041.34-47.318-6.678-.066-34.739z'%20fill='%230078d6'/%3e%3c/svg%3e",Xm="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20width='814'%20height='1000'%3e%3cpath%20d='M788.1%20340.9c-5.8%204.5-108.2%2062.2-108.2%20190.5%200%20148.4%20130.3%20200.9%20134.2%20202.2-.6%203.2-20.7%2071.9-68.7%20141.9-42.8%2061.6-87.5%20123.1-155.5%20123.1s-85.5-39.5-164-39.5c-76.5%200-103.7%2040.8-165.9%2040.8s-105.6-57-155.5-127C46.7%20790.7%200%20663%200%20541.8c0-194.4%20126.4-297.5%20250.8-297.5%2066.1%200%20121.2%2043.4%20162.7%2043.4%2039.5%200%20101.1-46%20176.3-46%2028.5%200%20130.9%202.6%20198.3%2099.2zm-234-181.5c31.1-36.9%2053.1-88.1%2053.1-139.3%200-7.1-.6-14.3-1.9-20.1-50.6%201.9-110.8%2033.7-147.1%2075.8-28.5%2032.4-55.1%2083.6-55.1%20135.5%200%207.8%201.3%2015.6%201.9%2018.1%203.2.6%208.4%201.3%2013.6%201.3%2045.4%200%20102.5-30.4%20135.5-71.3z'/%3e%3c/svg%3e",Jm="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%2020010904//EN'%20'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'%3e%3csvg%20version='1.0'%20xmlns='http://www.w3.org/2000/svg'%20width='550.000000pt'%20height='550.000000pt'%20viewBox='0%200%20550.000000%20550.000000'%20preserveAspectRatio='xMidYMid%20meet'%3e%3cmetadata%3e%20Created%20by%20potrace%201.13,%20written%20by%20Peter%20Selinger%202001-2015%20%3c/metadata%3e%3cg%20transform='translate(0.000000,550.000000)%20scale(0.100000,-0.100000)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M1365%205154%20c-481%20-86%20-868%20-442%20-990%20-910%20-44%20-169%20-47%20-268%20-42%20-1579%203%20-1204%204%20-1232%2024%20-1325%20111%20-501%20467%20-858%20973%20-976%2066%20-15%20150%20-18%20691%20-21%20560%20-4%20618%20-3%20633%2012%2015%2015%2016%20208%2016%202396%200%201622%20-3%202386%20-10%202400%20-10%2018%20-27%2019%20-613%2018%20-476%20-1%20-619%20-4%20-682%20-15z%20m905%20-2400%20l0%20-2026%20-407%205%20c-375%204%20-415%206%20-490%2025%20-322%2083%20-561%20331%20-628%20654%20-22%20101%20-22%202589%20-1%202688%2060%20281%20255%20514%20518%20619%20132%2053%20193%2059%20621%2060%20l387%201%200%20-2026z'/%3e%3cpath%20d='M1451%204169%20c-63%20-12%20-159%20-60%20-210%20-105%20-105%20-91%20-157%20-220%20-149%20-372%204%20-79%209%20-100%2041%20-164%2047%20-97%20118%20-168%20215%20-216%2067%20-33%2084%20-37%20171%20-40%2079%20-3%20107%200%20160%2018%20217%2073%20348%20284%20311%20500%20-43%20257%20-287%20429%20-539%20379z'/%3e%3cpath%20d='M3157%205163%20c-4%20-3%20-7%20-1087%20-7%20-2409%200%20-2181%201%20-2402%2016%20-2408%2027%20-10%20803%20-6%20899%204%20406%2046%20764%20293%20959%20660%2025%2047%2058%20126%2075%20175%2063%20188%2061%20138%2061%201575%200%201147%20-2%201318%20-16%201391%20-99%20521%20-496%20914%20-1018%201004%20-70%2012%20-178%2015%20-526%2015%20-240%200%20-440%20-3%20-443%20-7z%20m1068%20-2178%20c156%20-41%20284%20-160%20336%20-312%2033%20-94%2032%20-232%20-1%20-318%20-61%20-158%20-181%20-269%20-335%20-310%20-250%20-65%20-516%2086%20-589%20334%20-22%2076%20-21%20204%204%20282%2075%20245%20335%20389%20585%20324z'/%3e%3c/g%3e%3c/svg%3e",bm="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20version='1.1'%20viewBox='0%200%20117.6206%2058.359901'%20id='svg4'%20width='117.6206'%20height='58.359901'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3cdefs%20id='defs8'%20/%3e%3cpath%20d='m%200.5468,57.4219%20h%209.7266%20V%2016.0159%20H%200.5468%20Z%20m%204.8438,-46.836%20c%203.0469,0%205.4297,-2.3438%205.4297,-5.2734%20C%2010.8203,2.3437%208.4375,0%205.3906,0%202.3828,0%200,2.3438%200,5.3125%20c%200,2.9297%202.3828,5.2734%205.3906,5.2734%20z%20m%2037.267,-10.469%20c%20-16.445,0%20-26.758,11.211%20-26.758,29.141%200,17.93%2010.312,29.102%2026.758,29.102%2016.406,0%2026.719,-11.172%2026.719,-29.102%200,-17.93%20-10.312,-29.141%20-26.719,-29.141%20z%20m%200,8.5938%20c%2010.039,0%2016.445,7.9688%2016.445,20.547%200,12.539%20-6.4062,20.508%20-16.445,20.508%20-10.078,0%20-16.445,-7.9688%20-16.445,-20.508%200,-12.578%206.3672,-20.547%2016.445,-20.547%20z%20m%2030.822,32.852%20c%200.42969,10.391%208.9453,16.797%2021.914,16.797%2013.633,0%2022.227,-6.7188%2022.227,-17.422%200,-8.3984%20-4.8438,-13.125%20-16.289,-15.742%20l%20-6.4844,-1.4844%20c%20-6.9141,-1.6406%20-9.7656,-3.8281%20-9.7656,-7.5781%200,-4.6875%204.2969,-7.8125%2010.664,-7.8125%206.4453,0%2010.859,3.1641%2011.328,8.4375%20h%209.6094%20c%20-0.23438,-9.9219%20-8.4375,-16.641%20-20.859,-16.641%20-12.266,0%20-20.977,6.7578%20-20.977,16.758%200,8.0469%204.9219,13.047%2015.312,15.43%20l%207.3047,1.7188%20c%207.1094,1.6797%2010,4.0234%2010,8.0859%200,4.6875%20-4.7266,8.0469%20-11.523,8.0469%20-6.875,0%20-12.07,-3.3984%20-12.695,-8.5938%20h%20-9.7656%20z'%20id='path2'%20/%3e%3c/svg%3e",ev="data:image/svg+xml,%3c?xml%20version='1.0'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='-147%20-70%20294%20345'%3e%3cg%20fill='%23a4c639'%3e%3cuse%20stroke-width='14.4'%20xlink:href='%23b'%20stroke='%23FFF'/%3e%3cuse%20xlink:href='%23a'%20transform='scale(-1,1)'/%3e%3cg%20id='a'%20stroke='%23FFF'%20stroke-width='7.2'%3e%3crect%20rx='6.5'%20transform='rotate(29)'%20height='86'%20width='13'%20y='-86'%20x='14'/%3e%3crect%20id='c'%20rx='24'%20height='133'%20width='48'%20y='41'%20x='-143'/%3e%3cuse%20y='97'%20x='85'%20xlink:href='%23c'/%3e%3c/g%3e%3cg%20id='b'%3e%3cellipse%20cy='41'%20rx='91'%20ry='84'/%3e%3crect%20rx='22'%20height='182'%20width='182'%20y='20'%20x='-91'/%3e%3c/g%3e%3c/g%3e%3cg%20stroke='%23FFF'%20stroke-width='7.2'%20fill='%23FFF'%3e%3cpath%20d='m-95%2044.5h190'/%3e%3ccircle%20cx='-42'%20r='4'/%3e%3ccircle%20cx='42'%20r='4'/%3e%3c/g%3e%3c/svg%3e",tv="/game-haven/assets/linux-e2kboyAL.svg";function nv({gameInfo:e,onClick:t,cartInfo:n,addToCart:r}){const l=n.some(i=>i.id==e.id);return w.jsxs("div",{id:e.id,className:"game-card",children:[w.jsx("img",{className:"game-card-image",src:e.background_image,onClick:t}),w.jsxs("div",{className:"game-card-info",children:[w.jsxs("div",{className:"purchase-info",children:[l?w.jsx("button",{className:"already-added-button",children:"✓ Added"}):w.jsx("button",{className:"add-to-cart-button",onClick:()=>r(e),children:"Add to cart +"}),w.jsxs("div",{className:"prices",children:[e.discount&&w.jsx("p",{className:"game-card-discounted-price",children:e.discountedPrice}),w.jsx("p",{className:"game-card-price",style:e.discount?{textDecoration:"line-through"}:{},children:e.originalPrice})]})]}),w.jsx("div",{className:"game-card-platforms",children:e.parent_platforms&&e.parent_platforms.map(i=>{if(i.platform.name.includes("PC"))return w.jsx("img",{className:"windows logo",src:Zm,alt:"PC",draggable:!1},xt());if(i.platform.name.includes("Apple"))return w.jsx("img",{className:"mac logo",src:Xm,alt:"Mac",draggable:!1},xt());if(i.platform.name.includes("PlayStation"))return w.jsx("img",{className:"playstation logo",src:Gm,alt:"PlayStation",draggable:!1},xt());if(i.platform.name.includes("Xbox"))return w.jsx("img",{className:"xbox logo",src:qm,alt:"Xbox",draggable:!1},xt());if(i.platform.name.includes("Nintendo"))return w.jsx("img",{className:"nintendo-switch logo",src:Jm,alt:"Nintendo Switch",draggable:!1},xt());if(i.platform.name.includes("iOS"))return w.jsx("img",{className:"ios logo",src:bm,alt:"iOS",draggable:!1},xt());if(i.platform.name.includes("Android"))return w.jsx("img",{className:"android logo",src:ev,alt:"Android",draggable:!1},xt());if(i.platform.name.includes("Linux"))return w.jsx("img",{className:"linux logo",src:tv,alt:"Linux",draggable:!1},xt())})}),w.jsx("h3",{className:"game-card-title",onClick:t,children:e.name})]})]})}const rv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M400-80%200-480l400-400%2071%2071-329%20329%20329%20329-71%2071Z'/%3e%3c/svg%3e",lv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='m321-80-71-71%20329-329-329-329%2071-71%20400%20400L321-80Z'/%3e%3c/svg%3e";function iv({images:e,currentIndex:t,changeIndex:n,isHovered:r}){return w.jsx("div",{className:`image-nav ${r?"shown":""}`,children:e.map((l,i)=>w.jsx("button",{className:`image-nav-circle ${i==t?"selected":""} ${r?" shown":""}`,onClick:()=>n(i)},i))})}function ov({images:e}){const[t,n]=C.useState(0),[r,l]=C.useState(!1);function i(s){n(s)}function o(){n(s=>(s+1)%e.length)}function a(){n(s=>(s-1+e.length)%e.length)}return w.jsxs("div",{className:"image-viewer",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[w.jsx("img",{className:"image-viewer-image",src:e[t].image},t),w.jsx("button",{id:"back-arrow",className:`image-viewer-button ${r?"shown":""}`,onClick:a,children:w.jsx("img",{src:rv,alt:"back arrow"})}),w.jsx("button",{id:"forward-arrow",className:`image-viewer-button ${r?"shown":""}`,onClick:o,children:w.jsx("img",{src:lv,alt:"forward arrow"})}),w.jsx(iv,{images:e,currentIndex:t,changeIndex:i,isHovered:r})]})}function av({previewData:e,closeGamePreview:t,cartInfo:n,addToCart:r}){const[l,i]=C.useState({}),[o,a]=C.useState(!1),s="abd1d4cf1d5944b3903754265695d018";function u(h){h.stopPropagation()}async function c(h){a(!0);const k=await fetch(`https://api.rawg.io/api/games/${h}?key=${s}`);if(!k.ok)throw new Error("server error");const S=await k.json();a(!1),i(S)}C.useEffect(()=>{c(e.id)},[]);const p=n.some(h=>h.id==l.id);return w.jsx("div",{className:"game-preview-background",onClick:t,children:w.jsxs("div",{className:"game-preview",onClick:u,children:[w.jsx(ov,{images:e.short_screenshots||[""]}),w.jsxs("div",{className:"preview-side",children:[w.jsx("h1",{children:e.name}),w.jsxs("div",{className:"side-info",children:[w.jsxs("div",{className:"game-details",children:[w.jsx("h2",{children:"Description"}),w.jsx("p",{children:l.description_raw||l.description||"Loading description..."})]}),p?w.jsx("button",{id:"already-in-cart-button",children:"✓ Added to Cart"}):w.jsx("button",{id:"add-to-cart-button",onClick:()=>{(l.description_raw||l.description)&&r(e)},children:`+ Add to Cart (${e.price})`})]})]})]})})}const sv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%20-960%20960%20960'%20width='24'%3e%3cpath%20d='M480-345%20240-585l56-56%20184%20184%20184-184%2056%2056-240%20240Z'/%3e%3c/svg%3e";function uv({storeData:e,setSortedStoreData:t}){const[n,r]=C.useState("Popularity"),[l,i]=C.useState(!1),o=C.useRef(null);C.useEffect(()=>{const S=g=>{o.current&&!o.current.contains(g.target)&&i(!1)};return document.addEventListener("click",S),()=>{document.removeEventListener("click",S)}},[o]);function a(){const S=[...e].sort((g,x)=>g.added>x.added?-1:x.added>g.added?1:0);t(S),r("Popularity"),i(!l)}function s(){const S=[...e].sort((g,x)=>g.released>x.released?1:x.released>g.released?-1:0);t(S),r("Release Date ↓"),i(!l)}function u(){const S=[...e].sort((g,x)=>g.released>x.released?-1:x.released>g.released?1:0);t(S),r("Release Date ↑"),i(!l)}function c(){const S=[...e].sort((g,x)=>g.name>x.name?1:x.name>g.name?-1:0);t(S),r("Name (A-Z)"),i(!l)}function p(){const S=[...e].sort((g,x)=>g.name>x.name?-1:x.name>g.name?1:0);t(S),r("Name (Z-A)"),i(!l)}function h(){const S=[...e].sort((g,x)=>g.rating>x.rating?-1:x.rating>g.rating?1:0);t(S),r("Rating"),i(!l)}function k(){i(!l)}return w.jsxs("div",{className:"sort-by",ref:o,onClick:k,children:[w.jsx("p",{children:"Sort By:"}),w.jsx("button",{children:n}),w.jsx("img",{id:"expand-icon",src:sv}),w.jsxs("div",{className:`sort-options ${l?"":"hidden"}`,children:[w.jsx("button",{className:`sort-option ${n=="Popularity"?"selected":""}`,onClick:a,children:"Popularity"}),w.jsx("button",{className:`sort-option ${n=="Release Date ↓"?"selected":""}`,onClick:s,children:"Release Date ↓"}),w.jsx("button",{className:`sort-option ${n=="Release Date ↑"?"selected":""}`,onClick:u,children:"Release Date ↑"}),w.jsx("button",{className:`sort-option ${n=="Name (A-Z)"?"selected":""}`,onClick:c,children:"Name (A-Z)"}),w.jsx("button",{className:`sort-option ${n=="Name (Z-A)"?"selected":""}`,onClick:p,children:"Name (Z-A)"}),w.jsx("button",{className:`sort-option ${n=="Rating"?"selected":""}`,onClick:h,children:"Rating"})]})]})}function cv({searched:e,cartInfo:t,showCart:n,handleShowCart:r,addToCart:l,deleteFromCart:i,clearCart:o,clickedSearch:a,handleClickedSearch:s}){const[u,c]=C.useState([]),[p,h]=C.useState(""),[k,S]=C.useState(!1),[g,x]=C.useState(!1),[d,f]=C.useState([]);let m=C.useRef(null);C.useEffect(()=>{const B=new MutationObserver(()=>{const W=P(a);W.length>1&&(m.current=W[1],m.current&&(m.current.click(),s(""),B.disconnect()))});return B.observe(document.body,{childList:!0,subtree:!0}),m.current=P(a)[1],m.current&&(m.current.click(),s("")),()=>{B.disconnect()}},[a]);function P(B){let W=document.getElementsByTagName("*"),oe=[];for(let me=0;me{e&&(m.current=P(a)[1],m.current&&m.current.click())},[e]);function R(B){const W=B.map(oe=>{let me,We=L(),b=z(We);return We==b?me=!1:me=!0,{...oe,discount:me,originalPrice:We,discountedPrice:b}});c(W)}function v(B){h(B)}function _(B){c(B)}function L(){let B=Math.floor(Math.random()*3),W="";switch(B){case 0:W="$4.99";break;case 1:W="$19.99";break;case 2:W="$59.99";break}return W}function z(B){if(Math.floor(Math.random()*10)<1){let oe=Math.floor(Math.random()*4),me=0;switch(oe){case 0:me=.25;break;case 1:me=.5;break;case 2:me=.75;break;case 3:me=.9;break}return`$${(parseFloat(B.slice(1))*(1-me)).toFixed(2)}`}return B}function I(B){let W="";B.currentTarget.className=="game-card-title"?W=B.currentTarget.parentElement.parentElement.children[1].children[0].children[1].children[0].textContent:W=B.currentTarget.parentElement.children[1].children[0].children[1].children[0].textContent,u.forEach(oe=>{(oe.id==B.currentTarget.parentElement.id||oe.id==B.currentTarget.parentElement.parentElement.id)&&(oe.price=W,f(oe))}),x(!0)}function q(B){x(!1)}return w.jsxs(w.Fragment,{children:[w.jsx(o0,{onEnter:R,onStorePage:!0,handleStoreData:R,onSectionChange:v,handleShowCart:r,handleClickedSearch:s}),n&&w.jsx(a0,{cartInfo:t,handleShowCart:r,deleteFromCart:i,clearCart:o}),g&&w.jsx(av,{previewData:d,closeGamePreview:q,cartInfo:t,addToCart:l}),w.jsxs("div",{className:"store",children:[w.jsx(Ym,{handleLoading:S,onApiData:R,onSectionChange:v,searched:e}),w.jsxs("div",{className:"store-content",children:[!k&&w.jsxs("div",{className:"store-header",children:[w.jsx("h1",{id:"header-text",className:"header",children:p}),w.jsx(uv,{storeData:u,setSortedStoreData:_})]}),!k&&w.jsx("div",{className:"games",children:u.map(B=>w.jsx(nv,{gameInfo:B,onClick:I,cartInfo:t,addToCart:l},xt()))}),k&&w.jsx("div",{className:"loading-content",children:w.jsx("img",{src:i0,alt:"loading icon"})})]})]})]})}function dv(){return w.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[w.jsx("h1",{children:"Uh oh! This page does not exist."}),w.jsx("a",{href:"/",children:"Back to home"})]})}function fv(){const[e,t]=C.useState(!1),[n,r]=C.useState(null),[l,i]=C.useState([]),[o,a]=C.useState(!1);C.useEffect(()=>{const g=localStorage.getItem("cart-info");g&&i(JSON.parse(g))},[]);function s(g){t(g)}function u(g){r(g)}function c(g){a(g)}function p(g){const x=[...l,g];i(x),localStorage.setItem("cart-info",JSON.stringify(x))}function h(g){const x=l.filter(d=>d!=g);i(x),localStorage.setItem("cart-info",JSON.stringify(x))}function k(){i([]),localStorage.setItem("cart-info",JSON.stringify([]))}const S=rm([{path:"/game-haven",element:w.jsx(Sc,{timeout:300,classNames:"fade",children:w.jsx($m,{handleSearched:s,cartInfo:l,showCart:o,handleShowCart:c,deleteFromCart:h,clearCart:k,handleClickedSearch:u})},"/game-haven"),errorElement:w.jsx(dv,{})},{path:"/game-haven/store",element:w.jsx(Sc,{timeout:300,classNames:"fade",children:w.jsx(cv,{searched:e,cartInfo:l,showCart:o,handleShowCart:c,addToCart:p,deleteFromCart:h,clearCart:k,handleClickedSearch:u,clickedSearch:n})},"/game-haven/store")}]);return w.jsx(fm,{router:S,children:w.jsx(Nm,{className:"transition-group",children:S.routeResults})})}Mo.createRoot(document.getElementById("root")).render(w.jsx(Ye.StrictMode,{children:w.jsx(fv,{})})); diff --git a/assets/index-hsZqQAbw.css b/assets/index-hsZqQAbw.css deleted file mode 100644 index f6bbd9d..0000000 --- a/assets/index-hsZqQAbw.css +++ /dev/null @@ -1 +0,0 @@ -#root{height:100vh;margin:0 auto;position:relative}.home-page{height:100%;position:relative;z-index:2}.home-page-content{width:calc(100% - 10rem);top:50%;left:0;transform:translateY(-50%);display:flex;justify-content:space-between;align-items:center;position:absolute;padding:0 5rem;z-index:2}.welcome{background-color:#0009;display:flex;flex-direction:column;align-items:center;gap:1rem;padding:2rem;border-radius:1rem;text-align:center}.welcome>h1,p{margin:0}.github-redir{background-color:#fff;display:flex;align-items:center;gap:10px;padding:.5rem;border-radius:.5rem;color:#000;transition:scale .2s ease}.github-redir:hover{color:#000;scale:1.05}.github-redir>img{width:30px}.to-store{background-color:#0009;padding:1rem;color:gray;font-size:2rem;font-weight:700;border-radius:1rem;transition:scale .2s ease}.to-store:hover{color:#fff;scale:1.1}.background-video{width:100%;height:100vh;position:fixed;top:0;left:0;z-index:1;object-fit:cover;pointer-events:none}@media screen and (max-width: 735px){.home-page-content{flex-direction:column;gap:1rem}}.nav-bar{display:flex;justify-content:space-between;align-items:center;padding:.5rem 2rem}.game-haven{color:#fff;display:flex;justify-content:center;align-items:center;gap:.5rem;transition:scale .4s ease;flex-shrink:0}.game-haven:hover{color:#fff;cursor:pointer;scale:1.1}#game-haven-logo{width:50px}.shopping-cart-button{background-color:transparent;border:none;min-width:40px;transition:scale .4s ease}.shopping-cart-button:hover{scale:1.1}#shopping-cart-icon{width:100%;filter:invert(.65)}@media screen and (max-width: 550px){#game-haven-text{display:none}.nav-bar{padding-left:1rem;padding-right:1rem;gap:1rem}}.search-bar{width:300px;transition:width .2s ease;position:relative;overflow-x:clip}.search-bar:focus-within{width:400px}.search-bar:focus-within .search-results{visibility:visible}.search-area{padding:0 .5rem;display:flex;justify-content:space-between;align-items:center;background-color:#141414;border-radius:12px;height:40px;transition:width .2s ease}.search-area>input{max-width:80%;flex-grow:1;outline:none;background-color:transparent;border:none;font-size:.95rem}#search-button{background-color:transparent;border:none;filter:invert(.65)}.search-results{visibility:visible;position:absolute;top:110%;left:0;max-height:280px;display:flex;flex-direction:column;width:100%;overflow:auto;overflow-x:hidden;border-radius:12px;z-index:10000}.search-results.hidden{visibility:hidden}.search-results.loading{display:flex;justify-content:center;align-items:center;background-color:#141414;visibility:visible;height:280px}#loading-icon{width:40px}.search-bar-result{width:100%;min-height:70px;display:flex;align-items:center;background-color:#141414}.search-bar-result:hover{background-color:#282828;cursor:pointer}.search-bar-game-image{min-width:160px;max-width:160px;height:70px;object-fit:cover}.search-bar-game-title{color:#fff;text-overflow:ellipsis;margin:0;padding:0 1rem}@media screen and (max-width: 550px){.search-bar-game-image{min-width:120px;max-width:120px}.search-bar-game-title{font-size:1rem}}@keyframes slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}.cart-background{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#0009;z-index:100;display:flex;justify-content:flex-end}.cart{display:flex;flex-direction:column;padding:1rem;width:300px;height:100%;background-color:#1e1e1e;animation:slide-in .3s ease}.cart-header{display:flex;justify-content:space-between;align-items:center}.cart-games{display:flex;flex-direction:column;gap:.5rem;overflow:auto;max-height:80%;overflow-x:hidden}#clear-cart-button{background-color:transparent;border:none;color:gray;font-weight:700;transition:color .2s ease}#clear-cart-button:hover{color:#fff}.cart-footer{display:flex;justify-content:space-between;align-items:center;margin-top:auto;margin-bottom:2rem}#cart-checkout-button{padding:1rem;min-height:50px;background-color:#006400;border:2px solid transparent;border-radius:.5rem;transition:border-color .2s ease;font-size:1.5rem;font-weight:700}#cart-checkout-button:hover{border-color:#fff}.cart-game{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.8rem;border-radius:.5rem;background-color:#323232}.cart-game-image{width:150px;object-fit:cover;aspect-ratio:1.7 / 1;border-radius:.5rem;background-color:#1e1e1e}.cart-game-info{display:flex;flex-direction:column}.cart-game-info>h3{font-size:1rem}.cart-game-info>h3,p{margin:0}.cart-game-price{color:gray}.remove-game-button{max-width:20px;min-width:20px;text-align:center;border:none;border-radius:50%;padding:0;font-size:1.2rem;font-weight:700}.checkout-modal-background{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#00000080;display:flex;justify-content:center;align-items:center;z-index:100}.checkout-modal{background:#fff;color:#000;padding:3rem;border-radius:.5rem;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1rem;font-size:2rem;animation:grow .3s ease}.checkout-modal>*{margin:0}.checkmark{display:flex;justify-content:center;align-items:center;background-color:#006400;color:#fff;border-radius:50%;width:90px;height:90px;font-size:4rem}.store{display:flex;gap:2rem}.store-content{display:flex;flex-direction:column;flex-grow:1}.loading-content{flex-grow:1;display:flex;justify-content:center;align-items:center;min-height:800px}.header{margin:0;margin-bottom:.5rem;padding-left:1rem}.games{padding:1rem;display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));justify-content:center;gap:1rem}.store-header{display:flex;flex-direction:column}@media screen and (max-width: 550px){#header-text{font-size:20px}}.side-nav-bar{position:sticky;top:0;height:fit-content;display:flex;flex-direction:column;color:#8c8c8c;flex-shrink:0}.side-nav-bar>div{display:flex;flex-direction:column}.list-header{color:#fff;padding:0;margin-left:1rem;margin-right:.5rem;font-size:1.2rem}.list-header>h2{margin:0;margin-top:1rem;border-bottom:1px solid white}.side-nav-bar>div>.list-header:hover{cursor:default;background-color:transparent;background:none}.nav-bar-item{display:flex;align-items:center;gap:.5rem;padding-left:1rem;padding-right:.5rem}.nav-bar-item:hover{color:#fff;cursor:pointer;background:linear-gradient(90deg,#323232,#1e1e1e)}.nav-bar-item.selected{color:#fff;background:linear-gradient(90deg,#323232,#1e1e1e)}.nav-bar-item>img{width:30px;filter:invert(1)}@media screen and (max-width: 550px){.nav-bar-item>h3{display:none}.list-header{display:none}.side-nav-bar{padding-top:1rem;width:10px}.nav-bar-item>img{min-width:30px;margin:.5rem 0}#fireworks-icon{width:30px}}.game-card{max-width:500px;background-color:#323232;border-radius:1rem;display:flex;flex-direction:column;transition:scale .3s ease;color:#fff}.game-card-info{flex-grow:1;display:flex;flex-direction:column;padding:8px 16px}.game-card:hover{scale:1.03}.game-card-image{object-fit:cover;border-top-left-radius:1rem;border-top-right-radius:1rem;cursor:pointer;aspect-ratio:1.7 / 1}.game-card-title{margin:0;cursor:pointer;width:fit-content}.prices{display:flex;gap:.4rem;align-items:center}.prices>p{margin:0}.game-card-price{color:#8c8c8c}.game-card-discounted-price{color:#64c84b}.add-to-cart-button{color:#8c8c8c;background:none;border:none;height:fit-content;padding:0}.add-to-cart-button:hover{color:#fff}.already-added-button{color:#8c8c8c;background:none;border:none;height:fit-content;padding:0;color:#64c84b}.already-added-button:hover{cursor:default}.game-card-platforms{display:flex;align-items:center;gap:10px;margin:4px 0}.logo{width:16px;filter:brightness(0) invert(1);-webkit-user-select:none;user-select:none}.ios{width:20px}.purchase-info{display:flex;justify-content:space-between;align-items:center}@keyframes grow{0%{scale:0}to{scale:1}}.game-preview-background{position:fixed;display:flex;justify-content:center;align-items:center;top:0;left:0;width:100vw;height:100vh;background-color:#0009;color:#000;z-index:100}.game-preview{padding:1rem;width:75%;height:60%;background-color:#323232;display:flex;gap:1rem;border-radius:.5rem;animation:grow .2s}.preview-side{display:flex;flex-direction:column;color:#fff}.preview-side>h1{margin:0 0 10px}.side-info{min-height:0;flex-grow:1;display:flex;flex-direction:column;justify-content:space-between;gap:1rem}.game-details{overflow:auto;background-color:#1e1e1e;color:#fff;padding:1rem;flex-grow:1;border-radius:1rem;overflow-x:hidden}.game-details>p{margin:0;font-size:1.2rem}.game-details>h2{font-size:1.8rem;margin:0 0 .5rem}#add-to-cart-button{min-height:60px;background-color:#006400;border:2px solid transparent;border-radius:.5rem;transition:border-color .2s ease;font-size:1.5rem;font-weight:700}#add-to-cart-button:hover{border-color:#fff}#already-in-cart-button{min-height:60px;background-color:#00640080;border:2px solid transparent;border-radius:.5rem;transition:border-color .2s ease;font-size:1.5rem;font-weight:700}#already-in-cart-button:hover{cursor:default;border-color:gray}@media screen and (max-width: 550px){.game-preview{flex-direction:column}.preview-side{max-height:70%}.preview-side>h1{font-size:1.5rem}.game-details>h2{font-size:1.2rem}.game-details>p{font-size:.9rem}}@keyframes fade-in{0%{opacity:0%}to{opacity:100%}}.image-viewer{position:relative;flex-grow:1;min-width:50%;max-width:50%;background-color:#1e1e1e;border-radius:1rem}.image-viewer-image{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;animation:fade-in .4s;border-radius:1rem}.image-viewer-button{position:absolute;top:50%;transform:translateY(-50%);border:none;outline:none;cursor:pointer;background-color:transparent;opacity:0;transition:opacity .2s ease}.image-viewer-button.shown{opacity:1}.image-viewer-button>img{filter:invert(1)}#back-arrow{left:0}#forward-arrow{right:0}@media screen and (max-width: 550px){.image-viewer{min-width:100%}.image-viewer-button{opacity:1}}.image-nav{background-color:#0006;border-radius:.5rem;padding:10px;position:absolute;bottom:0%;left:50%;transform:translate(-50%,-50%);display:flex;justify-content:center;align-items:center;gap:4px;opacity:0;transition:opacity .2s ease}.image-nav.shown{opacity:1}.image-nav-circle{border-radius:50%;height:10px;width:10px;border:none;opacity:0;transition:opacity .2s ease}.image-nav-circle.selected{background-color:#87cefa;scale:1.1}.image-nav-circle.shown{opacity:1}.sort-by{position:relative;margin-left:1rem;width:fit-content;display:flex;justify-content:center;align-items:center;background-color:#fff;color:#000;border-radius:.3rem;padding:.5rem;z-index:50}.sort-by:hover{cursor:pointer}.sort-by>button{background-color:#fff;color:#000;outline:none;border:none;font-size:1rem;font-weight:700}.sort-options{width:100%;position:absolute;top:92%;left:0;display:flex;flex-direction:column}.sort-options.hidden{visibility:hidden}.sort-option{background-color:#fff;color:#000;border:none;outline:none;height:30px;font-size:1rem;transition:background-color .1s ease;text-align:left;padding-left:8px}.sort-option:hover{background-color:#c8c8c8}.sort-option.selected{background-color:#0a0}.fade-enter{opacity:0}.fade-enter-active{opacity:1;transition:opacity 1s}.fade-exit{opacity:1}.fade-exit-active{opacity:0;transition:opacity 1s}.transition-group{position:relative}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;min-height:100vh;width:100vw;background-color:#1e1e1e;overflow-x:hidden}h1{font-size:3.2em;line-height:1.1}button{cursor:pointer}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} diff --git a/assets/index-pUMbL8Gl.css b/assets/index-pUMbL8Gl.css new file mode 100644 index 0000000..b697a2d --- /dev/null +++ b/assets/index-pUMbL8Gl.css @@ -0,0 +1 @@ +#root{height:100vh;margin:0 auto;position:relative}.home-page{height:100%;position:relative;z-index:2}.home-page-content{width:calc(100% - 10rem);top:50%;left:0;transform:translateY(-50%);display:flex;justify-content:space-between;align-items:center;position:absolute;padding:0 5rem;z-index:2}.welcome{background-color:#0009;display:flex;flex-direction:column;align-items:center;gap:1rem;padding:2rem;border-radius:1rem;text-align:center}.welcome>h1,p{margin:0}.github-redir{background-color:#fff;display:flex;align-items:center;gap:10px;padding:.5rem;border-radius:.5rem;color:#000;transition:scale .2s ease}.github-redir:hover{color:#000;scale:1.05}.github-redir>img{width:30px}.to-store{background-color:#0009;padding:1rem;color:gray;font-size:2rem;font-weight:700;border-radius:1rem;transition:scale .2s ease}.to-store:hover{color:#fff;scale:1.1}.background-video{width:100%;height:100vh;position:fixed;top:0;left:0;z-index:1;object-fit:cover;pointer-events:none}@media screen and (max-width: 735px){.home-page-content{flex-direction:column;gap:1rem}}.nav-bar{display:flex;justify-content:space-between;align-items:center;padding:.5rem 2rem}.game-haven{color:#fff;display:flex;justify-content:center;align-items:center;gap:.5rem;transition:scale .4s ease;flex-shrink:0}.game-haven:hover{color:#fff;cursor:pointer;scale:1.1}#game-haven-logo{width:50px}.shopping-cart-button{background-color:transparent;border:none;min-width:40px;transition:scale .4s ease}.shopping-cart-button:hover{scale:1.1}#shopping-cart-icon{width:100%;filter:invert(.65)}@media screen and (max-width: 550px){#game-haven-text{display:none}.nav-bar{padding-left:1rem;padding-right:1rem;gap:1rem}}.search-bar{width:300px;transition:width .2s ease;position:relative;overflow-x:clip}.search-bar:focus-within{width:400px}.search-bar:focus-within .search-results{visibility:visible}.search-area{padding:0 .5rem;display:flex;justify-content:space-between;align-items:center;background-color:#141414;border-radius:12px;height:40px;transition:width .2s ease}.search-area>input{max-width:80%;flex-grow:1;outline:none;background-color:transparent;border:none;font-size:.95rem}#search-button{background-color:transparent;border:none;filter:invert(.65)}.search-results{visibility:visible;position:absolute;top:110%;left:0;max-height:280px;display:flex;flex-direction:column;width:100%;overflow:auto;overflow-x:hidden;border-radius:12px;z-index:10000}.search-results.hidden{visibility:hidden}.search-results.loading{display:flex;justify-content:center;align-items:center;background-color:#141414;visibility:visible;height:280px}#loading-icon{width:40px}.search-bar-result{width:100%;min-height:70px;display:flex;align-items:center;background-color:#141414}.search-bar-result:hover{background-color:#282828;cursor:pointer}.search-bar-game-image{min-width:160px;max-width:160px;height:70px;object-fit:cover}.search-bar-game-title{color:#fff;text-overflow:ellipsis;margin:0;padding:0 1rem}@media screen and (max-width: 550px){.search-bar-game-image{min-width:120px;max-width:120px}.search-bar-game-title{font-size:1rem}}@keyframes slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}.cart-background{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#0009;z-index:100;display:flex;justify-content:flex-end}.cart{display:flex;flex-direction:column;padding:1rem;width:300px;height:100%;background-color:#1e1e1e;animation:slide-in .3s ease}.cart-header{display:flex;justify-content:space-between;align-items:center}.cart-games{display:flex;flex-direction:column;gap:.5rem;overflow:auto;max-height:80%;overflow-x:hidden}#clear-cart-button{background-color:transparent;border:none;color:gray;font-weight:700;transition:color .2s ease}#clear-cart-button:hover{color:#fff}.cart-footer{display:flex;justify-content:space-between;align-items:center;margin-top:auto;margin-bottom:2rem}#cart-checkout-button{padding:1rem;min-height:50px;background-color:#006400;border:2px solid transparent;border-radius:.5rem;transition:border-color .2s ease;font-size:1.5rem;font-weight:700}#cart-checkout-button:hover{border-color:#fff}.cart-game{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.8rem;border-radius:.5rem;background-color:#323232}.cart-game-image{width:150px;object-fit:cover;aspect-ratio:1.7 / 1;border-radius:.5rem;background-color:#1e1e1e}.cart-game-info{display:flex;flex-direction:column}.cart-game-info>h3{font-size:1rem}.cart-game-info>h3,p{margin:0}.cart-game-price{color:gray}.remove-game-button{max-width:20px;min-width:20px;text-align:center;border:none;border-radius:50%;padding:0;font-size:1.2rem;font-weight:700}.checkout-modal-background{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#00000080;display:flex;justify-content:center;align-items:center;z-index:100}.checkout-modal{background:#fff;color:#000;padding:3rem;border-radius:.5rem;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1rem;font-size:2rem;animation:grow .3s ease}.checkout-modal>*{margin:0}.checkmark{display:flex;justify-content:center;align-items:center;background-color:#006400;color:#fff;border-radius:50%;width:90px;height:90px;font-size:4rem}.store{display:flex;gap:2rem;background-color:#1e1e1e}.store-content{display:flex;flex-direction:column;flex-grow:1}.loading-content{flex-grow:1;display:flex;justify-content:center;align-items:center;min-height:800px}.header{margin:0;margin-bottom:.5rem;padding-left:1rem}.games{padding:1rem;display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));justify-content:center;gap:1rem}.store-header{display:flex;flex-direction:column}@media screen and (max-width: 550px){#header-text{font-size:20px}}.side-nav-bar{position:sticky;top:0;height:fit-content;display:flex;flex-direction:column;color:#8c8c8c;flex-shrink:0}.side-nav-bar>div{display:flex;flex-direction:column}.list-header{color:#fff;padding:0;margin-left:1rem;margin-right:.5rem;font-size:1.2rem}.list-header>h2{margin:0;margin-top:1rem;border-bottom:1px solid white}.side-nav-bar>div>.list-header:hover{cursor:default;background-color:transparent;background:none}.nav-bar-item{display:flex;align-items:center;gap:.5rem;padding-left:1rem;padding-right:.5rem}.nav-bar-item:hover{color:#fff;cursor:pointer;background:linear-gradient(90deg,#323232,#1e1e1e)}.nav-bar-item.selected{color:#fff;background:linear-gradient(90deg,#323232,#1e1e1e)}.nav-bar-item>img{width:30px;filter:invert(1)}@media screen and (max-width: 550px){.nav-bar-item>h3{display:none}.list-header{display:none}.side-nav-bar{padding-top:1rem;width:10px}.nav-bar-item>img{min-width:30px;margin:.5rem 0}#fireworks-icon{width:30px}}.game-card{max-width:500px;background-color:#323232;border-radius:1rem;display:flex;flex-direction:column;transition:scale .3s ease;color:#fff}.game-card-info{flex-grow:1;display:flex;flex-direction:column;padding:8px 16px}.game-card:hover{scale:1.03}.game-card-image{object-fit:cover;border-top-left-radius:1rem;border-top-right-radius:1rem;cursor:pointer;aspect-ratio:1.7 / 1}.game-card-title{margin:0;cursor:pointer;width:fit-content}.prices{display:flex;gap:.4rem;align-items:center}.prices>p{margin:0}.game-card-price{color:#8c8c8c}.game-card-discounted-price{color:#64c84b}.add-to-cart-button{color:#8c8c8c;background:none;border:none;height:fit-content;padding:0}.add-to-cart-button:hover{color:#fff}.already-added-button{color:#8c8c8c;background:none;border:none;height:fit-content;padding:0;color:#64c84b}.already-added-button:hover{cursor:default}.game-card-platforms{display:flex;align-items:center;gap:10px;margin:4px 0}.logo{width:16px;filter:brightness(0) invert(1);-webkit-user-select:none;user-select:none}.ios{width:20px}.purchase-info{display:flex;justify-content:space-between;align-items:center}@keyframes grow{0%{scale:0}to{scale:1}}.game-preview-background{position:fixed;display:flex;justify-content:center;align-items:center;top:0;left:0;width:100vw;height:100vh;background-color:#0009;color:#000;z-index:100}.game-preview{padding:1rem;width:75%;height:60%;background-color:#323232;display:flex;gap:1rem;border-radius:.5rem;animation:grow .2s}.preview-side{display:flex;flex-direction:column;color:#fff}.preview-side>h1{margin:0 0 10px}.side-info{min-height:0;flex-grow:1;display:flex;flex-direction:column;justify-content:space-between;gap:1rem}.game-details{overflow:auto;background-color:#1e1e1e;color:#fff;padding:1rem;flex-grow:1;border-radius:1rem;overflow-x:hidden}.game-details>p{margin:0;font-size:1.2rem}.game-details>h2{font-size:1.8rem;margin:0 0 .5rem}#add-to-cart-button{min-height:60px;background-color:#006400;border:2px solid transparent;border-radius:.5rem;transition:border-color .2s ease;font-size:1.5rem;font-weight:700}#add-to-cart-button:hover{border-color:#fff}#already-in-cart-button{min-height:60px;background-color:#00640080;border:2px solid transparent;border-radius:.5rem;transition:border-color .2s ease;font-size:1.5rem;font-weight:700}#already-in-cart-button:hover{cursor:default;border-color:gray}@media screen and (max-width: 550px){.game-preview{flex-direction:column}.preview-side{max-height:70%}.preview-side>h1{font-size:1.5rem}.game-details>h2{font-size:1.2rem}.game-details>p{font-size:.9rem}}@keyframes fade-in{0%{opacity:0%}to{opacity:100%}}.image-viewer{position:relative;flex-grow:1;min-width:50%;max-width:50%;background-color:#1e1e1e;border-radius:1rem}.image-viewer-image{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;animation:fade-in .4s;border-radius:1rem}.image-viewer-button{position:absolute;top:50%;transform:translateY(-50%);border:none;outline:none;cursor:pointer;background-color:transparent;opacity:0;transition:opacity .2s ease}.image-viewer-button.shown{opacity:1}.image-viewer-button>img{filter:invert(1)}#back-arrow{left:0}#forward-arrow{right:0}@media screen and (max-width: 550px){.image-viewer{min-width:100%}.image-viewer-button{opacity:1}}.image-nav{background-color:#0006;border-radius:.5rem;padding:10px;position:absolute;bottom:0%;left:50%;transform:translate(-50%,-50%);display:flex;justify-content:center;align-items:center;gap:4px;opacity:0;transition:opacity .2s ease}.image-nav.shown{opacity:1}.image-nav-circle{border-radius:50%;height:10px;width:10px;border:none;opacity:0;transition:opacity .2s ease}.image-nav-circle.selected{background-color:#87cefa;scale:1.1}.image-nav-circle.shown{opacity:1}.sort-by{position:relative;margin-left:1rem;width:fit-content;display:flex;justify-content:center;align-items:center;background-color:#fff;color:#000;border-radius:.3rem;padding:.5rem;z-index:50}.sort-by:hover{cursor:pointer}.sort-by>button{background-color:#fff;color:#000;outline:none;border:none;font-size:1rem;font-weight:700}.sort-options{width:100%;position:absolute;top:92%;left:0;display:flex;flex-direction:column}.sort-options.hidden{visibility:hidden}.sort-option{background-color:#fff;color:#000;border:none;outline:none;height:30px;font-size:1rem;transition:background-color .1s ease;text-align:left;padding-left:8px}.sort-option:hover{background-color:#c8c8c8}.sort-option.selected{background-color:#0a0}.fade-enter{opacity:0}.fade-enter-active{opacity:1;transition:opacity 1s}.fade-exit{opacity:1}.fade-exit-active{opacity:0;transition:opacity 1s}.transition-group{position:relative}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;min-height:100vh;width:100vw;background-color:#1e1e1e;overflow-x:hidden}h1{font-size:3.2em;line-height:1.1}button{cursor:pointer}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} diff --git a/index.html b/index.html index 88236b8..b045e0d 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,8 @@ Game Haven - - + +