From 529f6d6086f4ae9738c82f40c0a2e5b8fffe11f2 Mon Sep 17 00:00:00 2001 From: wearrrrr Date: Mon, 8 Jul 2024 23:14:11 -0500 Subject: [PATCH] Add searching to games page, and refine the page a lot. --- src/components/GameItem.astro | 2 +- src/i18n/en.json | 1 + src/i18n/jp.json | 1 + src/pages/[lang]/games.astro | 77 +++++++++++++++++++++++++++-------- 4 files changed, 63 insertions(+), 18 deletions(-) diff --git a/src/components/GameItem.astro b/src/components/GameItem.astro index 91cd955..b711d1f 100644 --- a/src/components/GameItem.astro +++ b/src/components/GameItem.astro @@ -2,7 +2,7 @@ const { name, image, slugName } = Astro.props; --- -
+
diff --git a/src/i18n/en.json b/src/i18n/en.json index 6d9f6bd..b5ea7b0 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -33,6 +33,7 @@ "footer.aluProject": "Alu Project", "games.title": "Games", + "games.search": "Search...", "settings.title": "Settings", "settings.proxy": "Proxy", diff --git a/src/i18n/jp.json b/src/i18n/jp.json index 3fffeae..aa6f144 100644 --- a/src/i18n/jp.json +++ b/src/i18n/jp.json @@ -33,6 +33,7 @@ "footer.aluProject": "Alu Project", "games.title": "ゲーム", + "games.search": "検索...", "settings.title": "設定", "settings.proxy": "プロキシ", diff --git a/src/pages/[lang]/games.astro b/src/pages/[lang]/games.astro index 37deb85..ab796c1 100644 --- a/src/pages/[lang]/games.astro +++ b/src/pages/[lang]/games.astro @@ -4,6 +4,7 @@ import games from "../../json/games.json"; import GameItem from "@components/GameItem.astro"; import { STATIC_PATHS, i18n } from "@i18n/utils"; +import Input from "@components/UI/Input.astro"; const t = i18n.inferLangUseTranslations(Astro.url); export function getStaticPaths() { @@ -13,6 +14,10 @@ export function getStaticPaths() {

{t("games.title")}

+ +
{ Object.keys(games).map((key) => { @@ -23,31 +28,69 @@ export function getStaticPaths() {
+ +