diff --git a/TODO.md b/TODO.md index 7d4ae63..fe7c828 100644 --- a/TODO.md +++ b/TODO.md @@ -23,6 +23,7 @@ ## Long term +- More data caching between the CMS and Astro - [Folders] Support for nameless section - [Scripts] Can't run the scripts using node (ts-node?) - [Scans] Adapt size of obi based on cover/dustjacket diff --git a/src/components/AppLayout/components/AppLayoutBackgroundImg.astro b/src/components/AppLayout/components/AppLayoutBackgroundImg.astro index edfc690..40208ab 100644 --- a/src/components/AppLayout/components/AppLayoutBackgroundImg.astro +++ b/src/components/AppLayout/components/AppLayoutBackgroundImg.astro @@ -35,6 +35,7 @@ const style = ` sizes="100vw" width={width} height={height} + loading="lazy" class="when-no-print when-js" /> diff --git a/src/components/Lightbox.astro b/src/components/Lightbox.astro index a59df5c..9a03feb 100644 --- a/src/components/Lightbox.astro +++ b/src/components/Lightbox.astro @@ -64,7 +64,7 @@ const hasNavigation = previousImageHref || nextImageHref; ) } - + a { + &:focus-visible { + outline: 3px solid var(--color-base-1000); + outline-offset: unset; + } + + &.pressable { + border-radius: 9999px; + padding-left: 1em; + padding-right: 1em; + height: 2.5em; + + display: flex; + place-items: center; + place-content: center; + + & > svg { + width: 1.5em; + height: 1.5em; + } + } + } + + & > #image-anchor { + display: block; + transition: 100ms scale; + box-shadow: 0 5px 20px -10px var(--color-shadow); + + &:hover, + &:focus-visible { + scale: 102%; + } + max-height: 70vh; - max-width: 100%; - height: auto; - width: auto; + + & > img { + max-width: 100%; + height: auto; + } } } diff --git a/src/components/Previews/GenericPreview.astro b/src/components/Previews/GenericPreview.astro index f8b9318..800b17c 100644 --- a/src/components/Previews/GenericPreview.astro +++ b/src/components/Previews/GenericPreview.astro @@ -52,6 +52,7 @@ const { sizes={sizesForGridLayout(250, 1.15)} width={thumbnail.width} height={thumbnail.height} + loading="lazy" /> ) } diff --git a/src/components/RichText/components/RTParagraph.astro b/src/components/RichText/components/RTParagraph.astro index e969d2b..a879df2 100644 --- a/src/components/RichText/components/RTParagraph.astro +++ b/src/components/RichText/components/RTParagraph.astro @@ -15,7 +15,7 @@ const { node, context } = Astro.props; { node.children.length > 0 && ( -

+

