Files
school_compare/nextjs-app/components/SchoolHeroMap.module.css
T
TudorandClaude Opus 5 8ab0ac0a04
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m6s
PR Checks / Backend Smoke (pull_request) Successful in 7s
PR Checks / Build Backend (no push) (pull_request) Successful in 12s
PR Checks / Build Frontend (no push) (pull_request) Successful in 49s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 10s
PR Checks / AI Code Review (Claude) (pull_request) Failing after 3m13s
feat(design): adopt the Cohort identity — new palette, type, mark and dark theme
Implements the direction agreed from the identity board: Route C ("Cohort")
with the paper ground from C1, the Schibsted Grotesk / Literata pairing from
C2, and the iris accent from C3. Dark theme is in scope from the start rather
than retrofitted.

The audit found three things wrong beyond taste:

* No brand asset set. og:image was absent entirely, so every link shared into
  a class WhatsApp group rendered as a bare grey card. apple-touch-icon pointed
  at an SVG, which iOS ignores, and the manifest shipped no PNGs, so Android
  installs had no icon. The header mark and the favicon had also drifted into
  two different logos.
* No colour discipline. --primary and --trend-down were the same coral, so the
  main CTA and "below average" shared a hue. 58 distinct hex values were spread
  across component CSS, and the chart palette was still Chart.js's stock demo
  colours.
* A dark theme that was declared but never built — themeColor announced a dark
  variant with no dark styling behind it.

What changed:

Colour now has exactly three jobs that never borrow each other's hues: brand
(iris) for interactive and identity, status (teal/amber) for above/below a
comparison point, and phase for categories. Teal/amber rather than green/red
keeps the above/below signal readable for every form of colour blindness.
Every chromatic literal in component CSS is now a token, and the JS-painted
surfaces (Chart.js, Leaflet) read the tokens through lib/theme so they follow
the theme instead of ignoring it.

The mark is the five-bar cohort spread — the same object as the distribution
strip inside a school row, built from opacity steps so it inverts cleanly.
components/Logo.tsx is the single source; the favicon, apple-icon and share
card all derive from its geometry.

globals.css drops 123 dead global classes left over from the vanilla-JS app
(only the btn family, .skip-link and .main were still referenced), along with
the noise overlay. It also gains prefers-reduced-motion support, which was
missing entirely, and a type scale so the 54 ad-hoc font sizes have somewhere
to converge.

Verified: tsc clean, 159 unit tests pass, production build succeeds and
prerenders /icon.svg, /apple-icon and /opengraph-image. Three e2e journeys
added for the asset set, the themeColor/background match, and the dark theme
actually repainting — all silent failures that nothing on the page reveals.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 12:13:04 +01:00

145 lines
3.9 KiB
CSS

/* Preview band that blends into the hero title; expands to fullscreen.
isolation:isolate contains the map + fade + open-button z-indices (which
must beat Leaflet's internal panes) so they don't leak out and outrank the
header's Compare button. */
.wrapper {
position: relative;
width: 100%;
height: 210px;
background: var(--bg-secondary);
isolation: isolate;
}
@media (max-width: 640px) {
.wrapper {
height: 150px;
}
}
/* Preview: move the OSM attribution off the bottom edge, where the school
title slides up under the fade — top-left is the band's only quiet corner
(Compare floats top-right). Fullscreen keeps Leaflet's default bottom-right,
since the zoom control occupies the top-left there. */
.wrapper:not([data-fullscreen]) :global(.leaflet-bottom.leaflet-right) {
top: 0;
left: 0;
right: auto;
bottom: auto;
}
/* Fullscreen: the Fullscreen API promotes this element to fill the viewport. */
.wrapper[data-fullscreen] {
height: 100vh;
height: 100dvh;
background: #fff;
}
/* Fallback fullscreen (iOS Safari — no Element.requestFullscreen): the API
can't promote the element, so pin it over the page ourselves. Above the
comparison toast (3000) and everything else except modals (9999+). */
.wrapper[data-fs-fallback] {
position: fixed;
inset: 0;
z-index: 5000;
}
.skeleton {
width: 100%;
height: 100%;
background:
linear-gradient(100deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, .5) 50%, rgba(255, 255, 255, 0) 60%) var(--bg-secondary);
background-size: 200% 100%;
animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
to { background-position: -200% 0; }
}
/* Full-band click target. Transparent so the map shows through; reveals a
hint pill on hover/focus. Sits above the map but below the header's fade
and Compare button (which carry higher stacking in the header). */
.openBtn {
position: absolute;
inset: 0;
/* Above Leaflet's marker pane (600) so the whole band — pin included — is
one click target. Transparent, so map + pin still show through. */
z-index: 800;
width: 100%;
height: 100%;
padding: 0;
border: 0;
background: transparent;
cursor: pointer;
display: flex;
align-items: flex-end;
justify-content: center;
}
.openHint {
display: inline-flex;
align-items: center;
gap: 7px;
margin-bottom: 16px;
padding: 8px 14px;
border-radius: 999px;
font-size: 13px;
font-weight: 600;
color: var(--text-primary);
background: rgba(255, 255, 255, .85);
-webkit-backdrop-filter: blur(6px);
backdrop-filter: blur(6px);
box-shadow: 0 2px 10px rgba(var(--shadow-rgb), .16);
opacity: 0;
transform: translateY(4px);
transition: opacity .16s ease, transform .16s ease;
}
.openBtn:hover .openHint,
.openBtn:focus-visible .openHint {
opacity: 1;
transform: none;
}
/* Diffuse fade: map dissolves to the card background before the title. */
.fade {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 33%;
/* Above Leaflet's tile (200) and overlay (400) panes so the gradient is
actually visible, but below the marker pane (600) so the pin stays crisp
on top of the blend. */
z-index: 450;
pointer-events: none;
background: linear-gradient(to bottom,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, .35) 35%,
rgba(255, 255, 255, .75) 62%,
rgba(255, 255, 255, .95) 82%,
var(--bg-card) 100%);
}
.closeBtn {
position: absolute;
top: 0.75rem;
right: 0.75rem;
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border: none;
border-radius: 8px;
background: rgba(255, 255, 255, .92);
color: var(--text-primary);
cursor: pointer;
box-shadow: 0 2px 10px rgba(var(--shadow-rgb), .2);
}
.closeBtn:hover {
background: #fff;
}