Match the home page to Figma frame 253:4799
The page resembled the design but had drifted in every band. Ported it section by section against the measured frame. Hero (253:4800) - Add the SHARP wordmark above the headline. The frame paints "SHARP" only, not the full SHARP-ER lockup the navigation carries, so this is the SHARP mark on its own, as vector (extracted from the brand guideline artwork) at its true 273px rather than an upscaled PNG. - Drop the leading project name from the headline in both locales: the wordmark above now carries it, as the frame composes it. - Stop the lead paragraph rendering by default. The frame's subheading node is hidden, but the code fell back to the site description, so a paragraph always appeared. - Fallback CTAs become "Discover SHARP-ER" / "Explore Our Work", 24px apart. Both the CMS and fallback paths now render through one HeroCta, so an editor-authored secondary CTA gets the designed white treatment instead of the dark-surface outline. - The picture loses its radius and gains the frame's two flat washes and wide band. Figures band - 253:4835 is hidden="true" in the frame, so the band and its "figures still being confirmed" placeholder no longer render. It appears only once the CMS supplies real numbers. Launch (361:10853) - Heading renders at Display/Small instead of Heading/H2. SectionHeader gains `size` since display-sm was reachable only via titleAs="h1". - The three-paragraph story becomes the frame's single centred lead with its four bold runs, which needed a ProseRun copy shape - a flat string cannot carry emphasis. - The captions were Card.Content links with images and action labels; the frame draws plain centred Heading/H2 text. - Add the three-up photo strip that bleeds past the page and clips. - Remove the funding line, which the frame does not draw in this band. EU visibility still stands via the nav badge and footer statement. Partners (393:14754) - Heading moves from centred to start-aligned, up to Display/Small. - Tiles move to the sunken surface (they were lighter than the page; the design has them darker), lose their border, 8px -> 4px radius, padding on the inline start only, logo 48 -> 70px, name to Body/Large Bold. Footer - Black ground via a new --surface-footer token, a top rule, links up to Body/Large Bold 18/28 at 24px spacing, and column headings to Body/Small Bold on --text-tertiary. - Keeps the real IA from ROUTE_SLUGS rather than frame 140:7814's labels, which name six pages that do not exist. Tokens - New tier-1 steps for values the design uses and the ramps lacked (--color-black-a20, --color-green-200-a12, --opacity-50) and tier-2 --overlay-picture-shade / --overlay-picture-tint for the hero wash. copy.ts now names the Figma frame as the source for the home strings. The Arabic launch lead is rebuilt from the approved Arabic column to carry the English frame's meaning and is marked (ar-draft) pending client sign-off - the file has no Arabic home frame to work from. Verified: typecheck and build green, no raw hex or tier-1 token in components/routes, no physical-direction utility, 141 i18n keys at parity, both locales rendered and checked for RTL mirroring. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,24 +1,39 @@
|
||||
/* ============================================================================
|
||||
APPROVED DRAFT COPY - EN / AR
|
||||
PAGE COPY - EN / AR
|
||||
----------------------------------------------------------------------------
|
||||
SOURCE
|
||||
docs/SHARPER_Website_Draft_Section_EN_AR.docx (sections 1, 2 and 9)
|
||||
docs/SHARPER Home Page .docx (the launch story)
|
||||
Both documents carry the English AND the Arabic, so nothing below is a
|
||||
machine translation of the other column except where a comment says so.
|
||||
Home page Figma frame 253:4799 "Home-en" is the source of truth.
|
||||
The headline (I253:4800;228:2609), the launch heading
|
||||
(I361:10853;361:11147), the one-paragraph launch lead
|
||||
with its four bold runs (I361:10853;349:8838) and the
|
||||
three captions are transcribed from that frame, NOT
|
||||
from docs/SHARPER Home Page .docx - the design condenses
|
||||
the draft, and the draft itself is headed "Placeholder
|
||||
text for design purposes - not final copy".
|
||||
Everything else docs/SHARPER_Website_Draft_Section_EN_AR.docx
|
||||
(sections 1, 2 and 9), which carries both columns, so
|
||||
no string below is a machine translation of the other
|
||||
except where a comment says so.
|
||||
|
||||
TRANSLATION STATUS
|
||||
The Figma file has NO Arabic home frame - only the navigation and the
|
||||
footer are drawn in Arabic - so the Arabic home strings marked (ar-draft)
|
||||
are rebuilt from the approved Arabic column of the docx to carry the
|
||||
English Figma meaning. They are NOT client-approved wording and should be
|
||||
signed off before launch.
|
||||
|
||||
WHY IT LIVES IN THE CODE
|
||||
This is page prose, not UI chrome, so it does not belong in the i18n
|
||||
catalogue (which holds labels only). It is the FALLBACK: every field is
|
||||
overridden by the matching Strapi field the moment an editor fills it in,
|
||||
and the pages read `cms ?? draft`. Until then this is what renders, which
|
||||
is exactly what the draft document is for.
|
||||
and the pages read `cms ?? draft`.
|
||||
|
||||
WHAT IS DELIBERATELY ABSENT
|
||||
Figures. The draft marks every number "TBD" and says they must not be
|
||||
published until confirmed, so there is no statistic anywhere in this file;
|
||||
the home page renders `statsPending` instead, and real figures arrive
|
||||
through the CMS `stats` component.
|
||||
published until confirmed, so there is no statistic anywhere in this file.
|
||||
Figma hides the home page's figures band outright (frame 253:4835 is
|
||||
hidden="true"), so the band renders only once the CMS `stats` component
|
||||
supplies real numbers, and nothing stands in for it until then.
|
||||
========================================================================= */
|
||||
|
||||
import type { Locale } from "~/i18n";
|
||||
@@ -35,14 +50,19 @@ export interface ConsortiumCopy {
|
||||
readonly role: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* A run of prose that may carry emphasis. Figma sets four phrases of the launch
|
||||
* lead in Bold on a lighter base run (349:8838), which a flat string cannot
|
||||
* express - a plain string is the base weight, `{ em }` is the bold run.
|
||||
*/
|
||||
export type ProseRun = string | { readonly em: string };
|
||||
|
||||
export interface HomeCopy {
|
||||
readonly heroHeadline: string;
|
||||
readonly statsHeading: string;
|
||||
/** Rendered in place of the figures while they are unconfirmed. */
|
||||
readonly statsPending: string;
|
||||
readonly launchHeading: string;
|
||||
readonly launchParagraphs: readonly string[];
|
||||
readonly fundingNote: string;
|
||||
/** One paragraph, as the design draws it - not the full three-part story. */
|
||||
readonly launchLead: readonly ProseRun[];
|
||||
readonly mechanismsHeading: string;
|
||||
readonly mechanisms: readonly string[];
|
||||
readonly partnersHeading: string;
|
||||
@@ -108,17 +128,22 @@ export interface PageCopy {
|
||||
|
||||
const EN: PageCopy = {
|
||||
home: {
|
||||
heroHeadline: "SHARP-ER Project Officially Launches in Libya",
|
||||
/* The frame's wordmark above the headline carries the project name, so
|
||||
the headline itself does not repeat it (figma I253:4800;228:2609). */
|
||||
heroHeadline: "Project Officially Launches in Libya",
|
||||
statsHeading: "SHARP-ER in numbers",
|
||||
statsPending:
|
||||
"The project’s figures are still being confirmed in the official fact sheet. They will be published here once verified.",
|
||||
launchHeading: "The Journey of the SHARP-ER Launch",
|
||||
launchParagraphs: [
|
||||
"On Tuesday, June 30, the SHARP-ER project officially launched, bringing together representatives from the European Union Delegation, the Ministry of Youth, the Ministry of Local Governance, the Ministry of Women’s Affairs, civil society organizations, partners, and stakeholders from across Libya.",
|
||||
"The event marked an important start for the project, including the launch of the SHARP-ER website and the opening of the Expression of Interest (EOI). Participants also learned more about the project’s objectives, upcoming opportunities, and activities focused on strengthening collaboration, partnerships, and local capacities.",
|
||||
"Thank you to everyone who joined us and contributed to this milestone. We look forward to working together to support locally driven initiatives and create meaningful, lasting impact across Libya.",
|
||||
launchHeading: "The Journey of SHARP-ER Launch",
|
||||
launchLead: [
|
||||
"The SHARP-ER project officially launched on ",
|
||||
{ em: "Tuesday, June 30" },
|
||||
", joining representatives from the ",
|
||||
{ em: "European Union Delegation" },
|
||||
", key ",
|
||||
{ em: "Libyan Ministries" },
|
||||
", and ",
|
||||
{ em: "local civil society partners" },
|
||||
". The event marked the launch of the project’s official website and the Call for Expression of Interest (EOI).",
|
||||
],
|
||||
fundingNote: "This project is funded by the European Union in Libya.",
|
||||
mechanismsHeading: "What the launch set in motion",
|
||||
mechanisms: [
|
||||
"Building local capacity and skills",
|
||||
@@ -249,17 +274,21 @@ const EN: PageCopy = {
|
||||
|
||||
const AR: PageCopy = {
|
||||
home: {
|
||||
heroHeadline: "انطلاق مشروع SHARP-ER رسميًا في ليبيا",
|
||||
/* (ar-draft) matches the English frame: the wordmark names the project. */
|
||||
heroHeadline: "انطلاق المشروع رسميًا في ليبيا",
|
||||
statsHeading: "SHARP-ER بالأرقام",
|
||||
statsPending:
|
||||
"لا تزال أرقام المشروع قيد التأكيد في ورقة الحقائق الرسمية، وسيتم نشرها هنا فور اعتمادها.",
|
||||
launchHeading: "مسيرة إطلاق مشروع SHARP-ER",
|
||||
launchParagraphs: [
|
||||
"انطلقت يوم الثلاثاء 30 يونيو رسميًا فعاليات مشروع SHARP-ER خلال حدث الإطلاق الذي جمع ممثلين عن بعثة الاتحاد الأوروبي، ووزارة الشباب، ووزارة الحكم المحلي، ووزارة شؤون المرأة، إلى جانب منظمات المجتمع المدني والشركاء والجهات الفاعلة من مختلف أنحاء ليبيا.",
|
||||
"وشكّل الحدث بداية مهمة للمشروع، حيث تم إطلاق الموقع الإلكتروني الرسمي، والإعلان عن فتح باب التعبير عن الاهتمام (EOI)، إلى جانب استعراض أهداف المشروع والفرص والأنشطة القادمة. وتركّز هذه الأنشطة على تعزيز التعاون والشراكات وبناء القدرات على المستوى المحلي.",
|
||||
"نتوجه بالشكر إلى جميع المشاركين على حضورهم ومساهماتهم القيّمة. ونتطلع إلى العمل معًا خلال المرحلة المقبلة لدعم المبادرات المحلية وتحقيق أثر مستدام في مختلف أنحاء ليبيا.",
|
||||
launchLead: [
|
||||
"انطلقت رسميًا فعاليات مشروع SHARP-ER يوم ",
|
||||
{ em: "الثلاثاء 30 يونيو" },
|
||||
"، بمشاركة ممثلين عن ",
|
||||
{ em: "بعثة الاتحاد الأوروبي" },
|
||||
"، وعدد من ",
|
||||
{ em: "الوزارات الليبية" },
|
||||
"، إلى جانب ",
|
||||
{ em: "شركاء المجتمع المدني المحليين" },
|
||||
". وشهد الحدث إطلاق الموقع الإلكتروني الرسمي للمشروع والدعوة للتعبير عن الاهتمام (EOI).",
|
||||
],
|
||||
fundingNote: "المشروع ممول من الاتحاد الأوروبي في ليبيا.",
|
||||
mechanismsHeading: "ما الذي أطلقه هذا الحدث",
|
||||
mechanisms: [
|
||||
"بناء القدرات والمهارات المحلية",
|
||||
|
||||
@@ -98,6 +98,13 @@ export interface SectionHeaderProps {
|
||||
eyebrow?: string;
|
||||
lead?: string;
|
||||
titleAs?: "h1" | "h2" | "h3";
|
||||
/**
|
||||
* Type role of the title. "h2" is the Heading/H2 role every inner page uses;
|
||||
* "display" is Display/Small - the home page draws its band headings at the
|
||||
* same 44/52 as the hero (figma 361:11147, 393:14570) while keeping them
|
||||
* <h2> in the outline, which `titleAs` alone cannot express.
|
||||
*/
|
||||
size?: "h2" | "display";
|
||||
/** Figma centres the home page's section headers; inner pages read start. */
|
||||
align?: "start" | "center";
|
||||
className?: string;
|
||||
@@ -109,11 +116,13 @@ export function SectionHeader({
|
||||
eyebrow,
|
||||
lead,
|
||||
titleAs = "h2",
|
||||
size = "h2",
|
||||
align = "start",
|
||||
className,
|
||||
}: SectionHeaderProps) {
|
||||
const Title = titleAs;
|
||||
const centred = align === "center";
|
||||
const display = size === "display" || titleAs === "h1";
|
||||
|
||||
return (
|
||||
<header
|
||||
@@ -131,7 +140,7 @@ export function SectionHeader({
|
||||
id={id}
|
||||
className={cx(
|
||||
"text-[var(--text-primary)]",
|
||||
titleAs === "h1" ? "heading-h1 md:display-sm" : "heading-h2",
|
||||
display ? "heading-h1 md:display-sm" : "heading-h2",
|
||||
)}
|
||||
>
|
||||
{title}
|
||||
@@ -150,14 +159,50 @@ export function SectionHeader({
|
||||
HERO
|
||||
------------------------------------------------------------------------ */
|
||||
|
||||
export interface PageHeroWordmark {
|
||||
src: string;
|
||||
/**
|
||||
* Empty when the headline already names the project - the lockup is then
|
||||
* decorative and a screen reader would otherwise read the name twice.
|
||||
*/
|
||||
alt: string;
|
||||
/** Intrinsic pixels of the asset, for the aspect ratio the browser reserves. */
|
||||
width: number;
|
||||
height: number;
|
||||
/** Drawn width in CSS pixels. Figma 253:4800 draws the hero lockup at 419. */
|
||||
drawnWidth: number;
|
||||
}
|
||||
|
||||
export interface PageHeroMedia {
|
||||
src: string;
|
||||
alt: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* How the picture is drawn.
|
||||
* "rounded" - a 16:9 card with the surface radius. The default, and what the
|
||||
* inner pages have always rendered.
|
||||
* "banner" - the home treatment (figma 253:4800): square corners, a wide
|
||||
* band, and the two flat washes the frame paints over the photo.
|
||||
*/
|
||||
export type PageHeroMediaTreatment = "rounded" | "banner";
|
||||
|
||||
export interface PageHeroProps {
|
||||
title: string;
|
||||
eyebrow?: string;
|
||||
lead?: string;
|
||||
/**
|
||||
* Brand lockup drawn above the headline. Only the home hero carries one
|
||||
* (figma 253:4800, a 419x58 wordmark 48px above the headline row).
|
||||
*/
|
||||
wordmark?: PageHeroWordmark;
|
||||
/** Buttons, rendered inline-end of the headline on wide viewports. */
|
||||
actions?: ReactNode;
|
||||
/** Wide picture below the headline row, as in Figma 253:4800. */
|
||||
media?: { src: string; alt: string; width?: number; height?: number };
|
||||
media?: PageHeroMedia;
|
||||
mediaTreatment?: PageHeroMediaTreatment;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
@@ -171,13 +216,32 @@ export function PageHero({
|
||||
title,
|
||||
eyebrow,
|
||||
lead,
|
||||
wordmark,
|
||||
actions,
|
||||
media,
|
||||
mediaTreatment = "rounded",
|
||||
className,
|
||||
}: PageHeroProps) {
|
||||
return (
|
||||
<section className={cx("pt-2xl pb-3xl md:pt-3xl md:pb-4xl", className)}>
|
||||
<section className={cx("pt-2xl md:pt-3xl", className)}>
|
||||
<Container className="flex flex-col gap-2xl">
|
||||
{wordmark ? (
|
||||
/* A graphic dimension, not a spacing value - sized the way Brand.tsx
|
||||
and the footer size their lockups, with the intrinsic box on the
|
||||
element so the browser reserves the right height. */
|
||||
<img
|
||||
src={wordmark.src}
|
||||
alt={wordmark.alt}
|
||||
width={wordmark.width}
|
||||
height={wordmark.height}
|
||||
loading="eager"
|
||||
decoding="async"
|
||||
draggable={false}
|
||||
style={{ maxWidth: `${wordmark.drawnWidth}px` }}
|
||||
className="block h-auto w-full"
|
||||
/>
|
||||
) : null}
|
||||
|
||||
<div className="flex flex-col gap-lg lg:flex-row lg:items-end lg:justify-between">
|
||||
<div className="flex max-w-[46rem] flex-col gap-sm">
|
||||
{eyebrow ? (
|
||||
@@ -196,21 +260,47 @@ export function PageHero({
|
||||
</div>
|
||||
|
||||
{actions ? (
|
||||
<div className="flex flex-wrap items-center gap-md lg:justify-end">
|
||||
<div className="flex flex-wrap items-center gap-lg lg:justify-end">
|
||||
{actions}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{media ? (
|
||||
<img
|
||||
src={media.src}
|
||||
alt={media.alt}
|
||||
{...(media.width ? { width: media.width } : {})}
|
||||
{...(media.height ? { height: media.height } : {})}
|
||||
fetchPriority="high"
|
||||
className="aspect-[16/9] w-full max-w-full rounded-surface object-cover"
|
||||
/>
|
||||
mediaTreatment === "banner" ? (
|
||||
/* Figma draws a 1244x700 picture inside an 800px frame that clips
|
||||
it, so what the page actually shows is a wide band. The band is
|
||||
kept at 16:9 on a phone, where a 2.9:1 strip would be a sliver.
|
||||
The two washes are flat fills in the frame, not gradients: a
|
||||
mint tint over a shade, both painted on the photograph. */
|
||||
<div className="relative w-full overflow-hidden">
|
||||
<img
|
||||
src={media.src}
|
||||
alt={media.alt}
|
||||
{...(media.width ? { width: media.width } : {})}
|
||||
{...(media.height ? { height: media.height } : {})}
|
||||
fetchPriority="high"
|
||||
className="aspect-[16/9] w-full object-cover md:aspect-[1244/425]"
|
||||
/>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-0 bg-[var(--overlay-picture-shade)]"
|
||||
/>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-0 bg-[var(--overlay-picture-tint)]"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<img
|
||||
src={media.src}
|
||||
alt={media.alt}
|
||||
{...(media.width ? { width: media.width } : {})}
|
||||
{...(media.height ? { height: media.height } : {})}
|
||||
fetchPriority="high"
|
||||
className="aspect-[16/9] w-full max-w-full rounded-surface object-cover"
|
||||
/>
|
||||
)
|
||||
) : null}
|
||||
</Container>
|
||||
</section>
|
||||
|
||||
+238
-136
@@ -1,28 +1,37 @@
|
||||
/* ============================================================================
|
||||
HOME - /en and /ar
|
||||
----------------------------------------------------------------------------
|
||||
Figma frame 253:4799 ("Home-en"), which is laid out as:
|
||||
Figma frame 253:4799 ("Home-en"). The frame is four bands:
|
||||
|
||||
Hero header (253:4800) headline + CTA group + wide picture
|
||||
Stats hidden in the frame, and every figure in the
|
||||
draft copy is marked TBD - so the band renders a
|
||||
localised "not yet confirmed" note and only shows
|
||||
numbers the CMS supplies
|
||||
Offical launch (361:10853) "The Journey of the SHARP-ER Launch", the
|
||||
launch story, the photo strip and the three
|
||||
captions under it
|
||||
Partners (393:14754) "Meet Our Partners" logo grid
|
||||
Footer owned by the app shell, not by this module
|
||||
Hero header (253:4800) the SHARP-ER lockup, the headline, the CTA
|
||||
pair and the wide washed picture. The frame's
|
||||
subheading node is hidden, so the hero carries
|
||||
no lead unless the CMS supplies one.
|
||||
About the Programme 253:4835, hidden="true" in the frame. It is
|
||||
the only place figures appear, so the band
|
||||
renders ONLY once the CMS has real numbers -
|
||||
there is no placeholder standing in for it.
|
||||
Offical launch (361:10853) "The Journey of SHARP-ER Launch": one centred
|
||||
lead with four bold runs, a three-up photo
|
||||
strip that bleeds past the page and is
|
||||
clipped, and three plain centred captions.
|
||||
Partners (393:14754) "Meet Our Partners", start-aligned, over a
|
||||
grid of logo-and-name tiles.
|
||||
Footer owned by the app shell, not by this module
|
||||
|
||||
The launch story is the approved copy from docs/SHARPER Home Page .docx in
|
||||
both languages; the pictures, the figures and the partner list come from
|
||||
Strapi and degrade to a localised empty state while it is empty.
|
||||
There is no Arabic frame in the file - only the navigation and the footer
|
||||
are drawn in Arabic - so /ar is this same DOM under `dir="rtl"`, which is
|
||||
why every inline edge below is logical (ps-/pe-/start-/end-) and never
|
||||
left/right.
|
||||
|
||||
Copy is the approved draft in both languages; the pictures, the figures and
|
||||
the partner list come from Strapi and degrade to a localised empty state
|
||||
while it is empty.
|
||||
========================================================================= */
|
||||
|
||||
import { Link } from "react-router";
|
||||
|
||||
import { ArrowIcon, Button } from "~/components/ui/Button";
|
||||
import { Card } from "~/components/ui/Card";
|
||||
import { createTranslator, getMessages, sectionPath } from "~/i18n";
|
||||
import {
|
||||
buildMeta,
|
||||
@@ -48,6 +57,7 @@ import {
|
||||
import { pageCopy } from "./_page-kit/copy";
|
||||
import { routeLocale } from "./_page-kit/locale";
|
||||
import {
|
||||
Container,
|
||||
EmptyState,
|
||||
PageHero,
|
||||
PageSection,
|
||||
@@ -58,6 +68,21 @@ import {
|
||||
/** Partner logos and CSO tiles - a wide but finite grid. */
|
||||
const PARTNER_PAGE_SIZE = 36;
|
||||
|
||||
/**
|
||||
* The mark the hero draws above the headline (figma 253:4800). The frame paints
|
||||
* "SHARP" only - 272.58 x 57.65 of ink - not the full SHARP-ER lockup the
|
||||
* navigation carries, so this is the SHARP wordmark on its own, as vector so it
|
||||
* stays crisp at any size. `alt` is empty because the navigation's brand link
|
||||
* already carries the project's accessible name.
|
||||
*/
|
||||
const HERO_WORDMARK = {
|
||||
src: "/assets/sharp-wordmark-inverse.svg",
|
||||
alt: "",
|
||||
width: 272,
|
||||
height: 57,
|
||||
drawnWidth: 273,
|
||||
} as const;
|
||||
|
||||
export async function loader({ params }: Route.LoaderArgs) {
|
||||
const locale = routeLocale(params);
|
||||
|
||||
@@ -146,168 +171,245 @@ export function meta({ loaderData, matches }: Route.MetaArgs) {
|
||||
});
|
||||
}
|
||||
|
||||
interface HeroCtaProps {
|
||||
href: string;
|
||||
label: string;
|
||||
variant: "primary" | "secondary";
|
||||
}
|
||||
|
||||
/**
|
||||
* A hero call to action. Figma paints the secondary one as a white fill with a
|
||||
* black stroke and a dark label, which is the secondary variant on the LIGHT
|
||||
* surface - so the surface is flipped on the control itself. It has to be the
|
||||
* control and not a wrapper: `[data-surface]` paints a background in the base
|
||||
* layer, and a wrapping element would draw a square white box behind the
|
||||
* button's rounded corners.
|
||||
*/
|
||||
function HeroCta({ href, label, variant }: HeroCtaProps) {
|
||||
return (
|
||||
<Button
|
||||
as={Link}
|
||||
to={href}
|
||||
prefetch="intent"
|
||||
size="lg"
|
||||
variant={variant}
|
||||
{...(variant === "secondary" ? { "data-surface": "light" } : {})}
|
||||
iconEnd={variant === "primary" ? <ArrowIcon /> : undefined}
|
||||
>
|
||||
{label}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The three-up strip under the launch lead (figma 361:11115). The row is drawn
|
||||
* 1849px wide against a 1440px page, so it deliberately overflows the page and
|
||||
* is clipped by the band - the widths below are the designed proportions of the
|
||||
* 1440 artboard (500 / 729 / 500) carried over as viewport fractions, which
|
||||
* reproduces the overhang at any width. The centre picture is the emphasised
|
||||
* one; the flanks sit at half strength and are dropped on small screens, where
|
||||
* three clipped pictures would be unreadable.
|
||||
*/
|
||||
function LaunchStrip({ images }: { images: readonly ResolvedImage[] }) {
|
||||
const first = images[0];
|
||||
if (!first) return null;
|
||||
|
||||
/* The flanks only exist as a trio. With one or two pictures the emphasised
|
||||
one stays centred and the row simply has no wings, rather than throwing
|
||||
the centre off-axis or hiding an uploaded picture below `lg`. */
|
||||
const complete = images.length >= 3;
|
||||
const centre = complete ? images[1]! : first;
|
||||
const flanks = complete
|
||||
? { start: images[0]!, end: images[2]! }
|
||||
: { start: undefined, end: undefined };
|
||||
|
||||
return (
|
||||
<ul className="flex list-none items-center justify-center gap-3xl">
|
||||
{flanks.start ? (
|
||||
<li className="hidden shrink-0 lg:block">
|
||||
<img
|
||||
src={flanks.start.src}
|
||||
alt={flanks.start.alt}
|
||||
loading="lazy"
|
||||
className="aspect-[500/268] w-[34.7vw] object-cover opacity-50"
|
||||
/>
|
||||
</li>
|
||||
) : null}
|
||||
|
||||
<li className="shrink-0">
|
||||
<img
|
||||
src={centre.src}
|
||||
alt={centre.alt}
|
||||
loading="lazy"
|
||||
className="aspect-[729/374] w-[86vw] object-cover lg:w-[50.6vw]"
|
||||
/>
|
||||
</li>
|
||||
|
||||
{flanks.end ? (
|
||||
<li className="hidden shrink-0 lg:block">
|
||||
<img
|
||||
src={flanks.end.src}
|
||||
alt={flanks.end.alt}
|
||||
loading="lazy"
|
||||
className="aspect-[500/267] w-[34.7vw] object-cover opacity-50"
|
||||
/>
|
||||
</li>
|
||||
) : null}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Home({ loaderData }: Route.ComponentProps) {
|
||||
const { locale, hero, stats, gallery, partners } = loaderData;
|
||||
const t = createTranslator(locale);
|
||||
const copy = pageCopy(locale).home;
|
||||
|
||||
const headline = hero.headline ?? copy.heroHeadline;
|
||||
const lead = hero.subheading ?? t("site.description");
|
||||
const partnersHeadline = loaderData.partnersHeadline ?? copy.partnersHeading;
|
||||
|
||||
/* The three captions under the photo strip in Figma. Each one points at the
|
||||
section of the site that carries that strand of work forward, and every
|
||||
label is a catalogue string so /ar never inherits an English one. */
|
||||
const mechanisms = [
|
||||
{
|
||||
title: copy.mechanisms[0]!,
|
||||
href: sectionPath("whatWeDo", locale),
|
||||
actionLabel: t("actions.learnWhatWeDo"),
|
||||
},
|
||||
{
|
||||
title: copy.mechanisms[1]!,
|
||||
href: sectionPath("activities", locale),
|
||||
actionLabel: t("actions.seeActivities"),
|
||||
},
|
||||
{
|
||||
title: copy.mechanisms[2]!,
|
||||
href: sectionPath("applications", locale),
|
||||
actionLabel: t("actions.seeCurrentCalls"),
|
||||
},
|
||||
];
|
||||
/* The frame draws one accent CTA and one white one. Editor-supplied CTAs go
|
||||
through the same component as the fallback pair, so a `secondary` CTA
|
||||
authored in Strapi gets the white treatment too. */
|
||||
const heroCtas: readonly HeroCtaProps[] =
|
||||
hero.ctas.length > 0
|
||||
? hero.ctas.map((cta) => ({
|
||||
href: cta.href,
|
||||
label: cta.label,
|
||||
variant: cta.variant === "primary" ? "primary" : "secondary",
|
||||
}))
|
||||
: [
|
||||
{
|
||||
href: sectionPath("about", locale),
|
||||
label: t("actions.discoverSharper"),
|
||||
variant: "primary",
|
||||
},
|
||||
{
|
||||
href: sectionPath("whatWeDo", locale),
|
||||
label: t("actions.exploreOurWork"),
|
||||
variant: "secondary",
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* `lead` is passed only when the CMS supplies a subheading: the frame's
|
||||
own subheading node is hidden, so nothing stands under the headline
|
||||
unless an editor deliberately writes one. */}
|
||||
<PageHero
|
||||
title={headline}
|
||||
{...(hero.eyebrow ? { eyebrow: hero.eyebrow } : {})}
|
||||
lead={lead}
|
||||
{...(hero.subheading ? { lead: hero.subheading } : {})}
|
||||
wordmark={HERO_WORDMARK}
|
||||
{...(hero.media ? { media: hero.media } : {})}
|
||||
mediaTreatment="banner"
|
||||
actions={
|
||||
hero.ctas.length > 0 ? (
|
||||
hero.ctas.map((cta) => (
|
||||
<Button
|
||||
key={`${cta.href}-${cta.label}`}
|
||||
as={Link}
|
||||
to={cta.href}
|
||||
prefetch="intent"
|
||||
size="lg"
|
||||
variant={cta.variant}
|
||||
iconEnd={cta.variant === "primary" ? <ArrowIcon /> : undefined}
|
||||
>
|
||||
{cta.label}
|
||||
</Button>
|
||||
))
|
||||
) : (
|
||||
<>
|
||||
<Button
|
||||
as={Link}
|
||||
to={sectionPath("about", locale)}
|
||||
prefetch="intent"
|
||||
size="lg"
|
||||
variant="primary"
|
||||
iconEnd={<ArrowIcon />}
|
||||
>
|
||||
{t("actions.learnMore")}
|
||||
</Button>
|
||||
<Button
|
||||
as={Link}
|
||||
to={sectionPath("whatWeDo", locale)}
|
||||
prefetch="intent"
|
||||
size="lg"
|
||||
variant="secondary"
|
||||
>
|
||||
{t("actions.learnWhatWeDo")}
|
||||
</Button>
|
||||
</>
|
||||
)
|
||||
heroCtas.map((cta) => (
|
||||
<HeroCta key={`${cta.href}-${cta.label}`} {...cta} />
|
||||
))
|
||||
}
|
||||
/>
|
||||
|
||||
{/* FIGURES - never invented here. The draft fact sheet marks them TBD. */}
|
||||
<PageSection aria-labelledby="home-stats-heading" className="py-2xl md:py-3xl">
|
||||
<div className="flex flex-col gap-lg">
|
||||
<SectionHeader id="home-stats-heading" title={copy.statsHeading} />
|
||||
{stats.length > 0 ? (
|
||||
{/* FIGURES - 253:4835 is hidden in the frame and every figure in the
|
||||
draft is marked TBD, so the band exists only once the CMS has real
|
||||
numbers. Nothing is rendered in its place. */}
|
||||
{stats.length > 0 ? (
|
||||
<PageSection aria-labelledby="home-stats-heading">
|
||||
<div className="flex flex-col gap-3xl">
|
||||
<SectionHeader
|
||||
id="home-stats-heading"
|
||||
title={copy.statsHeading}
|
||||
size="display"
|
||||
/>
|
||||
<StatStrip stats={stats} />
|
||||
) : (
|
||||
<EmptyState message={copy.statsPending} />
|
||||
)}
|
||||
</div>
|
||||
</PageSection>
|
||||
|
||||
{/* THE LAUNCH STORY - approved copy, EN and AR. */}
|
||||
<PageSection aria-labelledby="home-launch-heading">
|
||||
<div className="flex flex-col gap-2xl">
|
||||
<SectionHeader
|
||||
id="home-launch-heading"
|
||||
title={copy.launchHeading}
|
||||
align="center"
|
||||
/>
|
||||
|
||||
<div className="mx-auto flex w-full max-w-[var(--layout-prose-max)] flex-col gap-md">
|
||||
{copy.launchParagraphs.map((paragraph) => (
|
||||
<p key={paragraph.slice(0, 32)} className="body-md text-[var(--text-secondary)]">
|
||||
{paragraph}
|
||||
</p>
|
||||
))}
|
||||
<p className="body-sm-bold text-[var(--text-accent)]">{copy.fundingNote}</p>
|
||||
</div>
|
||||
</PageSection>
|
||||
) : null}
|
||||
|
||||
{/* Figma prints these three captions under the photo strip with no
|
||||
heading of their own; the heading exists for the outline only. */}
|
||||
<h3 id="home-mechanisms-heading" className="sr-only">
|
||||
{copy.mechanismsHeading}
|
||||
</h3>
|
||||
|
||||
<ul
|
||||
aria-labelledby="home-mechanisms-heading"
|
||||
className="grid list-none grid-cols-1 gap-lg sm:grid-cols-2 lg:grid-cols-3"
|
||||
>
|
||||
{mechanisms.map((mechanism, index) => (
|
||||
<Card.Content
|
||||
key={mechanism.title}
|
||||
as="li"
|
||||
titleAs="h4"
|
||||
href={mechanism.href}
|
||||
title={mechanism.title}
|
||||
actionLabel={mechanism.actionLabel}
|
||||
{...(gallery[index]
|
||||
? {
|
||||
image: {
|
||||
src: gallery[index]!.src,
|
||||
alt: gallery[index]!.alt,
|
||||
},
|
||||
}
|
||||
: {})}
|
||||
{/* THE LAUNCH STORY - the band is `bleed` so the photo strip can run past
|
||||
the content column, and it clips what runs past the page. */}
|
||||
<PageSection
|
||||
aria-labelledby="home-launch-heading"
|
||||
bleed
|
||||
className="overflow-hidden"
|
||||
>
|
||||
<div className="flex flex-col gap-3xl">
|
||||
<Container>
|
||||
<div className="flex flex-col items-center gap-lg text-center">
|
||||
<SectionHeader
|
||||
id="home-launch-heading"
|
||||
title={copy.launchHeading}
|
||||
size="display"
|
||||
align="center"
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
{/* One paragraph with four bold runs, as the frame sets it. The
|
||||
designed 20px has no published type role, so it takes the
|
||||
nearest one, Body/Large - whose 28px leading is the frame's. */}
|
||||
<p className="body-lg text-[var(--text-primary)]">
|
||||
{copy.launchLead.map((run, index) =>
|
||||
typeof run === "string" ? (
|
||||
<span key={index}>{run}</span>
|
||||
) : (
|
||||
<strong key={index} className="body-lg-bold">
|
||||
{run.em}
|
||||
</strong>
|
||||
),
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</Container>
|
||||
|
||||
{gallery.length > 0 ? <LaunchStrip images={gallery} /> : null}
|
||||
|
||||
<Container>
|
||||
{/* Figma prints these three captions with no heading of their own;
|
||||
the heading exists for the outline and for screen readers. */}
|
||||
<h3 id="home-mechanisms-heading" className="sr-only">
|
||||
{copy.mechanismsHeading}
|
||||
</h3>
|
||||
|
||||
<ul
|
||||
aria-labelledby="home-mechanisms-heading"
|
||||
className="grid list-none grid-cols-1 gap-lg text-center sm:grid-cols-2 lg:grid-cols-3"
|
||||
>
|
||||
{copy.mechanisms.map((mechanism) => (
|
||||
<li
|
||||
key={mechanism}
|
||||
className="mx-auto max-w-[21.875rem] heading-h2 text-[var(--text-primary)]"
|
||||
>
|
||||
{mechanism}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Container>
|
||||
</div>
|
||||
</PageSection>
|
||||
|
||||
{/* PARTNERS */}
|
||||
<PageSection aria-labelledby="home-partners-heading">
|
||||
<div className="flex flex-col gap-2xl">
|
||||
<div className="flex flex-col gap-3xl">
|
||||
<SectionHeader
|
||||
id="home-partners-heading"
|
||||
title={partnersHeadline}
|
||||
align="center"
|
||||
size="display"
|
||||
/>
|
||||
|
||||
{partners.length > 0 ? (
|
||||
<ul className="grid list-none grid-cols-1 gap-lg sm:grid-cols-2 lg:grid-cols-3">
|
||||
<ul className="grid list-none grid-cols-1 gap-lg sm:grid-cols-2 lg:grid-cols-3 lg:gap-x-4xl">
|
||||
{partners.map((partner) => (
|
||||
/* The tile pads its inline start only, as the frame draws it,
|
||||
and sits on the sunken surface - darker than the page, which
|
||||
is the way round the design has it. */
|
||||
<li
|
||||
key={partner.id}
|
||||
className="flex items-center gap-md rounded-card border border-[var(--border-subtle)] bg-[var(--surface-raised)] p-md"
|
||||
className="flex min-h-[7.125rem] items-center gap-md rounded-control bg-[var(--surface-sunken)] ps-md py-sm"
|
||||
>
|
||||
{partner.logo ? (
|
||||
<img
|
||||
src={partner.logo.src}
|
||||
alt=""
|
||||
loading="lazy"
|
||||
className="size-12 shrink-0 rounded-control object-contain"
|
||||
className="size-[4.375rem] shrink-0 object-contain"
|
||||
/>
|
||||
) : null}
|
||||
|
||||
@@ -319,12 +421,12 @@ export default function Home({ loaderData }: Route.ComponentProps) {
|
||||
href={safeHref(partner.website)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="body-sm-bold text-[var(--text-primary)] underline-offset-2 hover:underline"
|
||||
className="body-lg-bold text-[var(--text-link)] underline underline-offset-2 hover:text-[var(--text-link-hover)]"
|
||||
>
|
||||
{partner.name}
|
||||
</a>
|
||||
) : (
|
||||
<span className="body-sm-bold text-[var(--text-primary)]">
|
||||
<span className="body-lg-bold text-[var(--text-primary)]">
|
||||
{partner.name}
|
||||
</span>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user