diff --git a/TODO.md b/TODO.md index 3335f12..6007070 100644 --- a/TODO.md +++ b/TODO.md @@ -2,21 +2,28 @@ ## Short term -- [Medias] Add Parent pages - [Timeline] inline links to pages not working (timeline 2026/06) +- Fix inconsistency with material-icon in Payload (with or without material-icon prefix) +- [Media] display filename alongside the localized title. +- [Media] Have a title, subtitle, pretitle just like everything else +- Background images some times lack gradient at the bottom and fade in before they could load +- Number of audio players seems limited (on Chrome and Firefox) ## Mid term +- [Medias] Add Parent pages +- [Scans] Adapt size of obi based on cover/dustjacket +- [Scans] Order of cover/dustjacket/obi should be based on the book's page order. +- [RichTextContent] Add autolink block support - Save cookies for longer than just the session - [Scripts] Can't run the scripts using node (ts-node?) - Support for nameless section - [Timeline] Error if collectible not published? - [Timeline] Handle no JS for footers - [Timeline] Add details button in footer with credits + last updated / created -- [Collectibles] Create page for gallery -- [Collectibles] Create page for scans - When the tags overflow, the tag group name should be align start (see http://localhost:12499/en/pages/magnitude-negative-chapter-1) - [SDK] create a initPayload() that return a payload sdk (and stop hard wirring to ENV or node-cache) +- [Videos] see why no video on Firefox and no poster on Chrome https://v3.accords-library.com/en/videos/661b672825d380e548dbb8c8 ## Long term diff --git a/prettier.config.js b/prettier.config.cjs similarity index 100% rename from prettier.config.js rename to prettier.config.cjs diff --git a/src/pages/[locale]/collectibles/_components/ContentsSection/InlineTagGroups.astro b/src/components/InlineTagGroups.astro similarity index 100% rename from src/pages/[locale]/collectibles/_components/ContentsSection/InlineTagGroups.astro rename to src/components/InlineTagGroups.astro diff --git a/src/components/Lightbox.astro b/src/components/Lightbox.astro new file mode 100644 index 0000000..d865e46 --- /dev/null +++ b/src/components/Lightbox.astro @@ -0,0 +1,118 @@ +--- +import Button from "components/Button.astro"; +import { + type EndpointCredit, + type EndpointTagsGroup, + type PayloadImage, + type RichTextContent, +} from "src/shared/payload/payload-sdk"; +import RichText from "./RichText/RichText.astro"; +import TagGroups from "./TagGroups.astro"; +import Credits from "./Credits.astro"; +import DownloadButton from "./DownloadButton.astro"; + +interface Props { + previousImageHref?: string | undefined; + nextImageHref?: string | undefined; + image: PayloadImage; + title: string; + description?: RichTextContent | undefined; + tagGroups?: EndpointTagsGroup[] | undefined; + credits?: EndpointCredit[] | undefined; + filename?: string | undefined; +} + +const { + nextImageHref, + previousImageHref, + image: { url, width, height }, + tagGroups, + credits, + description, + title, + filename, +} = Astro.props; +--- + +{/* ------------------------------------------- HTML ------------------------------------------- */} + +
+
+ +
+ +
0) || (credits && credits.length > 0) || description, + }}> +

{title}

