Adapted margin system on all pages

This commit is contained in:
DrMint 2024-06-07 09:22:44 +02:00
parent 979c7fbbf7
commit 84b6823a55
21 changed files with 448 additions and 505 deletions

View File

@ -12,6 +12,7 @@ interface Props {
backgroundImage?: ComponentProps<typeof AppLayoutBackgroundImg>["img"] | undefined;
hideFooterLinks?: boolean;
hideHomeButton?: boolean;
class?: string | undefined;
}
const {
@ -20,6 +21,7 @@ const {
backgroundImage,
hideFooterLinks = false,
hideHomeButton = false,
...otherProps
} = Astro.props;
---
@ -30,7 +32,7 @@ const {
<header>
<Topbar parentPages={parentPages} hideHomeButton={hideHomeButton} />
</header>
<main><slot /></main>
<main {...otherProps.class ? otherProps : {}}><slot /></main>
<Footer withLinks={!hideFooterLinks} />
</Html>

View File

@ -1,4 +1,6 @@
---
import Card from "components/Card.astro";
/*
On larger screens (>= 1280)
@ -17,9 +19,15 @@ aside
default slot
*/
interface Props {
reducedAsideWidth?: boolean;
}
const { reducedAsideWidth = false } = Astro.props;
---
<div id="layout">
<div id="layout" class:list={{ "reduced-width": reducedAsideWidth }}>
<div id="left">
<slot name="header" />
<div class="when-not-large">
@ -32,34 +40,66 @@ default slot
</div>
<slot />
</div>
<div id="right" class="when-large">
<Card class="when-large right">
<slot name="header-aside" />
<slot name="aside" />
</div>
</Card>
</div>
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
#layout {
container-type: inline-size;
@media (min-width: 1280.5px) {
display: grid;
justify-content: space-between;
grid-template-columns: 35rem 35rem;
&.reduced-width {
grid-template-columns: 35rem 27rem;
}
align-items: start;
}
}
.when-large {
display: flex;
flex-direction: column;
gap: 32px;
@media (max-width: 1280.5px) {
display: none !important;
}
}
.when-not-large {
display: flex;
flex-direction: column;
gap: 64px;
@media (min-width: 1280.5px) {
display: none !important;
}
}
#left {
display: flex;
flex-direction: column;
gap: 32px;
@media (max-width: 1280.5px) {
gap: 64px;
}
}
.right {
display: flex;
flex-direction: column;
gap: 48px;
background-color: color-mix(in srgb, var(--color-elevation-0) 65%, transparent) !important;
backdrop-filter: blur(15px);
padding: 2em;
}
</style>

View File

@ -16,82 +16,59 @@ const {
} = Astro.props;
const uniqueId = getRandomId();
const style = `
@media (max-aspect-ratio: ${width}/${height * 0.85}) {
#${uniqueId} {
mask-image: linear-gradient( to bottom, rgba(0 0 0 / 30%) 0%, transparent 100% );
}
}`; // Required to be done like this because we can't insert variables in media queries with Astro.
---
{/* ------------------------------------------- HTML ------------------------------------------- */}
<div inert>
<img
id={uniqueId}
src={url}
srcset={sizesToSrcset(sizes)}
sizes="100vw"
width={width}
height={height}
loading="lazy"
class="when-no-print"
/>
</div>
<img
id={uniqueId}
src={url}
srcset={sizesToSrcset(sizes)}
sizes="100vw"
width={width}
height={height}
loading="lazy"
class="when-no-print"
decoding="async"
alt=""
inert
/>
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style set:html={style} is:inline></style>
<style>
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
opacity: 0.3;
}
}
div {
img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
z-index: -1;
z-index: -9999;
mask-image: linear-gradient(
to right,
rgba(0 0 0 / 15%) 0%,
rgba(0 0 0 / 30%) 600px,
rgba(0 0 0 / 100%) 1200px
);
@media (max-width: 650.5px) {
display: none;
}
}
img {
width: 100%;
height: auto;
max-height: 100%;
object-fit: cover;
object-position: 50% 0;
mask-image: linear-gradient(
to bottom,
rgba(0 0 0 / 30%) 0%,
rgba(0 0 0 / 5%) 100vh,
rgba(0 0 0 / 5%) 80%,
transparent 100%
);
animation: fadeIn 3s forwards;
@media (max-width: 650.5px) {
display: none;
}
mask-image: linear-gradient(to bottom, rgba(0 0 0 / 100%) min(50vh, 50%), transparent),
linear-gradient(to right, rgba(0 0 0 / 10%), rgba(0 0 0 / 20%) 640px, black 1200px);
mask-composite: intersect;
}
</style>

View File

