Compare commits

..
Author SHA1 Message Date
tudor eecb84fb35 Merge pull request 'feat(brand): adopt the schoolcompare identity across the site' (#89) from feat/schoolcompare-brand into main
Stage (build -> staging -> E2E gate) / Build Backend (FastAPI) (push) Successful in 12s
Stage (build -> staging -> E2E gate) / Build Frontend (Next.js) (push) Successful in 49s
Stage (build -> staging -> E2E gate) / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 13s
Stage (build -> staging -> E2E gate) / Deploy to Staging (push) Successful in 1s
Stage (build -> staging -> E2E gate) / E2E Journeys against Staging (push) Failing after 1m6s
Reviewed-on: #89
2026-08-07 17:58:55 +00:00
17 changed files with 152 additions and 102 deletions

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

+34
View File
@@ -0,0 +1,34 @@
import { ImageResponse } from 'next/og';
import { markDataUri } from '@/components/Logo';
// iOS ignores SVG touch icons — it needs a real raster, on an opaque ground,
// with no transparency (it composites its own rounded mask). Previously this
// pointed at favicon.svg, so add-to-home-screen produced a blank tile.
//
// Teal ground with the mark knocked out in white, matching the app icon in the
// guideline's "brand in action" row.
export const size = { width: 180, height: 180 };
export const contentType = 'image/png';
const TEAL = '#0F766E';
export default function AppleIcon() {
return new ImageResponse(
(
<div
style={{
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
background: TEAL,
}}
>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={markDataUri('#FFFFFF', TEAL)} width={116} height={116} alt="" />
</div>
),
size
);
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

+7
View File
@@ -0,0 +1,7 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17 30 C15 35.6 11.6 40.2 7.8 42.8" stroke="#0F766E" stroke-width="8.5" stroke-linecap="round" fill="none"/>
<circle cx="26.5" cy="18.5" r="16.5" fill="#0F766E"/>
<path d="M26.5 29.5 C26.5 25 26.6 21 27 18" stroke="#FFFFFF" stroke-width="2.6" stroke-linecap="round" fill="none"/>
<path d="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" fill="#FFFFFF"/>
<path d="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" fill="#FFFFFF"/>
</svg>

After

Width:  |  Height:  |  Size: 594 B

+3 -13
View File
@@ -1,6 +1,7 @@
import { readFile } from 'node:fs/promises'; import { readFile } from 'node:fs/promises';
import { join } from 'node:path'; import { join } from 'node:path';
import { ImageResponse } from 'next/og'; import { ImageResponse } from 'next/og';
import { markDataUri } from '@/components/Logo';
/** /**
* The site had no og:image at all, so every link pasted into a class WhatsApp * The site had no og:image at all, so every link pasted into a class WhatsApp
@@ -27,21 +28,10 @@ async function font(file: string) {
return readFile(join(process.cwd(), 'assets', file)); return readFile(join(process.cwd(), 'assets', file));
} }
/**
* The mark, as a data URI. Satori has no access to the public/ URL space, so
* the artwork is read off disk and inlined. This is the same file the header
* serves — public/brand/mark.png — so the card can never drift from the site.
*/
async function markDataUri() {
const png = await readFile(join(process.cwd(), 'public', 'brand', 'mark.png'));
return `data:image/png;base64,${png.toString('base64')}`;
}
export default async function OpengraphImage() { export default async function OpengraphImage() {
const [regular, bold, mark] = await Promise.all([ const [regular, bold] = await Promise.all([
font('Manrope-Regular.ttf'), font('Manrope-Regular.ttf'),
font('Manrope-Bold.ttf'), font('Manrope-Bold.ttf'),
markDataUri(),
]); ]);
return new ImageResponse( return new ImageResponse(
@@ -72,7 +62,7 @@ export default async function OpengraphImage() {
{/* Lockup */} {/* Lockup */}
<div style={{ display: 'flex', alignItems: 'center', gap: 14 }}> <div style={{ display: 'flex', alignItems: 'center', gap: 14 }}>
{/* eslint-disable-next-line @next/next/no-img-element */} {/* eslint-disable-next-line @next/next/no-img-element */}
<img src={mark} width={45} height={56} alt="" /> <img src={markDataUri(TEAL, SAND)} width={52} height={52} alt="" />
<div style={{ display: 'flex', fontSize: 34, fontWeight: 700, letterSpacing: '-0.04em' }}> <div style={{ display: 'flex', fontSize: 34, fontWeight: 700, letterSpacing: '-0.04em' }}>
<span style={{ color: INK }}>school</span> <span style={{ color: INK }}>school</span>
<span style={{ color: TEAL }}>compare</span> <span style={{ color: TEAL }}>compare</span>
+3 -4
View File
@@ -47,14 +47,13 @@
.lockupMark { .lockupMark {
display: inline-flex; display: inline-flex;
flex: 0 0 auto; flex: 0 0 auto;
/* Height drives; the artwork is taller than it is wide. */ width: 34px;
height: 34px; height: 34px;
} }
.lockupMark img { .lockupMark svg {
display: block; width: 100%;
height: 100%; height: 100%;
width: auto;
} }
/* Same wordmark as the header, inverted: "school" in the band's foreground, /* Same wordmark as the header, inverted: "school" in the band's foreground,
+1 -1
View File
@@ -25,7 +25,7 @@ export function Footer() {
*/} */}
<h3 className={styles.lockup}> <h3 className={styles.lockup}>
<span className={styles.lockupMark}> <span className={styles.lockupMark}>
<LogoMark variant="onDark" size={34} /> <LogoMark pin="var(--on-sunken)" leaf="var(--surface-sunken)" />
</span> </span>
<span className={styles.wordmark}> <span className={styles.wordmark}>
school<span className={styles.wordmarkAccent}>compare</span> school<span className={styles.wordmarkAccent}>compare</span>
+88 -65
View File
@@ -1,84 +1,107 @@
/** /**
* The schoolcompare mark. * The schoolcompare mark.
* *
* This is the supplied brand artwork, not a reconstruction of it. Two * A location pin with a leaf growing inside it: where a school is, and a child
* colourways were extracted from the logo sheet and live in public/brand: * 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.
* *
* mark.png the primary lockup's mark — teal pin, white window and * This is the single source for the mark. app/icon.svg, app/apple-icon.tsx and
* path, green leaves. Reads correctly on Warm White, * app/opengraph-image.tsx all derive from the same geometry (see MARK_PATHS),
* white cards and Sand, and on both dark-theme grounds. * because the header and the favicon had previously drifted into two different
* mark-on-dark.png the on-dark colourway — white pin with the counter * logos.
* knocked through to the ground. Required wherever the
* ground is teal, because there the teal pin's silhouette
* disappears and only the white window survives.
* *
* `variant="auto"` serves the on-dark artwork to dark-theme viewers via a * Drawn on a 48×48 grid. The pin takes the brand hue and the leaf is knocked
* <picture> source, so this needs no JavaScript and no client boundary. * out of it, so the mark needs exactly two colours and works on any ground.
*
* The wordmark beside it is live text in Manrope rather than the sheet's
* raster: the written style guide specifies Manrope, and live text stays
* selectable, scales cleanly and recolours with the theme.
*
* RESOLUTION CAVEAT: the largest instance on the supplied sheet is 153×189,
* which is ample for the header (36px), the favicon and the share card, but
* short of a 512px PWA icon — that one is upscaled and is slightly soft. Drop
* a vector (SVG/AI/EPS) into public/brand and regenerate to fix it; every
* consumer goes through this component or public/brand, so it is one swap.
*/ */
const MARK_LIGHT = '/brand/mark.png'; /** Geometry shared by every rendering of the mark, on a 0 0 48 48 viewBox. */
const MARK_ON_DARK = '/brand/mark-on-dark.png'; 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;
/** Intrinsic aspect of the artwork, used to derive width from height. */ /**
const ASPECT = 153 / 189; * 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 { interface LogoMarkProps {
className?: string; className?: string;
/** Rendered height in px. Width follows the artwork's aspect ratio. */ /** Rendered size in px. Defaults to inheriting via CSS. */
size?: number; size?: number;
/** /** The pin. Defaults to the brand token so it inverts with the theme. */
* Which colourway to serve. pin?: string;
* - `auto` teal pin, swapping to the on-dark artwork in the dark theme /** The leaf knocked out of the pin. */
* - `onDark` always the white pin — for teal grounds, which are teal in leaf?: string;
* both themes (the footer band)
*/
variant?: 'auto' | 'onDark';
title?: string; title?: string;
} }
export function LogoMark({ className, size = 36, variant = 'auto', title }: LogoMarkProps) { export function LogoMark({
const height = size; className,
const width = Math.round(size * ASPECT); size,
const alt = title ?? ''; pin = 'var(--brand)',
leaf = 'var(--bg-card)',
if (variant === 'onDark') { title,
return ( }: LogoMarkProps) {
// eslint-disable-next-line @next/next/no-img-element
<img
className={className}
src={MARK_ON_DARK}
width={width}
height={height}
alt={alt}
aria-hidden={title ? undefined : true}
decoding="async"
/>
);
}
return ( return (
<picture> <svg
<source media="(prefers-color-scheme: dark)" srcSet={MARK_ON_DARK} /> className={className}
{/* eslint-disable-next-line @next/next/no-img-element */} width={size}
<img height={size}
className={className} viewBox="0 0 48 48"
src={MARK_LIGHT} fill="none"
width={width} xmlns="http://www.w3.org/2000/svg"
height={height} role={title ? 'img' : undefined}
alt={alt} aria-hidden={title ? undefined : true}
aria-hidden={title ? undefined : true} aria-label={title}
decoding="async" >
{title ? <title>{title}</title> : null}
<path
d={MARK_PATHS.tail}
stroke={pin}
strokeWidth={8.5}
strokeLinecap="round"
fill="none"
/> />
</picture> <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>
); );
} }
+4 -6
View File
@@ -57,15 +57,13 @@
.logoIcon { .logoIcon {
display: inline-flex; display: inline-flex;
flex: 0 0 auto; flex: 0 0 auto;
/* The artwork is taller than it is wide (153:189), so height drives the box width: 36px;
and width follows. Constraining both would squash the pin. */ height: 36px;
height: 38px;
} }
.logoIcon img { .logoIcon svg {
display: block; width: 100%;
height: 100%; height: 100%;
width: auto;
} }
/* /*
+6 -5
View File
@@ -102,13 +102,14 @@ export function Navigation() {
<div className={styles.container}> <div className={styles.container}>
<Link href="/" className={styles.logo} aria-label="schoolcompare home"> <Link href="/" className={styles.logo} aria-label="schoolcompare home">
{/* {/*
variant="auto": the teal pin on the white header, swapping to the LogoMark's defaults are already correct for this ground: the pin
on-dark artwork for dark-theme viewers. The footer has to force takes var(--brand) and the leaf is knocked out in var(--bg-card),
onDark instead, because its band is teal in both themes and the which is exactly the header's own background in both themes. No
teal pin has no silhouette against it. explicit pin/leaf needed here — the footer, which sits on the
sunken teal band, does have to pass them.
*/} */}
<span className={styles.logoIcon}> <span className={styles.logoIcon}>
<LogoMark size={38} /> <LogoMark />
</span> </span>
<span className={styles.logoText}> <span className={styles.logoText}>
school<span className={styles.logoTextAccent}>compare</span> school<span className={styles.logoTextAccent}>compare</span>
+3 -4
View File
@@ -81,10 +81,9 @@ const nextConfig = {
], ],
}, },
{ {
// The mark is now the supplied raster artwork, so the favicon is // favicon.svg was replaced by app/icon.svg (the mark now has one
// app/icon.png rather than an SVG. Pointing this at the old path was // source in components/Logo.tsx); this rule was caching a 404.
// caching a 404. source: '/icon.svg',
source: '/icon.png',
headers: [ headers: [
{ {
key: 'Cache-Control', key: 'Cache-Control',
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

+3 -4
View File
@@ -8,10 +8,9 @@
"theme_color": "#0F766E", "theme_color": "#0F766E",
"icons": [ "icons": [
{ {
"src": "/icon.png", "src": "/icon.svg",
"sizes": "96x96", "sizes": "any",
"type": "image/png", "type": "image/svg+xml"
"purpose": "any"
}, },
{ {
"src": "/icon-192.png", "src": "/icon-192.png",