+ {description && } +
+ {tagGroups && tagGroups.length > 0 && } + {credits && credits.length > 0 && } +
+ {filename && } +
+
+ +{/* ------------------------------------------- CSS -------------------------------------------- */} + + diff --git a/src/components/Previews/GenericPreview.astro b/src/components/Previews/GenericPreview.astro index bd9e653..77d3d7d 100644 --- a/src/components/Previews/GenericPreview.astro +++ b/src/components/Previews/GenericPreview.astro @@ -1,10 +1,10 @@ --- import type { PayloadImage } from "src/shared/payload/payload-sdk"; -import InlineTagGroups from "pages/[locale]/collectibles/_components/ContentsSection/InlineTagGroups.astro"; import Card from "components/Card.astro"; import { Icon } from "astro-icon/components"; import type { ComponentProps } from "astro/types"; import { getI18n } from "src/i18n/i18n"; +import InlineTagGroups from "components/InlineTagGroups.astro"; interface Props { thumbnail?: PayloadImage | undefined; diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index 1356e6f..faf267d 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -173,6 +173,50 @@ export const getI18n = async (locale: string) => { ); }; + const formatScanIndexShort = (index: string) => { + switch (index) { + case "cover-flap-front": + case "dustjacket-flap-front": + case "dustjacket-inside-flap-front": + case "obi-flap-front": + case "obi-inside-flap-front": + return t("collectibles.scans.shortIndex.flapFront"); + + case "cover-front": + case "cover-inside-front": + case "dustjacket-front": + case "dustjacket-inside-front": + case "obi-front": + case "obi-inside-front": + return t("collectibles.scans.shortIndex.front"); + + case "cover-spine": + case "dustjacket-spine": + case "dustjacket-inside-spine": + case "obi-spine": + case "obi-inside-spine": + return t("collectibles.scans.shortIndex.spine"); + + case "cover-back": + case "cover-inside-back": + case "dustjacket-back": + case "dustjacket-inside-back": + case "obi-back": + case "obi-inside-back": + return t("collectibles.scans.shortIndex.back"); + + case "cover-flap-back": + case "dustjacket-flap-back": + case "dustjacket-inside-flap-back": + case "obi-flap-back": + case "obi-inside-flap-back": + return t("collectibles.scans.shortIndex.flapBack"); + + default: + return index; + } + }; + const formatEndpointSource = (source: EndpointSource) => { switch (source.type) { case "url": @@ -228,6 +272,20 @@ export const getI18n = async (locale: string) => { label: getLocalizedMatch(source.folder.translations).name, }; + case "scans": + return { + href: getLocalizedUrl(`/collectibles/${source.collectible.slug}/scans`), + typeLabel: t("global.sources.typeLabel.scans"), + label: formatInlineTitle(getLocalizedMatch(source.collectible.translations)), + }; + + case "gallery": + return { + href: getLocalizedUrl(`/collectibles/${source.collectible.slug}/gallery`), + typeLabel: t("global.sources.typeLabel.gallery"), + label: formatInlineTitle(getLocalizedMatch(source.collectible.translations)), + }; + default: return { href: "/404", @@ -250,5 +308,6 @@ export const getI18n = async (locale: string) => { formatNumber, formatTimelineDate, formatEndpointSource, + formatScanIndexShort, }; }; diff --git a/src/i18n/wordings-keys.ts b/src/i18n/wordings-keys.ts index 6db773e..0622e97 100644 --- a/src/i18n/wordings-keys.ts +++ b/src/i18n/wordings-keys.ts @@ -89,29 +89,29 @@ export type WordingKey = | "pages.tableOfContent.break" | "global.languageOverride.availableLanguages" | "timeline.title" - | "timeline.description" - | "timeline.eras.cataclysm" + | "timeline.eras.drakengard3" | "timeline.eras.drakengard" | "timeline.eras.drakengard2" - | "timeline.eras.drakengard3" | "timeline.eras.nier" | "timeline.eras.nierAutomata" - | "timeline.jumpTo" - | "timeline.notes.content" + | "timeline.eras.cataclysm" + | "timeline.description" | "timeline.notes.title" + | "timeline.notes.content" | "timeline.priorCataclysmNote.title" | "timeline.priorCataclysmNote.content" + | "timeline.jumpTo" | "timeline.year.during" - | "timeline.eventFooter.sources" | "timeline.eventFooter.languages" + | "timeline.eventFooter.sources" | "timeline.eventFooter.note" + | "global.sources.typeLabel.url" + | "global.sources.typeLabel.page" | "global.sources.typeLabel.collectible" - | "global.sources.typeLabel.collectible.range.custom" + | "global.sources.typeLabel.folder" | "global.sources.typeLabel.collectible.range.page" | "global.sources.typeLabel.collectible.range.timestamp" - | "global.sources.typeLabel.folder" - | "global.sources.typeLabel.page" - | "global.sources.typeLabel.url" + | "global.sources.typeLabel.collectible.range.custom" | "global.openMediaPage" | "global.downloadButton" | "global.previewTypes.video" @@ -119,4 +119,24 @@ export type WordingKey = | "global.previewTypes.image" | "global.previewTypes.audio" | "global.previewTypes.collectible" - | "global.previewTypes.unknown"; + | "global.previewTypes.unknown" + | "collectibles.scans.title" + | "collectibles.scans.subtitle" + | "collectibles.scans.shortIndex.flapFront" + | "collectibles.scans.shortIndex.front" + | "collectibles.scans.shortIndex.spine" + | "collectibles.scans.shortIndex.back" + | "collectibles.scans.shortIndex.flapBack" + | "collectibles.scans.cover" + | "collectibles.scans.coverInside" + | "collectibles.scans.dustjacket" + | "collectibles.scans.dustjacketInside" + | "collectibles.scans.obi" + | "collectibles.scans.obiInside" + | "collectibles.scans.pages" + | "collectibles.gallery.title" + | "collectibles.gallery.subtitle" + | "global.sources.typeLabel.scans" + | "collectibles.scans.dustjacket.description" + | "collectibles.scans.obi.description" + | "global.sources.typeLabel.gallery"; diff --git a/src/pages/[locale]/collectibles/_components/AvailabilityInfo.astro b/src/pages/[locale]/collectibles/[slug]/_components/AvailabilityInfo.astro similarity index 100% rename from src/pages/[locale]/collectibles/_components/AvailabilityInfo.astro rename to src/pages/[locale]/collectibles/[slug]/_components/AvailabilityInfo.astro diff --git a/src/pages/[locale]/collectibles/_components/ContentsSection/ContentRow.astro b/src/pages/[locale]/collectibles/[slug]/_components/ContentsSection/ContentRow.astro similarity index 98% rename from src/pages/[locale]/collectibles/_components/ContentsSection/ContentRow.astro rename to src/pages/[locale]/collectibles/[slug]/_components/ContentsSection/ContentRow.astro index 4abd5b0..beb17a7 100644 --- a/src/pages/[locale]/collectibles/_components/ContentsSection/ContentRow.astro +++ b/src/pages/[locale]/collectibles/[slug]/_components/ContentsSection/ContentRow.astro @@ -4,7 +4,7 @@ import RichText from "components/RichText/RichText.astro"; import { getI18n } from "src/i18n/i18n"; import { Collections, type EndpointCollectible } from "src/shared/payload/payload-sdk"; import { formatInlineTitle } from "src/utils/format"; -import InlineTagGroups from "./InlineTagGroups.astro"; +import InlineTagGroups from "../../../../../../components/InlineTagGroups.astro"; import Card from "components/Card.astro"; import AudioPlayer from "components/AudioPlayer.astro"; import VideoPlayer from "components/VideoPlayer.astro"; diff --git a/src/pages/[locale]/collectibles/_components/ContentsSection/ContentsSection.astro b/src/pages/[locale]/collectibles/[slug]/_components/ContentsSection/ContentsSection.astro similarity index 100% rename from src/pages/[locale]/collectibles/_components/ContentsSection/ContentsSection.astro rename to src/pages/[locale]/collectibles/[slug]/_components/ContentsSection/ContentsSection.astro diff --git a/src/pages/[locale]/collectibles/_components/ImageTile.astro b/src/pages/[locale]/collectibles/[slug]/_components/ImageTile.astro similarity index 86% rename from src/pages/[locale]/collectibles/_components/ImageTile.astro rename to src/pages/[locale]/collectibles/[slug]/_components/ImageTile.astro index ff1c7c0..152947e 100644 --- a/src/pages/[locale]/collectibles/_components/ImageTile.astro +++ b/src/pages/[locale]/collectibles/[slug]/_components/ImageTile.astro @@ -3,26 +3,27 @@ interface Props { image: string; title: string; subtitle: string; + href: string; } -const { image, title, subtitle } = Astro.props; +const { image, title, subtitle, href } = Astro.props; --- {/* ------------------------------------------- HTML ------------------------------------------- */} -
+

{title}

{subtitle}

-
+ {/* ------------------------------------------- CSS -------------------------------------------- */} diff --git a/src/pages/[locale]/collectibles/[slug].astro b/src/pages/[locale]/collectibles/[slug]/index.astro similarity index 84% rename from src/pages/[locale]/collectibles/[slug].astro rename to src/pages/[locale]/collectibles/[slug]/index.astro index 4dd3c7d..f10c81b 100644 --- a/src/pages/[locale]/collectibles/[slug].astro +++ b/src/pages/[locale]/collectibles/[slug]/index.astro @@ -44,9 +44,6 @@ const { } = collectible; const translation = getLocalizedMatch(translations); - -const galleryFirstImage = gallery[0]; -const scansFirstImage = scans[0]; --- {/* ------------------------------------------- HTML ------------------------------------------- */} @@ -82,21 +79,23 @@ const scansFirstImage = scans[0];