@ -1,37 +0,0 @@
---
import RichText from "components/RichText/RichText.astro";
import type { RichTextContent } from "src/shared/payload/payload-sdk";
interface Props {
description: RichTextContent | string;
lang?: string | undefined;
}
const { description, lang } = Astro.props;
---
{/* ------------------------------------------- HTML ------------------------------------------- */}
<div class="high-contrast-text">
{
typeof description === "string" ? (
<p class="prose" set:html={description} />
) : (
<RichText content={description} context={{ lang }} />
)
}
<slot />
</div>
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
div {
backdrop-filter: blur(5px);
padding: 1.5em;
margin: -1.5em;
margin-block: 0.5em;
border-radius: 3em;
width: fit-content;
}
</style>

View File

@ -23,7 +23,7 @@ const { t, getLocalizedUrl } = await getI18n(Astro.locals.currentLocale);
<nav id="topbar" class="when-no-print">
{
(!hideHomeButton || parentPages.length > 0) && (
<div id="left" class="hide-scrollbar high-contrast-text">
<div id="left" class="hide-scrollbar">
<a href={getLocalizedUrl("/")} class="pressable-label">
<Icon name="material-symbols:home" width={16} height={16} />
<p>{t("home.title")}</p>

View File

@ -37,7 +37,7 @@ const { t } = await getI18n(Astro.locals.currentLocale);
}
</div>
</Tooltip>
<p class="high-contrast-text">
<p>
{
t("global.languageOverride.availableLanguages", {
count: availableLanguages.length,

View File

@ -10,10 +10,10 @@ import Credits from "./Credits.astro";
import DownloadButton from "./DownloadButton.astro";
import AppLayoutTitle from "./AppLayout/components/AppLayoutTitle.astro";
import type { ComponentProps } from "astro/types";
import AppLayoutDescription from "./AppLayout/components/AppLayoutDescription.astro";
import Attributes from "./Attributes.astro";
import { sizesToSrcset } from "src/utils/img";
import { Icon } from "astro-icon/components";
import RichText from "./RichText/RichText.astro";
interface Props {
previousImageHref?: string | undefined;
@ -105,7 +105,7 @@ const hasNavigation = previousImageHref || nextImageHref;
<AppLayoutTitle pretitle={pretitle} title={title} subtitle={subtitle} lang={lang} />
)
}
{description && <AppLayoutDescription description={description} lang={lang} />}
{description && <RichText content={description} context={{ lang }} />}
</div>
{attributes.length > 0 && <Attributes attributes={attributes} />}
{credits.length > 0 && <Credits credits={credits} />}
@ -181,6 +181,12 @@ const hasNavigation = previousImageHref || nextImageHref;
align-items: center;
gap: 2em;
}
& > div {
display: flex;
flex-direction: column;
gap: 32px;
}
}
}

View File

