From 9c2c7f78185fcfc8ff81fad5ca6c2a3f2375e0f5 Mon Sep 17 00:00:00 2001 From: Firq Date: Mon, 15 Jul 2024 14:39:52 +0200 Subject: [PATCH] Redesign Part 2 --- package.json | 2 +- .../listings/eventListingLine.astro | 116 +++++++++++++++++ .../questListingCard.astro} | 0 .../listings/questListingLine.astro | 121 ++++++++++++++++++ src/content/changes/koyan.json | 10 ++ src/content/changes/skadi.json | 10 ++ src/content/config.ts | 10 ++ src/content/groups/lostbelt-6.json | 5 +- src/content/taInfoData/beast4l.json | 3 +- src/content/taInfoData/case-files-rerun.json | 3 +- .../taInfoData/devilish-bodhisattva.json | 5 +- src/content/taInfoData/lostbelt-6/albion.json | 3 +- .../taInfoData/lostbelt-6/cernunnos.json | 3 +- src/content/taInfoData/lostbelt-6/morgan.json | 3 +- src/layouts/databaseSection.astro | 15 ++- src/pages/database/[...slug].astro | 2 +- src/pages/database/index.astro | 47 +++++-- src/pages/teslafest/index.astro | 2 +- 18 files changed, 332 insertions(+), 28 deletions(-) create mode 100644 src/components/listings/eventListingLine.astro rename src/components/{questListing.astro => listings/questListingCard.astro} (100%) create mode 100644 src/components/listings/questListingLine.astro create mode 100644 src/content/changes/koyan.json create mode 100644 src/content/changes/skadi.json diff --git a/package.json b/package.json index 27a5ec4..36c2c99 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fgo-ta-com-website", "type": "module", - "version": "0.2.2-pre.2", + "version": "0.2.2-pre.3", "scripts": { "dev": "astro dev", "start": "astro dev", diff --git a/src/components/listings/eventListingLine.astro b/src/components/listings/eventListingLine.astro new file mode 100644 index 0000000..eab60df --- /dev/null +++ b/src/components/listings/eventListingLine.astro @@ -0,0 +1,116 @@ +--- +export interface Props { + title: string + releaseDate: Date + shortdescription: string + link: string +} + +const options_date: Intl.DateTimeFormatOptions = { + year: 'numeric', + month: 'long', + day: '2-digit', +} + +const { shortdescription, releaseDate, title, link } = Astro.props +const render_date = releaseDate.toLocaleDateString('en-GB', options_date) +--- + + +
+
+

{title}

+

{render_date}

+

{shortdescription}

+
+
+ + diff --git a/src/components/questListing.astro b/src/components/listings/questListingCard.astro similarity index 100% rename from src/components/questListing.astro rename to src/components/listings/questListingCard.astro diff --git a/src/components/listings/questListingLine.astro b/src/components/listings/questListingLine.astro new file mode 100644 index 0000000..844a858 --- /dev/null +++ b/src/components/listings/questListingLine.astro @@ -0,0 +1,121 @@ +--- +export interface Props { + baseurl: string + slug: string + title: string + releaseDate: Date + shortdescription: string +} + +const options_date: Intl.DateTimeFormatOptions = { + year: 'numeric', + month: 'long', + day: '2-digit', +} + +const { shortdescription, releaseDate, slug, title, baseurl } = Astro.props +const url = `/${baseurl}/${slug}` +const render_date = releaseDate.toLocaleDateString( + 'en-GB', + options_date +) +--- + + +
+
+

{title}

+

{render_date}

+

{shortdescription}

