Skip to content

Commit

Permalink
Merge pull request #92 from gabuscuv/development/main
Browse files Browse the repository at this point in the history
Development/main
  • Loading branch information
gabuscuv authored Nov 28, 2024
2 parents f5ac7bf + 7ed1941 commit f5cfbb3
Show file tree
Hide file tree
Showing 7 changed files with 897 additions and 583 deletions.
46 changes: 39 additions & 7 deletions app/BeatenGames.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@ import {useEffect, useState} from "react";
import BeatenGameList from "./Component/BeatenGameList";
import {game} from "./game";
import {useSearchParams} from "next/navigation";
import {Dropdown} from "flowbite-react";

interface jsonsS {
VNs: Array<game>;
GaaS: Array<game>;
GamesYearly: { [id: string]: Array<game> };
}

enum type {
Games,
GaaS,
// VNs,

}

export default function BeatenGames() {
const searchParams = useSearchParams();
const [mode, setMode] = useState<type>(type.Games);
const [year, setYear] = useState(initYear());
const [keys, setKeys] = useState([
new Date(Date.now()).getFullYear().toString(),
Expand All @@ -36,6 +46,19 @@ export default function BeatenGames() {
});
}, []);

function getGameList(stuff: type): Array<game>
{
if (!games) { return []; }
switch (stuff)
{

case type.Games: return games.GamesYearly[year];
/// case type.VNs: return [];
case type.GaaS: return games.GaaS;
default: return [];
}
}

function ChangedYear(year: string) {
//searchParams.set("year", year);
setYear(year);
Expand All @@ -50,24 +73,33 @@ export default function BeatenGames() {
}

return (
<div className="App">
<header className="App-header">
<Combobox
<div className="App App-header">
<header className="flex p-5 space-x-5 z-10">
<Dropdown label={type[mode]} >
{Object.keys(type).filter(e=> Number.isNaN(Number(e))).map((e, count) =>
<Dropdown.Item key={"DropdownItem"+e} onClick={()=>setMode(count)}>{e}</Dropdown.Item>)}
</Dropdown>

{(type.Games === mode && <Combobox
className="Combobox"
name="fieldyear"
defaultValue={year?.toString()}
data={keys}
onChange={ChangedYear}
></Combobox>
{games === undefined ? (
></Combobox>)}


</header>
<main className="">
{games === undefined ? (
<div>Loading</div>
) : (
<BeatenGameList
gameList={games.GamesYearly[year] || []}
gameList={getGameList(mode)}
allowNSFW={searchParams.get("nsfw") === "1"}
/>
)}
</header>
</main>
</div>
);
}
19 changes: 12 additions & 7 deletions app/Component/BeatenGameList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,20 @@ export function BeatenGameList(props: {
className={"items-center flex flex-col py-5" + getPlataformCSSClass(element["status"])}
>
<div className=" flex flex-col relative">
<Image
<div className="flex space-x-2 overlay">
{element["plataform"].split(',').map((e, index, array) =>
<Image
key={element.name+"plataform"+e+"icon"}
className={
" overlay " + getPlataformCSSClass(element["plataform"])
" " + getPlataformCSSClass(e)
}
height={200 }
width={200}
src={getPlataformLogo(element["plataform"])}
alt={element["plataform"] + " logo"}
/>
height={200/array.length}
width={200/array.length}
src={getPlataformLogo(e)}
alt={e + " logo"}
/>)}
</div>

<Image
className="Image object-scale-down"
height={400}
Expand Down
7 changes: 5 additions & 2 deletions app/Component/imageData.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
"PC (itch.io)": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/Itch.io_logo.svg/320px-Itch.io_logo.svg.png",
"PC (Origin)": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f2/Origin.svg/320px-Origin.svg.png",
"PC (EGS)": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/57/Epic_games_store_logo.svg/157px-Epic_games_store_logo.svg.png",
"Android": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Android_2023_3D_logo_and_wordmark.svg/320px-Android_2023_3D_logo_and_wordmark.svg.png",
"AArcade": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/Apple-arcade-logo.svg/320px-Apple-arcade-logo.svg.png",
"NSW": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/Nintendo_switch_logo.png/240px-Nintendo_switch_logo.png",
"3DS": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Nintendo_3ds_logo.svg/320px-Nintendo_3ds_logo.svg.png",
"3DS": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Nintendo_3DS_logo.svg/320px-Nintendo_3DS_logo.svg.png",
"NDS": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Nintendo_DS_Logo.svg/320px-Nintendo_DS_Logo.svg.png",
"PS4": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/87/PlayStation_4_logo_and_wordmark.svg/320px-PlayStation_4_logo_and_wordmark.svg.png",
"PS3": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/PlayStation_3_logo_%282009%29.svg/320px-PlayStation_3_logo_%282009%29.svg.png",
"PSV": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/PlayStation_Vita_logo.svg/320px-PlayStation_Vita_logo.svg.png",
"PSP": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/PSP_Logo.svg/320px-PSP_Logo.svg.png",
"PSX": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/PSone_logo.svg/320px-PSone_logo.svg.png",
"Wii": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Wii.svg/320px-Wii.svg.png",
"Stadia": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/98/Stadia_logo.svg/320px-Stadia_logo.svg.png"
"Stadia": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/98/Stadia_logo.svg/320px-Stadia_logo.svg.png",
"iOS": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/63/IOS_wordmark_%282017%29.svg/320px-IOS_wordmark_%282017%29.svg.png"
},
"classes":
{
Expand All @@ -28,6 +30,7 @@
"PC (Oculus)": "overlay-white",
"PC (XGP)": "overlay-PCXGP",
"PC (itch.io)": "overlay-white",
"iOS": "overlay-white",
"Stadia": "overlay-stadia",
"AArcade": "overlay-white",
"PS4": " overlay-ps4",
Expand Down
12 changes: 8 additions & 4 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
#set -e

# build
npm run build
yarn build

# navigate into the build output directory
cd build
cd out

touch ./.nojekyll

#cp -r ../deploy/.* .

# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME

git init
git config --local user.name "S. Otha Scarlet"
git config --local user.email "sohtascarlet@gmail.com"
git config --local user.name "dsa"
git config --local user.email "dsa@gmail.com"
git add -A
git commit -m 'deploy'

Expand Down
2 changes: 1 addition & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {output: 'export', images: { unoptimized: true }};
const nextConfig = {basePath:'/BeatenGames',output: 'export', images: { unoptimized: true }};

export default nextConfig;
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
"lint": "next lint"
},
"dependencies": {
"next": "14.2.3",
"flowbite-react": "^0",
"next": "^14",
"react": "^18",
"react-dom": "^18",
"react-widgets": "^5.8.4"
"react-widgets": "^5"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"eslint-config-next": "^14",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"tailwindcss": "^3",
"typescript": "^5"
},
"packageManager": "[email protected]"
Expand Down
Loading

0 comments on commit f5cfbb3

Please sign in to comment.