progmaweb
The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.
Clonegit clone https://git.progmasoft.com/progmaweb
Soften the corners, move the product colours, and bring the catalog into the home line
- Commit
da64bce06343f530d16fc0c3afbdbff474c90dfb- Author
- Leitwolf11 ·
- Parents
011e97dbdad0
Changes
apps/web/app/globals.css | 56 ++++- apps/web/app/news/[slug]/page.tsx | 2 +- apps/web/app/news/page.tsx | 12 +- apps/web/app/page.tsx | 18 +- apps/web/app/products/[slug]/page.tsx | 7 +- apps/web/app/products/catalog.css | 346 +++++++++++++++++---------- apps/web/app/products/categories/page.tsx | 1 + apps/web/app/products/languages/page.tsx | 1 + apps/web/app/products/page.tsx | 14 +- apps/web/app/site.css | 19 +- apps/web/components/ProductCatalog.tsx | 136 ++++++----- apps/web/components/site/FeatureCarousel.tsx | 2 +- apps/web/lib/brand-colours.ts | 16 ++ 13 files changed, 395 insertions(+), 235 deletions(-) diff --git a/apps/web/app/globals.css b/apps/web/app/globals.css index 632b7bd..91ce6ed 100644 --- a/apps/web/app/globals.css +++ b/apps/web/app/globals.css @@ -23,9 +23,9 @@ --danger: rgb(180 35 24); --shadow-sm: 0 2px 8px rgb(20 20 19 / 6%); --shadow-md: 0 16px 44px rgb(20 20 19 / 10%); - --radius-sm: 8px; - --radius-md: 12px; - --radius-lg: 16px; + --radius-sm: 12px; + --radius-md: 16px; + --radius-lg: 22px; --shell: 1180px; color-scheme: light; } @@ -1078,7 +1078,7 @@ a { right: 5px; height: 36px; border: 0; - border-radius: 3px; + border-radius: 999px; padding-inline: 10px; background: transparent; color: var(--blue-700); @@ -1570,7 +1570,7 @@ h1 { .button { border-color: var(--ink-950); - border-radius: 8px; + border-radius: 999px; background: var(--ink-950); color: var(--surface); font-weight: 500; @@ -1598,7 +1598,7 @@ h1 { input, select, textarea { - border-radius: 8px; + border-radius: 12px; } .site-header { @@ -1627,7 +1627,7 @@ textarea { .site-header .button-small { min-height: 38px; border: 0; - border-radius: 8px; + border-radius: 999px; padding-inline: 16px; background: var(--ink-950); color: var(--surface); @@ -1643,7 +1643,7 @@ textarea { .preference-controls button, .preference-controls select { border-color: var(--line); - border-radius: 8px; + border-radius: 999px; background: transparent; color: var(--ink-950); font-weight: 500; @@ -1701,3 +1701,43 @@ textarea { border-top-color: rgb(240 238 230 / 12%); color: rgb(138 136 128); } + +/* A product's colour that moves: its four field colours drift slowly, like the fields of the home page. The colours + come from accentStyle() (lib/brand-colours.ts) as --field-1 to --field-4. */ +.pm-live-accent { + background: linear-gradient( + 115deg, + var(--field-1), + var(--field-2) 28%, + var(--field-3) 52%, + var(--field-2) 74%, + var(--field-1) + ); + background-size: 300% 300%; + animation: pm-accent-flow 9s ease-in-out infinite alternate; +} + +@keyframes pm-accent-flow { + from { + background-position: 0% 40%; + } + to { + background-position: 100% 60%; + } +} + +@keyframes pm-accent-rise { + from { + background-position: 50% 0%; + } + to { + background-position: 50% 100%; + } +} + +@media (prefers-reduced-motion: reduce) { + .pm-live-accent, + .pm-scatter-item::before { + animation: none; + } +} diff --git a/apps/web/app/news/[slug]/page.tsx b/apps/web/app/news/[slug]/page.tsx index c40416d..bdb1865 100644 --- a/apps/web/app/news/[slug]/page.tsx +++ b/apps/web/app/news/[slug]/page.tsx @@ -105,7 +105,7 @@ export default async function ArticlePage({ params }: ArticlePageProps) { <Flow colours={accentField(product.accent)} seed={7.1} - speed={0.5} + speed={1.6} className="pm-article-field" /> </div> diff --git a/apps/web/app/news/page.tsx b/apps/web/app/news/page.tsx index 331a604..9c297af 100644 --- a/apps/web/app/news/page.tsx +++ b/apps/web/app/news/page.tsx @@ -7,7 +7,7 @@ import { formatDay } from "@/components/ProductCatalog"; import { SiteHeader } from "@/components/SiteHeader"; import { Flow } from "@/components/site/Flow"; import { Reveal } from "@/components/site/Reveal"; -import { accentColour, accentField } from "@/lib/brand-colours"; +import { accentField, accentStyle } from "@/lib/brand-colours"; import { getLocale } from "@/lib/locale.server"; import { articles, articleUrl, getNewsMessages, articleText } from "@/lib/news"; import { productFacts } from "@/lib/products"; @@ -45,7 +45,7 @@ export default async function NewsPage() { <Flow colours={accentField(productFacts(first.product).accent)} seed={4.2} - speed={0.6} + speed={1.8} className="pm-news-lead-field" /> <span className="pm-news-lead-copy"> @@ -72,12 +72,8 @@ export default async function NewsPage() { <a href={articleUrl(article)}> <span className="pm-news-meta"> <span - className="pm-chip" - style={{ - background: accentColour( - productFacts(article.product).accent, - ), - }} + className="pm-chip pm-live-accent" + style={accentStyle(productFacts(article.product).accent)} aria-hidden="true" /> <span>{productFacts(article.product).name}</span> diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index 2e913dc..88d45ff 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -13,7 +13,7 @@ import { } from "@/components/site/FeatureCarousel"; import { Flow, type FlowColours } from "@/components/site/Flow"; import { Reveal } from "@/components/site/Reveal"; -import { accentColour, accentField } from "@/lib/brand-colours"; +import { accentField, accentStyle } from "@/lib/brand-colours"; import { getHomeMessages, productLine } from "@/lib/home-messages"; import { getLocale } from "@/lib/locale.server"; import { getMessages } from "@/lib/localization"; @@ -146,12 +146,8 @@ export default async function Homepage() { > <p className="pm-news-meta"> <span - className="pm-chip" - style={{ - background: accentColour( - productFacts(article.product).accent, - ), - }} + className="pm-chip pm-live-accent" + style={accentStyle(productFacts(article.product).accent)} aria-hidden="true" /> <span>{home.news.category}</span> @@ -206,11 +202,7 @@ export default async function Homepage() { key={slug} className={`pm-scatter-item pm-scatter-${placements[index % placements.length]}`} data-reveal - style={ - { - "--colour": accentColour(productFacts(slug).accent), - } as CSSProperties - } + style={accentStyle(productFacts(slug).accent)} > <h3 className="pm-scatter-name pm-serif"> {productFacts(slug).name} @@ -239,7 +231,7 @@ export default async function Homepage() { accentField("slate") } seed={index * 3.7 + 1} - speed={0.35} + speed={0.9} className="pm-learn-art" /> <h3>{title}</h3> diff --git a/apps/web/app/products/[slug]/page.tsx b/apps/web/app/products/[slug]/page.tsx index 5cc1558..5e07604 100644 --- a/apps/web/app/products/[slug]/page.tsx +++ b/apps/web/app/products/[slug]/page.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import type { Metadata } from "next"; +import { accentStyle } from "@/lib/brand-colours"; import Link from "next/link"; import { notFound } from "next/navigation"; import { @@ -76,7 +77,11 @@ export default async function ProductPage({ params }: ProductPageProps) { </ul> </div> <aside className="pm-aside"> - <span className={`pm-accent pm-accent-${product.accent}`} /> + <span + className="pm-accent pm-live-accent" + style={accentStyle(product.accent)} + aria-hidden="true" + /> <dl className="pm-facts"> <div> <dt>{catalog.facts.status}</dt> diff --git a/apps/web/app/products/catalog.css b/apps/web/app/products/catalog.css index 28a1517..9753d59 100644 --- a/apps/web/app/products/catalog.css +++ b/apps/web/app/products/catalog.css @@ -3,34 +3,62 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -/* The catalog of product.progmasoft.com: views, numbers, search, tables */ +/* The catalog of product.progmasoft.com, in the line of the home page: a quiet serif hero on paper, soft counters, + a rounded search, and the projects as cards that carry each product's moving colour. */ +.pm-catalog .pm-hero { + border-bottom: 0; + background: transparent; +} + +.pm-catalog .pm-product-hero { + padding-block: clamp(56px, 8vw, 96px) 24px; +} + +.pm-catalog .pm-hero h1 { + font-size: clamp(44px, 6.4vw, 84px); + font-weight: 400; + letter-spacing: -0.025em; + line-height: 1; +} + +.pm-catalog .pm-section + .pm-section { + border-top: 0; +} + +/* The views: one rounded control, the current view filled. */ .pm-views { - display: flex; + display: inline-flex; flex-wrap: wrap; - gap: 8px; - margin-block-start: 28px; + gap: 4px; + margin-block-start: 32px; + border: 1px solid var(--line); + border-radius: 999px; + padding: 4px; + background: var(--surface); } .pm-views a { - border: 1px solid var(--line); - border-radius: var(--radius-sm); - padding: 6px 14px; - background: var(--surface); - color: var(--ink-800); - font-size: 14px; + border-radius: 999px; + padding: 8px 18px; + color: var(--ink-650); + font-size: 15px; font-weight: 600; text-decoration: none; + transition: + background 160ms ease, + color 160ms ease; } .pm-views a:hover { - border-color: var(--line-strong); + color: var(--ink-950); + background: var(--surface-muted); } -.pm-views [aria-current="page"] { - border-color: var(--blue-600); - background: var(--blue-100); - color: var(--blue-700); +.pm-views [aria-current="page"], +.pm-views [aria-current="page"]:hover { + background: var(--ink-950); + color: var(--surface); } .pm-index { @@ -38,47 +66,50 @@ gap: 32px; } -/* The hero already sets the page apart; the index starts close below it. */ .pm-section:has(> .pm-index) { - padding-block-start: 48px; + padding-block-start: 24px; } +/* The numbers: one line of soft counters. */ .pm-stats { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); - gap: 14px; + display: flex; + flex-wrap: wrap; + gap: 10px; margin: 0; } .pm-stats div { - border: 1px solid var(--line); - border-radius: 16px; - padding: 18px 20px; - background: var(--surface); -} - -.pm-stats dt { - color: var(--ink-650); - font-size: 14px; - font-weight: 600; + display: inline-flex; + align-items: baseline; + gap: 8px; + border-radius: 999px; + padding: 8px 16px; + background: var(--surface-muted); } .pm-stats dd { - margin: 4px 0 0; + margin: 0; color: var(--ink-950); - font-size: 32px; - font-weight: 750; + font-size: 20px; + font-weight: 700; +} + +.pm-stats dt { + color: var(--ink-650); + font-size: 15px; + font-weight: 500; } +/* The search: rounded fields in a rounded panel. */ .pm-filter { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; border: 1px solid var(--line); - border-radius: 18px; - padding: 18px; - background: var(--surface-muted); + border-radius: 24px; + padding: 18px 20px; + background: var(--surface); } .pm-filter label { @@ -92,10 +123,10 @@ .pm-filter input, .pm-filter select { inline-size: 100%; - min-block-size: 40px; + min-block-size: 44px; border: 1px solid var(--line-strong); - border-radius: 10px; - padding: 8px 10px; + border-radius: 14px; + padding: 8px 14px; background: var(--surface); color: var(--ink-950); font: inherit; @@ -113,53 +144,113 @@ font-weight: 600; } -.pm-table-wrap { - overflow-x: auto; +/* A project: its moving colour above, then what it is. The name's link covers the whole card; the release keeps + its own. */ +.pm-product-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 20px; +} + +.pm-catalog .pm-product-card { + position: relative; + display: flex; + flex-direction: column; + overflow: hidden; border: 1px solid var(--line); - border-radius: 16px; + border-radius: 24px; background: var(--surface); + transition: + transform 200ms ease, + box-shadow 200ms ease, + border-color 200ms ease; } -.pm-table { - inline-size: 100%; - border-collapse: collapse; - font-size: 15px; +.pm-catalog .pm-product-card:hover { + transform: translateY(-3px); + border-color: var(--line-strong); + box-shadow: 0 18px 40px rgb(20 20 19 / 10%); +} + +.pm-product-field { + display: block; + block-size: 112px; } -.pm-table th, -.pm-table td { - border-block-end: 1px solid var(--line); - padding: 14px 16px; - text-align: start; - vertical-align: top; +.pm-product-body { + display: grid; + align-content: start; + gap: 10px; + padding: 20px 22px 22px; } -.pm-table tbody tr:last-child > * { - border-block-end: 0; +.pm-product-body .pm-status { + justify-self: start; } -.pm-table thead th { - background: var(--surface-muted); +.pm-product-body h3 { + margin: 0; + font-size: 32px; + font-weight: 400; + letter-spacing: -0.02em; + line-height: 1.1; +} + +.pm-product-link { + color: var(--ink-950); + text-decoration: none; +} + +.pm-product-link::after { + position: absolute; + inset: 0; + border-radius: inherit; + content: ""; +} + +.pm-product-link:focus-visible { + outline: none; +} + +.pm-product-link:focus-visible::after { + outline: 2px solid var(--blue-600); + outline-offset: -2px; +} + +.pm-product-body > p { + margin: 0; color: var(--ink-650); - font-size: 13px; - font-weight: 700; - white-space: nowrap; + line-height: 1.55; } -.pm-table tbody th { - min-inline-size: 200px; +.pm-product-facts { + display: grid; + gap: 6px; + margin: 8px 0 0; + border-top: 1px solid var(--line); + padding-top: 14px; } -.pm-table tbody th a { - display: block; - font-weight: 700; +.pm-product-facts div { + display: flex; + justify-content: space-between; + gap: 12px; + font-size: 14.5px; } -.pm-table tbody th span { - display: block; - margin-block-start: 2px; +.pm-product-facts dt { color: var(--ink-650); - font-weight: 400; +} + +.pm-product-facts dd { + margin: 0; + color: var(--ink-950); + text-align: end; +} + +.pm-product-release { + position: relative; + z-index: 1; } .pm-status { @@ -183,27 +274,28 @@ .pm-group { display: grid; - gap: 16px; + gap: 18px; } .pm-group h2 { margin: 0; - font-size: 22px; + font-size: clamp(28px, 3vw, 38px); + font-weight: 400; + letter-spacing: -0.02em; } .pm-count { color: var(--ink-500); + font-family: var(--font-sans, inherit); font-size: 16px; font-weight: 600; + letter-spacing: 0; } -.pm-product-card .pm-status { - justify-self: start; -} - +/* The latest releases: each with its product's moving dot. */ .pm-releases { display: grid; - gap: 8px; + gap: 10px; margin: 0; padding: 0; list-style: none; @@ -212,18 +304,42 @@ .pm-releases li { display: flex; flex-wrap: wrap; - justify-content: space-between; - gap: 8px 16px; + align-items: center; + gap: 8px 14px; border: 1px solid var(--line); - border-radius: 12px; - padding: 12px 16px; + border-radius: 999px; + padding: 12px 20px; background: var(--surface); } +.pm-releases li > a { + font-weight: 600; +} + .pm-releases time { + margin-inline-start: auto; color: var(--ink-650); } +.pm-release-dot { + inline-size: 14px; + block-size: 14px; + flex: none; + border-radius: 50%; +} + +/* A project's own page */ +.pm-catalog .pm-aside { + border-radius: 24px; + overflow: hidden; +} + +.pm-catalog .pm-aside .pm-accent { + display: block; + block-size: 72px; + margin: -24px -24px 8px; +} + .pm-facts { display: grid; gap: 10px; @@ -262,66 +378,34 @@ @media (width <= 560px) { .pm-filter { grid-template-columns: 1fr; + border-radius: 22px; + padding: 16px; } - /* On a phone each project is a card: its name and tagline, then one line - per fact, labelled from the column it came from. */ - .pm-table, - .pm-table tbody, - .pm-table tr, - .pm-table th, - .pm-table td { - display: block; - } - - .pm-table thead { - position: absolute; - width: 1px; - height: 1px; - overflow: hidden; - clip-path: inset(50%); - white-space: nowrap; - } - - .pm-table tr { - border-block-end: 1px solid var(--line); - padding-block: 14px; - } - - .pm-table tbody tr:last-child { - border-block-end: 0; + .pm-views { + display: flex; + border-radius: 22px; } - .pm-table tbody th { - min-inline-size: 0; - padding-block: 0 8px; + .pm-releases li { + border-radius: 18px; } - .pm-table th, - .pm-table td { - border-block-end: 0; - } - - .pm-table td { - display: grid; - grid-template-columns: minmax(96px, 35%) minmax(0, 1fr); - justify-items: start; - gap: 12px; - padding-block: 4px; - } - - .pm-table td::before { - color: var(--ink-650); - content: attr(data-label); - font-size: 13px; - font-weight: 700; + .pm-product-body h3 { + font-size: 28px; } +} - .pm-stats { - grid-template-columns: repeat(2, minmax(0, 1fr)); +@media (prefers-reduced-motion: reduce) { + .pm-catalog .pm-product-card, + .pm-catalog .pm-product-card:hover { + transform: none; + transition: none; } +} - .pm-stats dd { - font-size: 26px; - } +.pm-catalog .pm-heading h2 { + font-family: var(--font-serif), Georgia, "Times New Roman", serif; + font-weight: 400; + font-size: clamp(30px, 3.4vw, 44px); } diff --git a/apps/web/app/products/categories/page.tsx b/apps/web/app/products/categories/page.tsx index 31ba396..0e1ec66 100644 --- a/apps/web/app/products/categories/page.tsx +++ b/apps/web/app/products/categories/page.tsx @@ -40,6 +40,7 @@ export default async function CategoriesPage() { ); return slugs.length === 0 ? null : ( <ProductGroup + locale={locale} key={category} title={catalog.categories[category]} slugs={slugs} diff --git a/apps/web/app/products/languages/page.tsx b/apps/web/app/products/languages/page.tsx index 61fe32a..8b2d86f 100644 --- a/apps/web/app/products/languages/page.tsx +++ b/apps/web/app/products/languages/page.tsx @@ -40,6 +40,7 @@ export default async function LanguagesPage() { ); return slugs.length === 0 ? null : ( <ProductGroup + locale={locale} key={language} title={language} slugs={slugs} diff --git a/apps/web/app/products/page.tsx b/apps/web/app/products/page.tsx index 1c1aa53..8452170 100644 --- a/apps/web/app/products/page.tsx +++ b/apps/web/app/products/page.tsx @@ -8,8 +8,9 @@ import Link from "next/link"; import { CatalogPage, formatDay, - ProductTable, + ProductCards, } from "@/components/ProductCatalog"; +import { accentStyle } from "@/lib/brand-colours"; import { getLocale } from "@/lib/locale.server"; import { filterProducts, @@ -70,8 +71,8 @@ export default async function ProductsPage({ searchParams }: CatalogProps) { <dl className="pm-stats"> {stats.map(([label, value]) => ( <div key={label}> - <dt>{label}</dt> <dd>{value}</dd> + <dt>{label}</dt> </div> ))} </dl> @@ -136,17 +137,22 @@ export default async function ProductsPage({ searchParams }: CatalogProps) { : catalog.search.results.replace("{count}", String(found.length))} </p> {found.length > 0 ? ( - <ProductTable slugs={found} locale={locale} catalog={catalog} /> + <ProductCards slugs={found} locale={locale} catalog={catalog} /> ) : null} <section className="pm-group"> - <h2>{catalog.latestReleases}</h2> + <h2 className="pm-serif">{catalog.latestReleases}</h2> {latest.length === 0 ? ( <p>{catalog.noReleases}</p> ) : ( <ul className="pm-releases"> {latest.map(({ slug, release }) => ( <li key={`${slug}-${release.version}`}> + <span + className="pm-release-dot pm-live-accent" + style={accentStyle(products[slug].accent)} + aria-hidden="true" + /> <a href={release.url}> {products[slug].name} <bdi>{release.version}</bdi> </a> diff --git a/apps/web/app/site.css b/apps/web/app/site.css index ff7b7e4..f4680ee 100644 --- a/apps/web/app/site.css +++ b/apps/web/app/site.css @@ -295,7 +295,7 @@ min-height: 40px; align-items: center; padding: 0 18px; - border-radius: 8px; + border-radius: 999px; font-size: 15px; font-weight: 500; text-decoration: none; @@ -412,7 +412,7 @@ margin-top: 8px; padding: 10px; border: 1px solid var(--home-rule); - border-radius: 8px; + border-radius: 999px; background: rgb(255 255 255 / 30%); color: inherit; font-size: 16px; @@ -453,9 +453,18 @@ .pm-scatter-item::before { position: absolute; inset: 8px auto 8px 0; - width: 4px; - border-radius: 2px; - background: var(--colour); + width: 5px; + border-radius: 999px; + background: linear-gradient( + 180deg, + var(--field-1, var(--colour)), + var(--field-2, var(--colour)), + var(--field-3, var(--colour)), + var(--field-2, var(--colour)), + var(--field-1, var(--colour)) + ); + background-size: 100% 300%; + animation: pm-accent-rise 7s ease-in-out infinite alternate; content: ""; } diff --git a/apps/web/components/ProductCatalog.tsx b/apps/web/components/ProductCatalog.tsx index 860294b..6e4ff86 100644 --- a/apps/web/components/ProductCatalog.tsx +++ b/apps/web/components/ProductCatalog.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later import type { ReactNode } from "react"; +import { accentStyle } from "@/lib/brand-colours"; import { Footer } from "@/components/Footer"; import { SiteHeader } from "@/components/SiteHeader"; import type { Locale } from "@/lib/localization"; @@ -64,13 +65,13 @@ export function CatalogPage({ children: ReactNode; }) { return ( - <div className="pm-page"> + <div className="pm-page pm-catalog"> <SiteHeader locale={locale} /> <main> <section className="pm-hero"> <div className="pm-shell pm-product-hero"> <p className="eyebrow">{catalog.eyebrow}</p> - <h1>{title}</h1> + <h1 className="pm-serif">{title}</h1> <p className="pm-lede">{description}</p> <nav className="pm-views" aria-label={catalog.views.label}> {(Object.keys(viewPaths) as CatalogView[]).map((name) => ( @@ -92,8 +93,68 @@ export function CatalogPage({ ); } -/** Projects as a table: name and tagline, category, language, status, latest release. */ -export function ProductTable({ +/** + * One project as a card: its moving colour, status, name and tagline, then its category, language and latest + * release. The name links to the project's page and the whole card answers to it; the release has its own link. + */ +function ProductCard({ + slug, + locale, + catalog, +}: { + slug: ProductSlug; + locale: Locale; + catalog: CatalogMessages; +}) { + const product = products[slug]; + const release = product.latestRelease; + return ( + <article className="pm-product-card"> + <span + className="pm-product-field pm-live-accent" + style={accentStyle(product.accent)} + aria-hidden="true" + /> + <div className="pm-product-body"> + <StatusBadge status={product.status} catalog={catalog} /> + <h3 className="pm-serif"> + <a className="pm-product-link" href={`/${slug}`}> + {product.name} + </a> + </h3> + <p>{catalog.products[slug].tagline}</p> + <dl className="pm-product-facts"> + <div> + <dt>{catalog.table.category}</dt> + <dd>{catalog.categories[product.category]}</dd> + </div> + <div> + <dt>{catalog.table.language}</dt> + <dd> + <bdi dir="ltr">{product.language}</bdi> + </dd> + </div> + <div> + <dt>{catalog.table.release}</dt> + <dd> + {release ? ( + <a className="pm-product-release" href={release.url}> + <bdi>{release.version}</bdi> ·{" "} + {formatDay(locale, release.date)} + </a> + ) : ( + catalog.facts.none + )} + </dd> + </div> + </dl> + </div> + </article> + ); +} + +/** Projects as a grid of cards. */ +export function ProductCards({ slugs, locale, catalog, @@ -103,51 +164,10 @@ export function ProductTable({ catalog: CatalogMessages; }) { return ( - <div className="pm-table-wrap"> - <table className="pm-table"> - <thead> - <tr> - <th scope="col">{catalog.table.name}</th> - <th scope="col">{catalog.table.category}</th> - <th scope="col">{catalog.table.language}</th> - <th scope="col">{catalog.table.status}</th> - <th scope="col">{catalog.table.release}</th> - </tr> - </thead> - <tbody> - {slugs.map((slug) => { - const product = products[slug]; - const release = product.latestRelease; - return ( - <tr key={slug}> - <th scope="row"> - <a href={`/${slug}`}>{product.name}</a> - <span>{catalog.products[slug].tagline}</span> - </th> - <td data-label={catalog.table.category}> - {catalog.categories[product.category]} - </td> - <td data-label={catalog.table.language}> - <bdi dir="ltr">{product.language}</bdi> - </td> - <td data-label={catalog.table.status}> - <StatusBadge status={product.status} catalog={catalog} /> - </td> - <td data-label={catalog.table.release}> - {release ? ( - <a href={release.url}> - <bdi>{release.version}</bdi> ·{" "} - {formatDay(locale, release.date)} - </a> - ) : ( - catalog.facts.none - )} - </td> - </tr> - ); - })} - </tbody> - </table> + <div className="pm-product-grid"> + {slugs.map((slug) => ( + <ProductCard key={slug} slug={slug} locale={locale} catalog={catalog} /> + ))} </div> ); } @@ -156,30 +176,20 @@ export function ProductTable({ export function ProductGroup({ title, slugs, + locale, catalog, }: { title: string; slugs: readonly ProductSlug[]; + locale: Locale; catalog: CatalogMessages; }) { return ( <section className="pm-group"> - <h2> + <h2 className="pm-serif"> {title} <span className="pm-count">{slugs.length}</span> </h2> - <div className="pm-product-grid"> - {slugs.map((slug) => { - const product = products[slug]; - return ( - <a className="pm-card pm-product-card" href={`/${slug}`} key={slug}> - <span className={`pm-accent pm-accent-${product.accent}`} /> - <StatusBadge status={product.status} catalog={catalog} /> - <h3>{product.name}</h3> - <p>{catalog.products[slug].tagline}</p> - </a> - ); - })} - </div> + <ProductCards slugs={slugs} locale={locale} catalog={catalog} /> </section> ); } diff --git a/apps/web/components/site/FeatureCarousel.tsx b/apps/web/components/site/FeatureCarousel.tsx index 06444c8..b3d08f9 100644 --- a/apps/web/components/site/FeatureCarousel.tsx +++ b/apps/web/components/site/FeatureCarousel.tsx @@ -85,7 +85,7 @@ export function FeatureCarousel({ <Flow colours={item.colours} seed={2.4} - speed={0.9} + speed={1.6} paused={paused} className="pm-feature-field" /> diff --git a/apps/web/lib/brand-colours.ts b/apps/web/lib/brand-colours.ts index e5f8ac9..645378e 100644 --- a/apps/web/lib/brand-colours.ts +++ b/apps/web/lib/brand-colours.ts @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> // SPDX-License-Identifier: AGPL-3.0-or-later +import type { CSSProperties } from "react"; import type { ProductFacts } from "./products"; type Accent = ProductFacts["accent"]; @@ -43,3 +44,18 @@ export function accentField(accent: Accent): FieldColours { return ["#0f3440", "#1e7188", "#7fb8c4", "#efe9dc"]; } } + +/** + * The colours of an accent as CSS custom properties: --colour, and --field-1 to --field-4 for the moving accent + * (.pm-live-accent) and the lines of the home page. + */ +export function accentStyle(accent: Accent): CSSProperties { + const [deep, middle, light, pale] = accentField(accent); + return { + "--colour": accentColour(accent), + "--field-1": deep, + "--field-2": middle, + "--field-3": light, + "--field-4": pale, + } as CSSProperties; +}