+
+
+ + diff --git a/src/content/changes/koyan.json b/src/content/changes/koyan.json new file mode 100644 index 0000000..c5db81d --- /dev/null +++ b/src/content/changes/koyan.json @@ -0,0 +1,10 @@ +{ + "info": { + "title": "Koyanskaya of Light", + "releaseDate": "2023-07-03", + "shortdescription": "Release of Koyanskaya of Light during 6th Anniversary of the game", + "releaseNumber": 1, + "type": "event" + }, + "link": "https://apps.atlasacademy.io/db/NA/servant/314/" +} diff --git a/src/content/changes/skadi.json b/src/content/changes/skadi.json new file mode 100644 index 0000000..21f57fd --- /dev/null +++ b/src/content/changes/skadi.json @@ -0,0 +1,10 @@ +{ + "info": { + "title": "Scathach-Skadi", + "releaseDate": "2020-07-06", + "shortdescription": "Release of Scathach-Skadi during 3rd Anniversary of the game", + "releaseNumber": 1, + "type": "event" + }, + "link": "https://apps.atlasacademy.io/db/NA/servant/215/" +} diff --git a/src/content/config.ts b/src/content/config.ts index 95cbf6d..66bf45d 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -23,6 +23,7 @@ const info = z.object({ releaseDate: z.string().transform((str) => new Date(str)), shortdescription: z.string(), releaseNumber: z.number().default(1), + type: z.enum(["quest", "event", "group"]).default("quest") }) // Combined ta data collection schema @@ -39,8 +40,17 @@ const groupDescription = defineCollection({ schema: z.object({ info: info }), }) +const changes = defineCollection({ + type: 'data', + schema: z.object({ + info: info, + link: z.string().url() + }), +}) + export const collections = { taInfoData: taData, teslafest: taData, groups: groupDescription, + changes: changes, } diff --git a/src/content/groups/lostbelt-6.json b/src/content/groups/lostbelt-6.json index 0c276c7..3494f8b 100644 --- a/src/content/groups/lostbelt-6.json +++ b/src/content/groups/lostbelt-6.json @@ -1,8 +1,9 @@ { "info": { "title": "Lostbelt 6", - "releaseDate": "2023-07-10", + "releaseDate": "2023-06-06", "shortdescription": "Lostbelt 6", - "releaseNumber": 1 + "releaseNumber": 1, + "type": "group" } } diff --git a/src/content/taInfoData/beast4l.json b/src/content/taInfoData/beast4l.json index c2c245e..eaa34df 100644 --- a/src/content/taInfoData/beast4l.json +++ b/src/content/taInfoData/beast4l.json @@ -2,7 +2,8 @@ "info": { "title": "Beast IV:L", "releaseDate": "2023-12-26", - "shortdescription": "An interesting conclusion to Tunguska to say the least" + "shortdescription": "An interesting conclusion to Tunguska to say the least", + "type": "quest" }, "quests": [ { diff --git a/src/content/taInfoData/case-files-rerun.json b/src/content/taInfoData/case-files-rerun.json index 8dc523c..6e54788 100644 --- a/src/content/taInfoData/case-files-rerun.json +++ b/src/content/taInfoData/case-files-rerun.json @@ -3,7 +3,8 @@ "title": "Case Files Rerun 2024", "releaseDate": "2024-01-10", "shortdescription": "The rerun of the collaboration event with the Case Files franchise - and the return of old challenges as well as a new challenge quest.", - "releaseNumber": 1 + "releaseNumber": 1, + "type": "quest" }, "quests": [ { diff --git a/src/content/taInfoData/devilish-bodhisattva.json b/src/content/taInfoData/devilish-bodhisattva.json index 24f46db..e1afde3 100644 --- a/src/content/taInfoData/devilish-bodhisattva.json +++ b/src/content/taInfoData/devilish-bodhisattva.json @@ -1,9 +1,10 @@ { "info": { "title": "Devilish Bodhisattva", - "releaseDate": "2022-06-21", + "releaseDate": "2019-04-23", "shortdescription": "One of the most infamous fights in FGO, Full Power Beast III:R", - "releaseNumber": 1 + "releaseNumber": 1, + "type": "quest" }, "quests": [ { diff --git a/src/content/taInfoData/lostbelt-6/albion.json b/src/content/taInfoData/lostbelt-6/albion.json index bcdb4d0..6b0e8cd 100644 --- a/src/content/taInfoData/lostbelt-6/albion.json +++ b/src/content/taInfoData/lostbelt-6/albion.json @@ -3,7 +3,8 @@ "title": "Albion", "releaseDate": "2023-07-10", "shortdescription": "Albion shows up with a new mechanic, but will it be enough?", - "releaseNumber": 1 + "releaseNumber": 1, + "type": "quest" }, "quests": [ { diff --git a/src/content/taInfoData/lostbelt-6/cernunnos.json b/src/content/taInfoData/lostbelt-6/cernunnos.json index 46bf53d..61113f8 100644 --- a/src/content/taInfoData/lostbelt-6/cernunnos.json +++ b/src/content/taInfoData/lostbelt-6/cernunnos.json @@ -3,7 +3,8 @@ "title": "Cernunnos", "releaseDate": "2023-07-10", "shortdescription": "One of FGOs most notorious boss fights due to up to 100% special defense, strong DoT damage and powerful field effects", - "releaseNumber": 2 + "releaseNumber": 2, + "type": "quest" }, "quests": [ { diff --git a/src/content/taInfoData/lostbelt-6/morgan.json b/src/content/taInfoData/lostbelt-6/morgan.json index 508dafc..8d30d3f 100644 --- a/src/content/taInfoData/lostbelt-6/morgan.json +++ b/src/content/taInfoData/lostbelt-6/morgan.json @@ -3,7 +3,8 @@ "title": "Queen Morgan", "releaseDate": "2023-06-20", "shortdescription": "The fight against the Lostbelt 6 Queen as the conclusion of LB 6 Part 2", - "releaseNumber": 1 + "releaseNumber": 1, + "type": "quest" }, "quests": [ { diff --git a/src/layouts/databaseSection.astro b/src/layouts/databaseSection.astro index 7fc349e..ba82048 100644 --- a/src/layouts/databaseSection.astro +++ b/src/layouts/databaseSection.astro @@ -2,10 +2,11 @@ export interface Props { title: string titlehidden?: boolean + displayLine?: boolean } - -const { title, titlehidden } = Astro.props +const { title, titlehidden, displayLine } = Astro.props const display = titlehidden ? "display: none" : "" +const line = displayLine ? "flex" : "none" ---
@@ -17,7 +18,7 @@ const display = titlehidden ? "display: none" : ""
-