PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m3s
PR Checks / Backend Smoke (pull_request) Successful in 7s
PR Checks / Build Backend (no push) (pull_request) Successful in 13s
PR Checks / Build Frontend (no push) (pull_request) Successful in 44s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 10s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 4m29s
Implements the supplied brand guideline: the pin-and-leaf mark, the lowercase schoolcompare wordmark, Manrope for headings and Inter for everything a person reads a number from, the deep-teal/coral/mustard/sage palette, and the rounder geometry the guideline asks for. The landing hero is rebuilt to the concept: a Sand panel carrying the proposition, the search and a trust line, with the brand landscape bleeding to the panel's right edge, followed by the four value props. Concept vs reality — where the guideline describes something this product does not have, the real feature takes its place and the decision is recorded in a code comment next to it: - The Thriving Score is not implemented. Four of its five sub-scores (pastoral, enrichment, community, facilities) have no source in DfE or Ofsted data, and its band names are Ofsted's own, which would sit beside the real Ofsted grade and be indistinguishable from it. - Guides, About, Favourites and Sign in are not added to the nav — there are no such pages and no accounts system. Rankings and Admissions, which the guideline omits, keep their places because they exist. - The fourth value prop is "Never miss a deadline" rather than "Save & revisit", which would need shortlisting. Two deviations from the supplied swatches, both forced by contrast and both confined to text and fills. Coral #F97360 under a white label measures 2.75:1 against a 4.5 floor, so --action is a darkened #BE3C27 and the original coral survives as --coral for tints, borders and illustration. Mustard #F2C94C is 1.5:1 as text, so --mustard-ink carries labels while --mustard stays exact for fills and rings. Every token clears AA on all three light grounds; Sand is the binding one, so several values sit a step darker than white alone would need. The guideline is light-only, but the site already ships a dark theme, so it is rebuilt from the same tokens rather than dropped. Verified: tsc clean, 159/159 unit tests, production build green, and the generated share card and app icon render from the new mark. The hero and the site chrome were rendered from the compiled CSS and the prerendered markup to confirm Manrope and Inter actually resolve — a font token that silently falls back has shipped here before.
108 lines
3.7 KiB
TypeScript
108 lines
3.7 KiB
TypeScript
/**
|
||
* The schoolcompare mark.
|
||
*
|
||
* A location pin with a leaf growing inside it: where a school is, and a child
|
||
* growing there. The pin's tail sweeps left as the guideline's "signature path
|
||
* shape" — the journey a parent takes to find the right school — so the mark
|
||
* and the illustration style share one gesture.
|
||
*
|
||
* This is the single source for the mark. app/icon.svg, app/apple-icon.tsx and
|
||
* app/opengraph-image.tsx all derive from the same geometry (see MARK_PATHS),
|
||
* because the header and the favicon had previously drifted into two different
|
||
* logos.
|
||
*
|
||
* Drawn on a 48×48 grid. The pin takes the brand hue and the leaf is knocked
|
||
* out of it, so the mark needs exactly two colours and works on any ground.
|
||
*/
|
||
|
||
/** Geometry shared by every rendering of the mark, on a 0 0 48 48 viewBox. */
|
||
export const MARK_PATHS = {
|
||
/** The path tail, stroked — 8.5 wide with a round cap. */
|
||
tail: 'M17 30 C15 35.6 11.6 40.2 7.8 42.8',
|
||
/** The pin head. */
|
||
head: { cx: 26.5, cy: 18.5, r: 16.5 },
|
||
/** Leaf stem, stroked — 2.6 wide with a round cap. */
|
||
stem: 'M26.5 29.5 C26.5 25 26.6 21 27 18',
|
||
/** Upper leaf, filled. */
|
||
leafUpper: 'M27 19.6 C28.2 13.8 32.4 9.8 37.6 9.4 C38 15.6 33.8 20.8 27 19.6 Z',
|
||
/** Lower leaf, filled. */
|
||
leafLower: 'M26.4 24.6 C25.2 20 21.2 17 16.4 17.1 C16.2 21.8 19.8 25.8 26.4 24.6 Z',
|
||
} as const;
|
||
|
||
/**
|
||
* The mark as a standalone SVG string.
|
||
*
|
||
* Satori (next/og) renders `<img>` with a data URI far more reliably than it
|
||
* renders inline SVG children, so the generated icon and share card both draw
|
||
* the mark this way — from the same geometry as the React component above,
|
||
* which is the whole point of MARK_PATHS.
|
||
*/
|
||
export function markSvg(pin: string, leaf: string): string {
|
||
return [
|
||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none">',
|
||
`<path d="${MARK_PATHS.tail}" stroke="${pin}" stroke-width="8.5" stroke-linecap="round" fill="none"/>`,
|
||
`<circle cx="${MARK_PATHS.head.cx}" cy="${MARK_PATHS.head.cy}" r="${MARK_PATHS.head.r}" fill="${pin}"/>`,
|
||
`<path d="${MARK_PATHS.stem}" stroke="${leaf}" stroke-width="2.6" stroke-linecap="round" fill="none"/>`,
|
||
`<path d="${MARK_PATHS.leafUpper}" fill="${leaf}"/>`,
|
||
`<path d="${MARK_PATHS.leafLower}" fill="${leaf}"/>`,
|
||
'</svg>',
|
||
].join('');
|
||
}
|
||
|
||
/** The same string as a data URI, ready for `<img src>`. */
|
||
export function markDataUri(pin: string, leaf: string): string {
|
||
return `data:image/svg+xml;base64,${Buffer.from(markSvg(pin, leaf)).toString('base64')}`;
|
||
}
|
||
|
||
interface LogoMarkProps {
|
||
className?: string;
|
||
/** Rendered size in px. Defaults to inheriting via CSS. */
|
||
size?: number;
|
||
/** The pin. Defaults to the brand token so it inverts with the theme. */
|
||
pin?: string;
|
||
/** The leaf knocked out of the pin. */
|
||
leaf?: string;
|
||
title?: string;
|
||
}
|
||
|
||
export function LogoMark({
|
||
className,
|
||
size,
|
||
pin = 'var(--brand)',
|
||
leaf = 'var(--bg-card)',
|
||
title,
|
||
}: LogoMarkProps) {
|
||
return (
|
||
<svg
|
||
className={className}
|
||
width={size}
|
||
height={size}
|
||
viewBox="0 0 48 48"
|
||
fill="none"
|
||
xmlns="http://www.w3.org/2000/svg"
|
||
role={title ? 'img' : undefined}
|
||
aria-hidden={title ? undefined : true}
|
||
aria-label={title}
|
||
>
|
||
{title ? <title>{title}</title> : null}
|
||
<path
|
||
d={MARK_PATHS.tail}
|
||
stroke={pin}
|
||
strokeWidth={8.5}
|
||
strokeLinecap="round"
|
||
fill="none"
|
||
/>
|
||
<circle cx={MARK_PATHS.head.cx} cy={MARK_PATHS.head.cy} r={MARK_PATHS.head.r} fill={pin} />
|
||
<path
|
||
d={MARK_PATHS.stem}
|
||
stroke={leaf}
|
||
strokeWidth={2.6}
|
||
strokeLinecap="round"
|
||
fill="none"
|
||
/>
|
||
<path d={MARK_PATHS.leafUpper} fill={leaf} />
|
||
<path d={MARK_PATHS.leafLower} fill={leaf} />
|
||
</svg>
|
||
);
|
||
}
|