@ -17,7 +17,7 @@ if (values.length === 0) return;
{
values.map(({ name, href, lang }) =>
href ? (
<a class="pressable high-contrast-text" href={href} lang={lang}>
<a class="pressable" href={href} lang={lang}>
{name}
</a>
) : (

View File

@ -0,0 +1,62 @@
---
import { Icon } from "astro-icon/components";
import { getI18n } from "src/i18n/i18n";
const { t } = await getI18n(Astro.locals.currentLocale);
---
{/* ------------------------------------------- HTML ------------------------------------------- */}
<div id="title">
<Icon name="accords" />
<div>
<h1 class="font-serif font-5xl">{t("global.siteName")}</h1>
<p>{t("global.siteSubtitle")}</p>
</div>
</div>
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
#title {
display: flex;
place-items: center;
gap: 1em;
& > svg {
width: calc(var(--font-size-5xl) * 1.2);
margin-top: 0.5em;
}
& > div {
& > p {
margin-top: -0.15em;
font-size: calc(var(--font-size-5xl) * 0.39);
font-weight: 700;
}
}
@media (max-width: 35rem) {
flex-direction: column;
place-items: center;
margin-bottom: 3em;
--container-width: calc((100vw - 48px));
& > svg {
width: calc(var(--container-width) / 3);
height: calc(var(--container-width) / 3);
}
& > div {
& > h1 {
font-size: calc(var(--container-width) / 9);
}
& > p {
margin-top: -0.1em;
font-size: calc(var(--container-width) / 23);
}
}
}
}
</style>

View File

@ -8,7 +8,6 @@ import LanguageOverride from "components/LanguageOverride.astro";
import Credits from "components/Credits.astro";
import { getI18n } from "src/i18n/i18n";
import AsideLayout from "components/AppLayout/AsideLayout.astro";
import AppLayoutDescription from "components/AppLayout/components/AppLayoutDescription.astro";
import Attributes from "components/Attributes.astro";
import type { Attribute } from "src/utils/attributes";
import { payload } from "src/utils/payload";
@ -88,30 +87,24 @@ if (updatedBy) {
</Fragment>
<Fragment slot="meta">
{summary && <AppLayoutDescription description={summary} lang={language} />}
{
attributes.length > 0 && (
<div id="tags">
<Attributes attributes={attributes} />
summary && (
<div id="summary">
<RichText content={summary} context={{ lang: language }} />
</div>
)
}
{attributes.length > 0 && <Attributes attributes={attributes} />}
</Fragment>
<div id="aside" slot="aside">
<Fragment slot="aside">
<div id="credits">
{
translations.length > 1 && (
<LanguageOverride
currentLanguage={language}
currentSourceLanguage={sourceLanguage}
availableLanguages={translations.map(({ language }) => language)}
getPartialUrl={(lang) =>
getLocalizedUrl(`/api/pages/partial?lang=${lang}&slug=${slug}`)
}
/>
)
}
<LanguageOverride
currentLanguage={language}
currentSourceLanguage={sourceLanguage}
availableLanguages={translations.map(({ language }) => language)}
getPartialUrl={(lang) => getLocalizedUrl(`/api/pages/partial?lang=${lang}&slug=${slug}`)}
/>
{credits.length > 0 && <Credits credits={credits} />}
</div>
@ -119,7 +112,7 @@ if (updatedBy) {
{metaAttributes.length > 0 && <Attributes attributes={metaAttributes} />}
{toc.length > 0 && <TableOfContent toc={toc} lang={language} />}
</div>
</Fragment>
<hr />
<div id="text">
@ -134,39 +127,23 @@ if (updatedBy) {
hr {
border: none;
border-top: 3px dotted var(--color-base-500);
margin-block: 3em;
}
#aside {
display: flex;
flex-direction: column;
gap: 4em;
@media (max-width: 35rem) {
gap: 6em;
}
}
#tags {
margin-block: 2em;
@media (max-width: 1280.5px) {
margin-bottom: 4em;
}
@media (max-width: 35rem) {
margin-top: 4em;
margin-bottom: 6em;
}
margin-block: 24px;
width: 100%;
}
#credits {
display: flex;
flex-direction: column;
gap: 1em;
gap: 16px;
@media (max-width: 35rem) {
gap: 2em;
gap: 32px;
}
}
#summary {
@media (max-width: 1280.5px) {
margin-top: -2em;
}
}
@ -182,14 +159,6 @@ if (updatedBy) {
box-shadow: 0 5px 20px -10px var(--color-shadow-0);
}
@media (max-width: 1280.5px) {
margin-top: 2em;
}
@media (min-width: 1280.5px) {
margin-bottom: 2em;
}
&:hover,
&:focus-visible {
scale: 102%;

View File

@ -31,6 +31,10 @@ const { t } = await getI18n(Astro.locals.currentLocale);
flex-direction: column;
gap: 2em;
@media (min-width: 45rem) {
max-width: 35rem;
}
& > #contents {
display: grid;
gap: 1em;

View File

@ -32,12 +32,12 @@ const {
sizes=`
(max-width: 400px) 90vw,
(max-width: 850px) 50vw,
200px`
380px`
width={width}
height={height}
/>
<div class="high-contrast-text">
<div>
<p id="title" class="font-2xl">{title}</p>
<p>{subtitle}</p>
</div>
@ -47,15 +47,12 @@ const {
<style>
a {
position: relative;
width: 100%;
aspect-ratio: 1 / 1;
display: grid;
background-color: var(--color-elevation-0);
place-items: center;
overflow: hidden;
grid-template-areas: "center";
border-radius: 12px;
box-shadow: 0 5px 20px -10px var(--color-shadow-0);
transition: 100ms scale;
@ -65,20 +62,24 @@ const {
}
& > div {
text-align: center;
backdrop-filter: blur(5px);
grid-area: center;
padding: 1em;
border-radius: 1em;
line-height: 1.3;
text-align: center;
background-color: color-mix(in srgb, var(--color-elevation-0) 70%, transparent);
backdrop-filter: blur(8px);
& > p:has(+ p) {
margin-bottom: 0.3em;
}
}
& > img {
position: absolute;
inset: 0;
opacity: 0.5;
width: 100%;
grid-area: center;
height: 100%;
object-fit: cover;
box-shadow: 0 5px 20px -10px var(--color-shadow-0);
border-radius: 12px;
}
}
</style>

View File

@ -1,12 +1,12 @@
---
import AppLayout from "components/AppLayout/AppLayout.astro";
import AppLayoutDescription from "components/AppLayout/components/AppLayoutDescription.astro";
import AppLayoutTitle from "components/AppLayout/components/AppLayoutTitle.astro";
import { getI18n } from "src/i18n/i18n";
import { payload } from "src/utils/payload";
import { formatInlineTitle, formatRichTextToString } from "src/utils/format";
import { fetchOr404 } from "src/utils/responses";
import { sizesToSrcset } from "src/utils/img";
import RichText from "components/RichText/RichText.astro";
const slug = Astro.params.slug!;
const { getLocalizedMatch, getLocalizedUrl, t } = await getI18n(Astro.locals.currentLocale);
@ -28,7 +28,8 @@ const translation = getLocalizedMatch(translations);
description: translation.description && formatRichTextToString(translation.description),
thumbnail,
}}
parentPages={parentPages}>
parentPages={parentPages}
class="app">
<AppLayoutTitle
title={translation.title}
pretitle={translation.pretitle}
@ -38,7 +39,7 @@ const translation = getLocalizedMatch(translations);
{
translation.description && (
<AppLayoutDescription description={translation.description} lang={translation.language} />
<RichText content={translation.description} context={{ lang: translation.language }} />
)
}
@ -67,6 +68,12 @@ const translation = getLocalizedMatch(translations);
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
.app {
display: flex;
flex-direction: column;
gap: 32px;
}
div {
margin-top: 3em;
display: flex;

View File

@ -13,12 +13,12 @@ import SubitemSection from "./_components/SubitemSection.astro";
import ContentsSection from "./_components/ContentsSection/ContentsSection.astro";
import { formatInlineTitle, formatLocale, formatRichTextToString } from "src/utils/format";
import AsideLayout from "components/AppLayout/AsideLayout.astro";
import AppLayoutDescription from "components/AppLayout/components/AppLayoutDescription.astro";
import { convert } from "src/utils/currencies";
import Attributes from "components/Attributes.astro";
import type { Attribute } from "src/utils/attributes";
import { payload } from "src/utils/payload";
import { sizesToSrcset } from "src/utils/img";
import RichText from "components/RichText/RichText.astro";
const slug = Astro.params.slug!;
const { getLocalizedMatch, getLocalizedUrl, t, formatDate, formatPrice } = await getI18n(
@ -148,7 +148,7 @@ if (price) {
}}
parentPages={parentPages}
backgroundImage={backgroundImage ?? thumbnail}>
<AsideLayout>
<AsideLayout reducedAsideWidth>
<Fragment slot="header">
<AppLayoutTitle title={title} pretitle={pretitle} subtitle={subtitle} lang={language} />
</Fragment>
@ -203,19 +203,13 @@ if (price) {
</Fragment>
<Fragment slot="aside">
{
metaAttributes.length > 0 && (
<div id="attributes">
<Attributes attributes={metaAttributes} />
</div>
)
}
<Attributes attributes={metaAttributes} />
</Fragment>
<Fragment slot="meta">
{description && <AppLayoutDescription description={description} lang={language} />}
{description && <RichText content={description} context={{ lang: language }} />}
<div id="tags">
<div id="attributes">
<Attributes attributes={[...attributes, ...additionalAttributes]}>
<AvailabilityInfo urls={urls} price={price !== undefined} releaseDate={releaseDate} />
@ -237,34 +231,17 @@ if (price) {
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
#attributes {
margin-block: 24px;
}
#images {
display: grid;
place-content: start;
place-items: start;
margin-block: 2em;
gap: clamp(1em, 0.5em + 3vw, 2em);
grid-template-columns: 1fr;
@media (max-width: 23rem) {
gap: 2.5em;
}
@media (min-width: 52rem) {
grid-template-columns: auto 10rem;
}
@media (min-width: 1280.5px) {
grid-template-columns: 10rem 1fr;
margin-block: initial;
& > #gallery-scans {
order: -1;
}
}
display: flex;
flex-direction: column;
gap: 24px;
& > #thumbnail {
max-height: 80vh;
max-width: min(35rem, 100%);
box-shadow: 0 5px 20px -10px var(--color-shadow-0);
transition: 100ms scale;
@ -275,58 +252,28 @@ if (price) {
}
& > #gallery-scans {
max-width: 35rem;
width: 100%;
&:not(.with-two) {
@media (max-width: 52rem) {
> .collectibles_id-image_tile {
aspect-ratio: 2 / 1;
}
& > .collectibles_id-image_tile {
aspect-ratio: 2 / 1;
}
}
&.with-two {
display: flex;
flex-direction: column;
gap: 2.5em;
gap: 24px;
@media (max-width: 23rem) {
> .collectibles_id-image_tile {
@media (max-width: 400.5px) {
flex-direction: column;
& > .collectibles_id-image_tile {
aspect-ratio: 2 / 1;
}
}
}
@media (min-width: 23rem) {
gap: clamp(1em, 0.5em + 3vw, 2em);
flex-direction: row;
@media (min-width: 52rem) {
max-width: 15rem;
flex-direction: column;
}
}
@media (max-width: 1280.5px) {
max-width: 35rem;
}
}
}
#tags {
margin-block: 2em;
@media (max-width: 1280.5px) {
margin-bottom: 4em;
}
@media (max-width: 35rem) {
margin-top: 4em;
margin-bottom: 6em;
}
}
#attributes {
@media (min-width: 1280.5px) {
margin-left: 12em;
margin-top: 3em;
}
}
</style>

View File

@ -7,7 +7,7 @@ import { payload } from "src/utils/payload";
import { fetchOr404 } from "src/utils/responses";
import ScanPreview from "./_components/ScanPreview.astro";
import { formatInlineTitle, formatRichTextToString } from "src/utils/format";
import AppLayoutDescription from "components/AppLayout/components/AppLayoutDescription.astro";
import RichText from "components/RichText/RichText.astro";
const slug = Astro.params.slug!;
const { getLocalizedMatch, t } = await getI18n(Astro.locals.currentLocale);
@ -45,7 +45,8 @@ const hasOutsideObi = obi ? Object.keys(obi).some((value) => !value.includes("in
description: translation.description && formatRichTextToString(translation.description),
thumbnail,
}}
parentPages={parentPages}>
parentPages={parentPages}
class="app">
<AppLayoutTitle
title={translation.title}
pretitle={translation.pretitle}
@ -53,15 +54,13 @@ const hasOutsideObi = obi ? Object.keys(obi).some((value) => !value.includes("in
lang={translation.language}
/>
<div id="meta" class:list={{ "with-description": translation.description }}>
{
translation.description && (
<AppLayoutDescription description={translation.description} lang={translation.language} />
)
}
{
translation.description && (
<RichText content={translation.description} context={{ lang: translation.language }} />
)
}
{credits.length > 0 && <Credits credits={credits} />}
</div>
{credits.length > 0 && <Credits credits={credits} />}
{
cover && (
@ -312,12 +311,14 @@ const hasOutsideObi = obi ? Object.keys(obi).some((value) => !value.includes("in
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
#meta:not(.with-description) {
margin-block: 3em;
.app {
display: flex;
flex-direction: column;
gap: 32px;
}
section {
margin-block: 6em;
margin-block: 4em;
& > p {
margin-top: 0.5em;

View File

@ -1,6 +1,5 @@
---
import AppLayout from "components/AppLayout/AppLayout.astro";
import AppLayoutDescription from "components/AppLayout/components/AppLayoutDescription.astro";
import AppLayoutTitle from "components/AppLayout/components/AppLayoutTitle.astro";
---
@ -8,9 +7,10 @@ import AppLayoutTitle from "components/AppLayout/components/AppLayoutTitle.astro
<AppLayout>
<AppLayoutTitle pretitle="Guide to" title="Rich Text Editor" />
<AppLayoutDescription
description="Having troubles using the Rich Text Editor? Looking for tips and advanced techniques? You've come to the right place!"
/>
<p class="prose">
Having troubles using the Rich Text Editor? Looking for tips and advanced techniques? You've
come to the right place!
</p>
<div class="prose">
<h2>Add indentation / spaces between words</h2>

View File

@ -12,8 +12,8 @@ import AudioPreview from "components/Previews/AudioPreview.astro";
import VideoPreview from "components/Previews/VideoPreview.astro";
import AppLayout from "components/AppLayout/AppLayout.astro";
import AppLayoutTitle from "components/AppLayout/components/AppLayoutTitle.astro";
import AppLayoutDescription from "components/AppLayout/components/AppLayoutDescription.astro";
import { payload } from "src/utils/payload";
import RichText from "components/RichText/RichText.astro";
const slug = Astro.params.slug!;
@ -33,9 +33,10 @@ const meta = getLocalizedMatch(folder.translations);
title: meta.name,
description: meta.description && formatRichTextToString(meta.description),
}}
parentPages={folder.parentPages}>
parentPages={folder.parentPages}
class="app">
<AppLayoutTitle title={meta.name} lang={meta.language} />
{meta.description && <AppLayoutDescription description={meta.description} lang={meta.language} />}
{meta.description && <RichText content={meta.description} context={{ lang: meta.language }} />}
<div id="main" class:list={{ complex: folder.sections.type === "multiple" }}>
{
@ -90,16 +91,24 @@ const meta = getLocalizedMatch(folder.translations);
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
.app {
display: flex;
flex-direction: column;
gap: 32px;
}
#main {
margin-top: 4.5em;
display: grid;
margin-top: 64px;
display: flex;
flex-direction: column;
gap: 4em;
&.complex {
gap: 6em;
& > #sections {
display: grid;
display: flex;
flex-direction: column;
gap: 4em;
}
}

View File

@ -1,12 +1,11 @@
---
import { Icon } from "astro-icon/components";
import Button from "components/Button.astro";
import LibraryGrid from "./_components/LibraryGrid.astro";
import LinkCard from "./_components/LinkCard.astro";
import { getI18n } from "src/i18n/i18n";
import { cache } from "src/utils/payload";
import AppLayout from "components/AppLayout/AppLayout.astro";
import AppLayoutDescription from "components/AppLayout/components/AppLayoutDescription.astro";
import HomeTitle from "./_components/HomeTitle.astro";
const { t, getLocalizedUrl } = await getI18n(Astro.locals.currentLocale);
---
@ -17,23 +16,17 @@ const { t, getLocalizedUrl } = await getI18n(Astro.locals.currentLocale);
openGraph={{ title: t("home.title") }}
backgroundImage={cache.config.home.backgroundImage}
hideFooterLinks
hideHomeButton>
<div id="title">
<Icon name="accords" />
<div>
<h1 class="font-serif font-5xl">{t("global.siteName")}</h1>
<p>{t("global.siteSubtitle")}</p>
</div>
</div>
<AppLayoutDescription description={t("home.description")} />
hideHomeButton
class="app">
<HomeTitle />
<p class="prose" set:html={t("home.description")} />
<a href={getLocalizedUrl("/about")} hidden>
<Button title={t("home.aboutUsButton")} icon="material-symbols:left-click" />
</a>
<div id="main">
<section id="library" class="high-contrast-text">
<section id="library">
<h2 class="font-serif font-3xl">{t("home.librarySection.title")}</h2>
<p set:html={t("home.librarySection.description")} />
<a href={getLocalizedUrl("/search")} hidden>
@ -137,96 +130,46 @@ const { t, getLocalizedUrl } = await getI18n(Astro.locals.currentLocale);
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
#title {
.app {
display: flex;
place-items: center;
gap: 1em;
& > svg {
width: calc(var(--font-size-5xl) * 1.2);
margin-top: 0.5em;
}
& > div {
& > p {
margin-top: -0.15em;
font-size: calc(var(--font-size-5xl) * 0.39);
font-weight: 700;
}
}
@media (max-width: 35rem) {
flex-direction: column;
place-items: center;
margin-bottom: 3em;
--container-width: calc((100vw - 48px));
& > svg {
width: calc(var(--container-width) / 3);
height: calc(var(--container-width) / 3);
}
& > div {
& > h1 {
font-size: calc(var(--container-width) / 9);
}
& > p {
margin-top: -0.1em;
font-size: calc(var(--container-width) / 23);
}
}
}
flex-direction: column;
gap: 32px;
}
#main {
margin-top: 96px;
display: grid;
display: flex;
flex-direction: column;
gap: 64px;
margin-top: 64px;
}
& > section {
& > p {
max-width: 35em;
line-height: 1.5;
margin-top: 8px;
margin-bottom: 24px;
}
&#library {
& > .grid {
@media (max-width: 40rem) {
grid-template-columns: 1fr 1fr;
}
@media (max-width: 22rem) {
grid-template-columns: 1fr;
gap: 12px;
}
}
}
section {
& > p {
max-width: 35em;
line-height: 1.5;
margin-top: 12px;
margin-bottom: 24px;
}
&#library {
& > .grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
@media (max-width: 40rem) {
grid-template-columns: 1fr 1fr;
}
& > .flex {
display: flex;
flex-wrap: wrap;
@media (max-width: 35rem) {
display: grid;
@media (max-width: 22rem) {
grid-template-columns: 1fr;
}
}
}
& > .grid,
& > .flex {
gap: clamp(6px, 2vmin, 16px);
& > .grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: clamp(6px, 2vmin, 16px);
@media (max-width: 22rem) {
gap: 12px;
}
@media (max-width: 22rem) {
gap: 12px;
}
}
}

View File

@ -27,26 +27,33 @@ if (year === 856) {
{cache.config.timeline.breaks.includes(year) && <hr id={`hr-${year}`} />}
<h2 class="font-2xl" class:list={{ multiple }} id={year.toString()}>
{formatTimelineDate(date)}
</h2>
<div>
<h2 class="font-2xl" class:list={{ multiple }} id={year.toString()}>
{formatTimelineDate(date)}
</h2>
<div class="year-container" class:list={{ multiple }}>
{events.map((event) => <TimelineEvent event={event} displayDate={eventsHaveDifferentDates} />)}
<div class="year-container" class:list={{ multiple }}>
{events.map((event) => <TimelineEvent event={event} displayDate={eventsHaveDifferentDates} />)}
</div>
</div>
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
div {
margin-bottom: 16px;
}
hr {
border: none;
border-top: 3px dashed var(--color-base-500);
margin-block: 5em;
margin-top: 4em;
margin-bottom: 3em;
scroll-margin-block: 5em;
width: 100%;
}
.year-container {
margin-bottom: 3em;
width: fit-content;
&.multiple {

View File

@ -8,7 +8,6 @@ import Card from "components/Card.astro";
import { getI18n } from "src/i18n/i18n";
import { cache } from "src/utils/payload";
import type { WordingKey } from "src/i18n/wordings-keys";
import AppLayoutDescription from "components/AppLayout/components/AppLayoutDescription.astro";
const events = await payload.getChronologyEvents();
const groupedEvents = groupBy(events, (event) => event.date.year);
@ -17,9 +16,9 @@ const { getLocalizedUrl, t, formatTimelineDate } = await getI18n(Astro.locals.cu
{/* ------------------------------------------- HTML ------------------------------------------- */}
<AppLayout backgroundImage={cache.config.timeline.backgroundImage}>
<AppLayout backgroundImage={cache.config.timeline.backgroundImage} class="app">
<AppLayoutTitle title={t("timeline.title")} />
<AppLayoutDescription description={t("timeline.description")} />
<p class="prose" set:html={t("timeline.description")} />
<div class="card-container">
<Card>
@ -73,6 +72,12 @@ const { getLocalizedUrl, t, formatTimelineDate } = await getI18n(Astro.locals.cu
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
.app {
display: flex;
flex-direction: column;
gap: 32px;
}
.card-content {
padding: clamp(1.5em, 4vw, 2em) clamp(1em, 4vw, 3em);
max-width: 35rem;

View File

@ -1,177 +1,177 @@
{
"disclaimer": "Usage subject to terms: https://openexchangerates.org/terms",
"license": "https://openexchangerates.org/license",
"timestamp": 1717603200,
"timestamp": 1717740000,
"base": "USD",
"rates": {
"AED": 3.6729,
"AFN": 70.575782,
"ALL": 92.419558,
"AMD": 388.17,
"ANG": 1.803102,
"AOA": 852.223,
"ARS": 897.74795,
"AUD": 1.505592,
"AED": 3.673,
"AFN": 70.453638,
"ALL": 91.912021,
"AMD": 387.678915,
"ANG": 1.79986,
"AOA": 854.407667,
"ARS": 898.5413,
"AUD": 1.498617,
"AWG": 1.8,
"AZN": 1.7,
"BAM": 1.800307,
"BAM": 1.795869,
"BBD": 2,
"BDT": 117.501398,
"BGN": 1.800267,
"BHD": 0.376829,
"BIF": 2874.054434,
"BDT": 117.294372,
"BGN": 1.79491,
"BHD": 0.376872,
"BIF": 2869.308172,
"BMD": 1,
"BND": 1.348645,
"BOB": 6.913057,
"BRL": 5.2824,
"BND": 1.345362,
"BOB": 6.901365,
"BRL": 5.258701,
"BSD": 1,
"BTC": 0.000013964521,
"BTN": 83.382155,
"BWP": 13.742348,
"BYN": 3.274175,
"BZD": 2.016661,
"CAD": 1.370535,
"CDF": 2798.801364,
"CHF": 0.894049,
"CLF": 0.032857,
"CLP": 906.43,
"CNH": 7.259305,
"CNY": 7.2476,
"COP": 3923.74,
"CRC": 530.215755,
"BTC": 0.000014026029,
"BTN": 83.367902,
"BWP": 13.755584,
"BYN": 3.268278,
"BZD": 2.013085,
"CAD": 1.366955,
"CDF": 2822.733026,
"CHF": 0.89004,
"CLF": 0.032927,
"CLP": 908.55,
"CNH": 7.255147,
"CNY": 7.2447,
"COP": 3927.880338,
"CRC": 527.874933,
"CUC": 1,
"CUP": 25.75,
"CVE": 101.513983,
"CZK": 22.66718,
"DJF": 178.134558,
"DKK": 6.865334,
"DOP": 59.25346,
"DZD": 134.467238,
"EGP": 47.59617,
"CVE": 101.249236,
"CZK": 22.552099,
"DJF": 177.811501,
"DKK": 6.849959,
"DOP": 59.242392,
"DZD": 134.471532,
"EGP": 47.5129,
"ERN": 15,
"ETB": 57.520327,
"EUR": 0.920423,
"FJD": 2.2549,
"FKP": 0.783116,
"GBP": 0.783116,
"ETB": 57.42215,
"EUR": 0.918217,
"FJD": 2.25895,
"FKP": 0.782189,
"GBP": 0.782189,
"GEL": 2.785,
"GGP": 0.783116,
"GHS": 14.906798,
"GIP": 0.783116,
"GGP": 0.782189,
"GHS": 14.880927,
"GIP": 0.782189,
"GMD": 67.775,
"GNF": 8615.050401,
"GTQ": 7.768215,
"GYD": 209.311753,
"HKD": 7.811219,
"HNL": 24.718097,
"HRK": 6.934061,
"HTG": 132.664459,
"HUF": 359.434937,
"IDR": 16316.416148,
"ILS": 3.71465,
"IMP": 0.783116,
"INR": 83.392852,
"IQD": 1309.617393,
"GNF": 8600.013522,
"GTQ": 7.76001,
"GYD": 209.061081,
"HKD": 7.809645,
"HNL": 24.673005,
"HRK": 6.918151,
"HTG": 132.552876,
"HUF": 358.085123,
"IDR": 16216.760923,
"ILS": 3.720825,
"IMP": 0.782189,
"INR": 83.458757,
"IQD": 1308.290714,
"IRR": 42100,
"ISK": 137.6,
"JEP": 0.783116,
"JMD": 155.665152,
"ISK": 137.46,
"JEP": 0.782189,
"JMD": 155.295453,
"JOD": 0.7088,
"JPY": 156.214,
"KES": 130.56,
"KGS": 87.5483,
"KHR": 4107.289342,
"KMF": 452.624586,
"JPY": 155.5174,
"KES": 130,
"KGS": 87.3013,
"KHR": 4101.618815,
"KMF": 452.450119,
"KPW": 900,
"KRW": 1371.060206,
"KWD": 0.30645,
"KYD": 0.833709,
"KZT": 449.146281,
"LAK": 21527.892501,
"LBP": 89578.918635,
"LKR": 302.438336,
"LRD": 193.874956,
"LSL": 18.880638,
"LYD": 4.833528,
"MAD": 9.926728,
"MDL": 17.678464,
"MGA": 4462.660208,
"MKD": 56.658308,
"KRW": 1367.937913,
"KWD": 0.306384,
"KYD": 0.832281,
"KZT": 446.221602,
"LAK": 21498.895118,
"LBP": 89418.618549,
"LKR": 302.314319,
"LRD": 193.950039,
"LSL": 18.953322,
"LYD": 4.829787,
"MAD": 9.877784,
"MDL": 17.619678,
"MGA": 4467.052458,
"MKD": 56.57657,
"MMK": 2101.212378,
"MNT": 3450,
"MOP": 8.048455,
"MRU": 39.233411,
"MUR": 46.33,
"MVR": 15.41,
"MWK": 1734.674663,
"MXN": 17.527934,
"MYR": 4.698,
"MZN": 63.875003,
"NAD": 18.880593,
"NGN": 1497.53,
"NIO": 36.829072,
"NOK": 10.591985,
"NPR": 133.41189,
"NZD": 1.617194,
"OMR": 0.384955,
"MOP": 8.033479,
"MRU": 39.126423,
"MUR": 46.32,
"MVR": 15.4,
"MWK": 1731.539932,
"MXN": 17.987572,
"MYR": 4.6955,
"MZN": 63.92499,
"NAD": 18.953497,
"NGN": 1485.31,
"NIO": 36.764809,
"NOK": 10.558218,
"NPR": 133.383523,
"NZD": 1.613954,
"OMR": 0.384963,
"PAB": 1,
"PEN": 3.736112,
"PGK": 3.894622,
"PHP": 58.732501,
"PKR": 278.426033,
"PLN": 3.949797,
"PYG": 7539.734899,
"QAR": 3.649678,
"RON": 4.5799,
"RSD": 107.767,
"RUB": 89.050371,
"RWF": 1300.409751,
"SAR": 3.750477,
"SBD": 8.478719,
"SCR": 13.797069,
"PEN": 3.738103,
"PGK": 3.887667,
"PHP": 58.519502,
"PKR": 278.529362,
"PLN": 3.932408,
"PYG": 7514.698541,
"QAR": 3.642917,
"RON": 4.569,
"RSD": 107.495,
"RUB": 89.173363,
"RWF": 1298.427641,
"SAR": 3.750551,
"SBD": 8.482503,
"SCR": 13.845723,
"SDG": 586,
"SEK": 10.4217,
"SGD": 1.3487,
"SHP": 0.783116,
"SEK": 10.38479,
"SGD": 1.34481,
"SHP": 0.782189,
"SLL": 20969.5,
"SOS": 571.730706,
"SRD": 31.8395,
"SOS": 570.753969,
"SRD": 31.7645,
"SSP": 130.26,
"STD": 22281.8,
"STN": 22.552584,
"SVC": 8.753924,
"STN": 22.496155,
"SVC": 8.738769,
"SYP": 2512.53,
"SZL": 18.874211,
"THB": 36.595,
"TJS": 10.700051,
"TMT": 3.5,
"TND": 3.109,
"TOP": 2.355339,
"TRY": 32.314401,
"TTD": 6.769457,
"TWD": 32.335001,
"TZS": 2616.146822,
"UAH": 40.145276,
"UGX": 3811.854072,
"SZL": 18.948934,
"THB": 36.351667,
"TJS": 10.696062,
"TMT": 3.51,
"TND": 3.10175,
"TOP": 2.352606,
"TRY": 32.310647,
"TTD": 6.757172,
"TWD": 32.282,
"TZS": 2615,
"UAH": 40.094667,
"UGX": 3788.628608,
"USD": 1,
"UYU": 38.947242,
"UZS": 12670.888889,
"VES": 36.498131,
"VND": 25422.65528,
"UYU": 38.896466,
"UZS": 12659.755435,
"VES": 36.442787,
"VND": 25422.651993,
"VUV": 118.722,
"WST": 2.8,
"XAF": 603.757729,
"XAG": 0.03345097,
"XAU": 0.00042489,
"XAF": 602.310759,
"XAG": 0.03205488,
"XAU": 0.0004209,
"XCD": 2.70255,
"XDR": 0.756018,
"XOF": 603.757729,
"XPD": 0.0010788,
"XPF": 109.835647,
"XPT": 0.00100458,
"YER": 250.350066,
"ZAR": 18.9541,
"ZMW": 26.287109,
"XDR": 0.75467,
"XOF": 602.310759,
"XPD": 0.00108737,
"XPF": 109.572414,
"XPT": 0.00099467,
"YER": 250.425029,
"ZAR": 18.932716,
"ZMW": 26.240618,
"ZWL": 322
}
}