Rebuild the site to the Claude Design drafts
Carries the 11 page drafts plus the shared SiteNav and SiteFooter onto the project's own design system: tier-2 tokens, the published type roles, logical properties throughout, and both locales. Surfaces - The page stands on #0B0B0A with #1D1D1B bands lifted off it, as the drafts do; the body previously painted the band colour, so every band was a step too light. - A card is drawn one step off whatever it stands on (#1D1D1B on the ground, #141413 inside a band). Components paint --surface-card and a band re-points it for its subtree, so a card can never come out the same colour as its band. Shell - Nav: translucent ground with a blur, chevrons on group triggers, an accent rule under the current section, the drafts' compact dropdown card, and an EN | AR toggle in place of the globe menu. - Footer: the drafts' four-column grid, one-line brand text, Facebook as a bordered button, the EU lockup, the implemented-by row and the funding disclaimer. Pages - Home: hero with counting figures, launch band, three areas of change, newsroom, FAQ accordion and the consortium band. - The nine interior pages rebuilt and then audited section by section against their drafts. - Applications: the three-step application form now posts real submissions to the Strapi `application` type, validated server-side and working without JavaScript. Motion - Every animation in the drafts, as classes in _page-kit/motion.css: staggered entrances, scroll-driven reveals, the drifting washes (each page carries its own geometry), the sheen, the counting figures and the accordion. The drafts' coloured hover glow is deliberately not shipped. CMS - New `faq` collection type behind the home page's accordion. - `role` added to the consortium member component so an editor can supply the chip and the deliverable separately. Content - No invented figure, date, name or commitment ships: the five-working-day reply, the placeholder email and Facebook handle, the sample news, events, publications and FAQs, the invented application rules and the TBD counters are all withheld pending real content. Figures that survived (3 consortium partners, 4 areas of work, 16 human security sub-projects, Dec 2025 - Dec 2027) are verified against docs/ and the bundled draft copy. Verified: pnpm typecheck (web + CMS) and pnpm --filter web build pass; all 20 page/locale URLs render 200 through the built SSR handler, including with the CMS unreachable; no raw hex or physical-direction utility in components or routes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,13 +3,12 @@ import { useMemo } from "react";
|
||||
import {
|
||||
buildLocalizedHref,
|
||||
getDirection,
|
||||
LanguageSwitcher,
|
||||
LanguageToggle,
|
||||
type Locale,
|
||||
} from "../LanguageSwitcher";
|
||||
|
||||
import { Brand } from "./Brand";
|
||||
import { DesktopNav } from "./DesktopNav";
|
||||
import { EuBadge } from "./EuBadge";
|
||||
import { MobileNav } from "./MobileNav";
|
||||
import { getDefaultNavItems, getNavigationStrings } from "./nav-items";
|
||||
import { cx } from "./styles";
|
||||
@@ -36,15 +35,6 @@ export interface NavigationProps {
|
||||
/** Where the logo links. Defaults to the locale home, "/en" or "/ar". */
|
||||
homeHref?: string;
|
||||
showLanguageSwitcher?: boolean;
|
||||
/**
|
||||
* Show the EU badge in the compact bar below xl as well. ON by default:
|
||||
* donor visibility is non-negotiable, and the Figma mobile frame (20:220),
|
||||
* which is logo + hamburger only, would leave the badge out of the header on
|
||||
* every phone, tablet and 1280px-narrow laptop. Below xl the lockup renders
|
||||
* at a reduced size rather than being dropped. Pass `false` only for a
|
||||
* surface where the funding statement is guaranteed elsewhere on screen.
|
||||
*/
|
||||
showEuBadgeOnMobileBar?: boolean;
|
||||
/** Stick the bar to the top of the viewport. */
|
||||
sticky?: boolean;
|
||||
className?: string;
|
||||
@@ -53,13 +43,19 @@ export interface NavigationProps {
|
||||
/**
|
||||
* The SHARP-ER site navigation - Figma frame 20:236.
|
||||
*
|
||||
* Logo at the inline start, the mandatory "Funded by the European Union" badge
|
||||
* at the inline end, and the mega-menu groups between them. Everything is laid
|
||||
* out with logical properties, so the Arabic bar mirrors (logo right, EU badge
|
||||
* left) from `<html dir="rtl">` alone - there is no separate Arabic component.
|
||||
* Three slots, spread across the bar: the wordmark at the inline start, the
|
||||
* mega-menu groups in the middle, and the language globe at the inline end.
|
||||
* Everything is laid out with logical properties, so the Arabic bar mirrors
|
||||
* (logo right, globe left) from `<html dir="rtl">` alone - there is no separate
|
||||
* Arabic component, which is what variants 334:526 and 334:764 show.
|
||||
*
|
||||
* Below the xl breakpoint the bar collapses to logo + hamburger and the whole
|
||||
* tree moves into a full-screen drawer.
|
||||
* Below the xl breakpoint the bar collapses to wordmark + hamburger (20:220)
|
||||
* and the whole tree moves into a full-screen drawer.
|
||||
*
|
||||
* EU VISIBILITY: the updated design has no funding badge in the bar - the
|
||||
* Actions slot holds the language globe alone. The mandatory "Funded by the
|
||||
* European Union" lockup is carried by <Footer />, which renders on every page,
|
||||
* and by the mobile drawer; it is not dropped from the site.
|
||||
*/
|
||||
export function Navigation({
|
||||
locale = "en",
|
||||
@@ -71,7 +67,6 @@ export function Navigation({
|
||||
strings: stringOverrides,
|
||||
homeHref,
|
||||
showLanguageSwitcher = true,
|
||||
showEuBadgeOnMobileBar = true,
|
||||
sticky = true,
|
||||
className,
|
||||
}: NavigationProps) {
|
||||
@@ -90,10 +85,10 @@ export function Navigation({
|
||||
return (
|
||||
<header
|
||||
data-surface={surface}
|
||||
/* overflow-x-clip contains the mega panel's full-bleed backdrop without
|
||||
clipping the panel itself, which overflows vertically. */
|
||||
className={cx(
|
||||
"w-full overflow-x-clip border-b border-[var(--border-subtle)]",
|
||||
"w-full border-b border-[var(--border-subtle)]",
|
||||
/* Translucent ground + blur, as the drafts draw the bar. */
|
||||
"bg-[var(--surface-nav)] backdrop-blur-[14px]",
|
||||
sticky && "sticky top-0 z-[var(--layer-header)]",
|
||||
className,
|
||||
)}
|
||||
@@ -101,10 +96,13 @@ export function Navigation({
|
||||
<div
|
||||
className={cx(
|
||||
"mx-auto flex w-full max-w-[var(--layout-content-max)] items-center justify-between",
|
||||
/* The compact bar carries wordmark + EU lockup + hamburger on a
|
||||
320px screen, so it runs a tighter gap than the desktop bar. */
|
||||
"min-h-[64px] gap-xs px-[var(--layout-gutter)]",
|
||||
"xl:min-h-[72px] xl:gap-lg xl:px-2xl",
|
||||
/* Mobile 20:220 is a fixed 64px bar; the gutter is the site's own
|
||||
rather than the frame's 20px, so the wordmark lines up with the
|
||||
page content underneath it. */
|
||||
"h-[64px] gap-md px-[var(--layout-gutter)]",
|
||||
/* The drafts pad the bar with the same gutter every section uses, so
|
||||
the wordmark sits directly above the page's content edge. */
|
||||
"xl:h-auto xl:gap-lg xl:px-[var(--layout-gutter-lg)] xl:py-sm",
|
||||
)}
|
||||
>
|
||||
<Brand
|
||||
@@ -121,43 +119,33 @@ export function Navigation({
|
||||
className="hidden xl:block"
|
||||
/>
|
||||
|
||||
<div className="flex items-center gap-xs xl:gap-md">
|
||||
{/* Desktop-only cluster. Visibility lives on this wrapper rather than
|
||||
on the children: two display utilities on one element are resolved
|
||||
by the order Tailwind emits them, not by class-attribute order. */}
|
||||
<div className="hidden items-center gap-md xl:flex">
|
||||
{showLanguageSwitcher && (
|
||||
<LanguageSwitcher
|
||||
<div className="flex items-center gap-md">
|
||||
{/* The globe is desktop-only: the mobile bar (20:220) is wordmark +
|
||||
hamburger, and the drawer carries the switcher instead. Visibility
|
||||
lives on this wrapper rather than on the child, because two
|
||||
display utilities on one element are resolved by the order
|
||||
Tailwind emits them, not by class-attribute order. */}
|
||||
{showLanguageSwitcher && (
|
||||
/* Figma 555:3848 sets a 20px rule between the links and the
|
||||
actions, then 24px to the globe. It is decorative, so it is
|
||||
hidden from assistive technology and drawn with a border token
|
||||
rather than a rule element. */
|
||||
<div className="hidden items-center gap-lg xl:flex">
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="h-5 w-px bg-[var(--border-default)]"
|
||||
/>
|
||||
|
||||
{/* Both languages side by side, per the redesign's nav: the
|
||||
current one chipped, the other one link. */}
|
||||
<LanguageToggle
|
||||
label={strings.languageMenuLabel}
|
||||
locale={locale}
|
||||
pathname={pathname}
|
||||
search={search}
|
||||
hash={hash}
|
||||
/>
|
||||
)}
|
||||
|
||||
{!showEuBadgeOnMobileBar && (
|
||||
<EuBadge
|
||||
statement={strings.euStatement}
|
||||
emblemAlt={strings.euEmblemAlt}
|
||||
locale={locale}
|
||||
surface={surface}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{showEuBadgeOnMobileBar && (
|
||||
<EuBadge
|
||||
statement={strings.euStatement}
|
||||
emblemAlt={strings.euEmblemAlt}
|
||||
locale={locale}
|
||||
surface={surface}
|
||||
/* Below xl the lockup is scaled down - emblem 36x24 instead of
|
||||
48x32, statement wrapped in a narrower box - so it still fits
|
||||
beside the wordmark and the hamburger at 320px. It is scaled,
|
||||
never hidden: the statement stays at Label/Medium, i.e. the
|
||||
same size it is everywhere else, so it remains legible. */
|
||||
className="max-xl:[&>img]:h-[24px] max-xl:[&>img]:w-[36px] max-xl:[&>span]:w-[80px]"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<MobileNav
|
||||
@@ -204,8 +192,4 @@ export default Navigation;
|
||||
// keeps the query string and fragment:
|
||||
const { pathname, search, hash } = useLocation();
|
||||
<Navigation locale={locale} pathname={pathname} search={search} hash={hash} />
|
||||
|
||||
// The EU badge is in the compact bar by default. Opt out only where the
|
||||
// funding statement is guaranteed to be visible elsewhere on the screen:
|
||||
<Navigation locale="en" pathname="/en" showEuBadgeOnMobileBar={false} />
|
||||
------------------------------------------------------------------------ */
|
||||
|
||||
Reference in New Issue
Block a user