PageSourceSearch

https://gamers-era.vercel.app/_next/static/chunks/pages/index-8d6f9905b2a8a4bb.js

js gamers-era.vercel.app collected 2026-10-03 06:59:23 UTC 7,288 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{8312:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return a(8464)}])},4789:function(e,t,a){"use strict";a.d(t,{Z:function(){return n}});var r=a(5893);function n(e){let{heading:t}=e;return(0,r.jsx)("h1",{className:"mb-4 text-4xl font-bold lg:text-6xl",children:t})}},8464:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return B}});var r=a(5893),n=a(9008),i=a.n(n),s=a(8611),l=a(7294),o=a(8767),d=a(1544),c=a(2729),u=a(858),m=a(9309),h=a(1214),x=a(154),g=a(6413),f=a(9924);let p=[{name:"Main",path:"/games/lists/main?&discover=true&page_size=40"},{name:"Best of the Year",path:"/games/lists/greatest?discover=true&page_size=40"},{name:"Best of 2022",path:"/games/lists/greatest?year=2022&discover=true&page_size=40"},{name:"All time top 250",path:"/games/lists/popular?discover=true&page_size=40"}],b=async e=>{let{pageIndex:t=0,option:a="relevance",pageParam:r=1}=e,{data:n}=await g.Z.get("".concat(p[t].path,"&ordering=-").concat(a,"&page=").concat(r,"&key=").concat("408ff90ac42e40c6b85bf1fdae27acae"));return null==n?void 0:n.results};function w(){var e;let[t,a]=(0,l.useState)("relevance"),[n,i]=(0,l.useState)(0),[s,g]=(0,l.useState)(!1),{data:w,isError:v,isLoading:j,isFetching:y,hasNextPage:k,fetchNextPage:N,isFetchingNextPage:_}=(0,o.useInfiniteQuery)(["getGames",t,n],e=>{let{pageParam:a=1}=e;return b({pageIndex:n,option:t,pageParam:a})},{getNextPageParam(e,t){if(!(e.length<40)&&t.length)return t.length+1},keepPreviousData:!0});return((0,l.useEffect)(()=>g(!1),[j,y]),j)?(0,r.jsx)(h.Z,{size:30}):v?(0,r.jsx)(m.Z,{}):(0,r.jsxs)("div",{className:"flex flex-col items-center gap-4 pb-14",children:[(0,r.jsx)("div",{className:"my-8 w-full overflow-y-hidden border-b border-primary-light/50 text-center text-body-1 font-medium text-white/50 md:mb-2",children:(0,r.jsx)("ul",{className:"-mb-[2px] flex w-full overflow-x-scroll",children:p.map((e,t)=>(0,r.jsx)("li",{children:(0,r.jsx)("button",{type:"button",onClick:()=>i(t),className:"w-fit border-t-2 border-transparent p-4 transition-all duration-300 hover:border-white hover:text-white ".concat(t===n&&"border-t-secondary text-secondary"),children:e.name})},e.name))})}),(0,r.jsxs)("div",{className:"relative w-full md:mb-2",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>g(e=>!e),className:"inline-flex w-full items-center justify-between rounded-lg bg-secondary p-4 text-center text-body-1 capitalize text-white hover:bg-secondary/80 focus:outline-none focus:ring-4 focus:ring-primary-light/20 md:w-52",children:["Order by: ",t," ",(0,r.jsx)("svg",{className:"ml-2 h-4 w-4 transition-all duration-300 ".concat(s&&"rotate-180"),"aria-hidden":"true",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),(0,r.jsx)(d.M,{children:s&&(0,r.jsx)("div",{className:"absolute top-16 z-10 w-full divide-y divide-gray-100 overflow-hidden rounded-lg bg-white shadow dark:bg-gray-700 md:w-52",children:(0,r.jsx)(c.E.ul,{initial:"initial",animate:"animate",exit:"exit",variants:f.d7,className:"w-full divide-y divide-primary-dark text-sm text-gray-700 dark:text-gray-200",children:["relevance","name","released","added","created","updated","rating","metacritic"].map(e=>(0,r.jsx)(c.E.li,{variants:f.d7,className:"w-full",children:(0,r.jsx)("button",{type:"button",onClick(){a(e)},className:"w-full p-4 capitalize hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white",children:e})},e))})})})]}),(0,r.jsx)(x.Z,{children:null==w?void 0:null===(e=w.pages)||void 0===e?void 0:e.map(e=>e.map(e=>(0,r.jsx)("div",{children:(0,r.jsx)(u.Z,{details:e})},"".concat(e.id).concat(Math.random()))))}),(0,r.jsx)("button",{type:"button",disabled:!k||_,onClick:()=>k&&N(),className:"rounded-md bg-primary-light px-6 py-2 text-white",children:_?"Loading more...":k?"Load More":"Nothing more to load"})]})}var v=a(4789),j=a(1664),y=a.n(j),k=a(5675),N=a.n(k),_=a(1163),Z=a(1587),z=a(8382),E=a(7133),C=a(7460);function L(e){let{detail:t}=e,a=(0,_.useRouter)(),{currentUser:n}=(0,Z.Z)(),{bookmarksData:i}=(0,z.Z)(),{handleAddBookmark:s}=(0,E.Z)(),[o,d]=(0,l.useState)(!1),c=e=>n?s(i,e):a.push("/bookmarks");return(0,l.useEffect)(()=>{let e=setTimeout(()=>d(!1),1500);return()=>clearTimeout(e)},[o]),(0,r.jsxs)("div",{className:"relative h-full w-72 max-w-xl overflow-hidden rounded-lg md:h-60 md:w-96",children:[(0,r.jsx)(N(),{src:t.background_image||C.Z,alt:t.name,width:1e3,height:1e3,className:"h-48 w-full object-cover object-top md:h-full"}),(0,r.jsx)("div",{className:"absolute bottom-0 w-full py-4 px-3 backdrop-blur-md backdrop-filter",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-6",children:[(0,r.jsx)(y(),{href:"/game/".concat(t.slug),className:"truncate text-ellipsis border-b border-b-transparent text-body-1 font-medium transition-all duration-100 hover:border-b hover:border-b-secondary",children:t.name}),(0,r.jsxs)("button",{type:"button",onClick(){c(t),d(!0)},className:"group flex w-fit items-center justify-center gap-1 text-body-1",children:[(0,r.jsx)("span",{className:"hidden md:inline-block",children:o?"Bookmarked":"Bookmark"}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-6 w-6 text-white group-hover:fill-white md:h-4 md:w-4",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0111.186 0z"})})]})]})})]})}let M=async e=>{let{pageParam:t=1}=e,{data:a}=await g.Z.get("/games/lists/main?key=".concat("408ff90ac42e40c6b85bf1fdae27acae","&ordering=-released&page_size=10&page=").concat(t));return null==a?void 0:a.results};function P(){let{data:e,isError:t,isLoading:a,hasNextPage:n,fetchNextPage:i,isFetchingNextPage:s}=(0,o.useInfiniteQuery)(["getTrendingGames"],M,{getNextPageParam(e,t){if(!(e.length<10)&&t.length)return t.length+1}});return a?(0,r.jsx)(h.Z,{size:5,isHorizontal:!0}):t?(0,r.jsx)(m.Z,{}):(0,r.jsxs)("div",{className:"w-full overflow-hidden md:mb-8",children:[(0,r.jsx)(v.Z,{heading:"New and Upcoming Games"}),(0,r.jsxs)("ul",{className:"scrollbar-hide grid snap-x snap-proximity grid-flow-col items-center gap-4 overflow-x-scroll ",children:[null==e?void 0:e.pages.map(e=>e.map(e=>(0,r.jsx)("li",{className:"snap-start",children:(0,r.jsx)(L,{detail:e})},e.slug))),(0,r.jsx)("li",{className:"h-full w-32",children:(0,r.jsx)("button",{type:"button",disabled:!n||s,onClick:()=>n&&i(),className:"h-full w-full rounded-md bg-primary-light px-6 py-2 text-white",children:s?"Loading more...":n?"Load More":"Nothing more to load"})})]})]})}function B(){return(0,r.jsxs)("div",{children:[(0,r.jsxs)(i(),{children:[(0,r.jsx)("title",{children:"Gamers Era"}),(0,r.jsx)("meta",{name:"description",content:"Main page of Gamers Era"}),(0,r.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,r.jsxs)("div",{className:"w-full overflow-hidden",children:[(0,r.jsx)(P,{}),(0,r.jsx)(s.Z,{}),(0,r.jsx)(w,{})]})]})}}},function(e){e.O(0,[715,903,774,888,179],function(){return e(e.s=8312)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.