{node.children.map((node) => ( ))} diff --git a/src/components/RichText/components/RTUpload/components/RTImage.astro b/src/components/RichText/components/RTUpload/components/RTImage.astro index 12e32c8..3c0c9c9 100644 --- a/src/components/RichText/components/RTUpload/components/RTImage.astro +++ b/src/components/RichText/components/RTUpload/components/RTImage.astro @@ -37,7 +37,7 @@ const mediaPage = getLocalizedUrl(`/images/${id}`); ) } - + + div { + margin-block: 4em; + } + a { display: block; line-height: 0; - box-shadow: 0 5px 20px -10px var(--color-shadow); - border-radius: 16px; - overflow: hidden; - width: fit-content; margin-bottom: 0.5em; transition-property: scale, margin-bottom; @@ -75,12 +75,15 @@ const mediaPage = getLocalizedUrl(`/images/${id}`); outline: 3px solid var(--color-base-1000); outline-offset: unset; } - } - img { max-height: 70vh; - max-width: 100%; - width: auto; - height: auto; + + & > img { + box-shadow: 0 5px 20px -10px var(--color-shadow); + border-radius: 16px; + + max-width: 100%; + height: auto; + } } diff --git a/src/i18n/wordings-keys.ts b/src/i18n/wordings-keys.ts index 738a100..4a21962 100644 --- a/src/i18n/wordings-keys.ts +++ b/src/i18n/wordings-keys.ts @@ -69,8 +69,6 @@ export type WordingKey = | "collectibles.bookFormat.binding.hardcover" | "collectibles.bookFormat.binding.readingDirection.leftToRight" | "collectibles.bookFormat.binding.readingDirection.rightToLeft" - | "collectibles.gallery" - | "collectibles.scans" | "collectibles.imageCount" | "header.topbar.settings.tooltip" | "collectibles.contents" @@ -89,29 +87,29 @@ export type WordingKey = | "pages.tableOfContent.break" | "global.languageOverride.availableLanguages" | "timeline.title" - | "timeline.eras.drakengard3" + | "timeline.description" + | "timeline.eras.cataclysm" | "timeline.eras.drakengard" | "timeline.eras.drakengard2" + | "timeline.eras.drakengard3" | "timeline.eras.nier" | "timeline.eras.nierAutomata" - | "timeline.eras.cataclysm" - | "timeline.description" - | "timeline.notes.title" + | "timeline.jumpTo" | "timeline.notes.content" + | "timeline.notes.title" | "timeline.priorCataclysmNote.title" | "timeline.priorCataclysmNote.content" - | "timeline.jumpTo" | "timeline.year.during" - | "timeline.eventFooter.languages" | "timeline.eventFooter.sources" + | "timeline.eventFooter.languages" | "timeline.eventFooter.note" - | "global.sources.typeLabel.url" - | "global.sources.typeLabel.page" | "global.sources.typeLabel.collectible" - | "global.sources.typeLabel.folder" + | "global.sources.typeLabel.collectible.range.custom" | "global.sources.typeLabel.collectible.range.page" | "global.sources.typeLabel.collectible.range.timestamp" - | "global.sources.typeLabel.collectible.range.custom" + | "global.sources.typeLabel.folder" + | "global.sources.typeLabel.page" + | "global.sources.typeLabel.url" | "global.openMediaPage" | "global.downloadButton" | "global.previewTypes.video" @@ -121,6 +119,8 @@ export type WordingKey = | "global.previewTypes.collectible" | "global.previewTypes.unknown" | "collectibles.scans.title" + | "collectibles.gallery.title" + | "collectibles.gallery.subtitle" | "collectibles.scans.subtitle" | "collectibles.scans.shortIndex.flapFront" | "collectibles.scans.shortIndex.front" @@ -134,11 +134,9 @@ export type WordingKey = | "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.scans" | "global.sources.typeLabel.gallery" | "global.media.attributes.filename" | "global.media.attributes.duration" diff --git a/src/pages/[locale]/_components/CategoryCard.astro b/src/pages/[locale]/_components/CategoryCard.astro index f98fc9f..c12856f 100644 --- a/src/pages/[locale]/_components/CategoryCard.astro +++ b/src/pages/[locale]/_components/CategoryCard.astro @@ -26,6 +26,7 @@ const { img, name, href } = Astro.props; class="when-light-theme" alt={name} title={name} + loading="lazy" /> {name} ) : ( diff --git a/src/pages/[locale]/api/pages/partial.astro b/src/pages/[locale]/api/pages/partial.astro index 62d483f..d6d5b4f 100644 --- a/src/pages/[locale]/api/pages/partial.astro +++ b/src/pages/[locale]/api/pages/partial.astro @@ -68,7 +68,10 @@ if (updatedBy) { { thumbnail && ( - + img { - max-width: min(35rem, 100%); - max-height: 80vh; - width: auto; + max-width: 100%; height: auto; + + border-radius: 16px; + box-shadow: 0 5px 20px -10px var(--color-shadow); } @media (max-width: 1280.5px) { diff --git a/src/pages/[locale]/collectibles/[slug]/gallery/index.astro b/src/pages/[locale]/collectibles/[slug]/gallery/index.astro index a3866e0..0f20c7d 100644 --- a/src/pages/[locale]/collectibles/[slug]/gallery/index.astro +++ b/src/pages/[locale]/collectibles/[slug]/gallery/index.astro @@ -40,7 +40,9 @@ const translation = getLocalizedMatch(translations);

{ images.map(({ url, width, height, sizes }, index) => ( - + )) @@ -71,18 +74,25 @@ const translation = getLocalizedMatch(translations); gap: 1em; text-align: center; place-items: center; + border-radius: 16px; transition: 100ms scale; - &:hover { + &:hover, + &:focus-visible { scale: 104%; } + &:focus-visible { + outline: 3px solid var(--color-base-1000); + outline-offset: unset; + } + + max-height: 320px; + & > img { - max-height: 320px; max-width: 100%; height: auto; - width: auto; box-shadow: 0 5px 20px -10px var(--color-shadow); border-radius: 16px; } diff --git a/src/pages/[locale]/collectibles/[slug]/index.astro b/src/pages/[locale]/collectibles/[slug]/index.astro index 1bcd8dd..8bc87fb 100644 --- a/src/pages/[locale]/collectibles/[slug]/index.astro +++ b/src/pages/[locale]/collectibles/[slug]/index.astro @@ -155,9 +155,11 @@ if (price) {
{ thumbnail && ( - + #thumbnail { transition: 100ms scale; &:hover, @@ -268,12 +269,13 @@ if (price) { outline-offset: unset; } - & > #thumbnail { - max-width: min(35rem, 100%); - max-height: 80vh; - width: auto; - height: auto; + max-height: 80vh; + max-width: min(35rem, 100%); + + & > img { box-shadow: 0 5px 20px -10px var(--color-shadow); + max-width: 100%; + height: auto; } } diff --git a/src/pages/[locale]/collectibles/[slug]/scans/_components/ScanPreview.astro b/src/pages/[locale]/collectibles/[slug]/scans/_components/ScanPreview.astro index f11c2ec..3992ca1 100644 --- a/src/pages/[locale]/collectibles/[slug]/scans/_components/ScanPreview.astro +++ b/src/pages/[locale]/collectibles/[slug]/scans/_components/ScanPreview.astro @@ -1,15 +1,17 @@ --- import { getI18n } from "src/i18n/i18n"; import type { EndpointScanImage } from "src/shared/payload/payload-sdk"; -import { sizesToSrcset } from "src/utils/img"; +import { sizesForGridLayout, sizesToSrcset } from "src/utils/img"; interface Props { scan: EndpointScanImage; collectibleSlug: string; + aspectRatio?: { width: number; height: number } | undefined; } const { scan: { url, index, width, height, sizes }, + aspectRatio, collectibleSlug, } = Astro.props; @@ -18,41 +20,51 @@ const { getLocalizedUrl, formatScanIndexShort } = await getI18n(Astro.locals.cur {/* ------------------------------------------- HTML ------------------------------------------- */} - - +
+ + +

{formatScanIndexShort(index)}

- +
{/* ------------------------------------------- CSS -------------------------------------------- */} diff --git a/src/pages/[locale]/recorders/[id].astro b/src/pages/[locale]/recorders/[id].astro index 6faa9db..a07eee4 100644 --- a/src/pages/[locale]/recorders/[id].astro +++ b/src/pages/[locale]/recorders/[id].astro @@ -17,7 +17,7 @@ if (recorder instanceof Response) { return recorder; } -const { t, getLocalizedMatch } = await getI18n(Astro.locals.currentLocale); +const { t, getLocalizedMatch, getLocalizedUrl } = await getI18n(Astro.locals.currentLocale); const { username, languages, avatar, translations } = recorder; @@ -47,13 +47,17 @@ if (languages.length > 0) { { avatar && ( - + + + ) } @@ -80,16 +84,34 @@ if (languages.length > 0) { {/* ------------------------------------------- CSS -------------------------------------------- */}