From 906a1526689282dd403621c36ac07b3f118713e0 Mon Sep 17 00:00:00 2001 From: chuma-beep Date: Wed, 25 Nov 2026 17:33:01 +0100 Subject: [PATCH 1/3] feat: rebuild the landing page around one real session The homepage explained the engine before it showed any learning. The hero now states the promise, "Don't just finish mathematics. Understand it.", and its primary action opens a start panel rather than navigating, so the click can offer Google One Tap and still always show the guest path. Below it, a short interactive arithmetic card demonstrates a session with local checking, real feedback and a mastery bar, then the four stages, the three featured figures, the adaptive rules in plain language, a browsable domain grid, the open-source credit and a closing call to start. The pipeline state names, ranking ladder and both formulas leave the landing page; /how-it-works and /leaderboard already explain them. --- web/next-app/app/home/sections.tsx | 674 ++++++++++++---------- web/next-app/app/page.tsx | 51 +- web/next-app/test/homeGetStarted.test.tsx | 46 -- web/next-app/test/landingHero.test.tsx | 28 +- 4 files changed, 426 insertions(+), 373 deletions(-) delete mode 100644 web/next-app/test/homeGetStarted.test.tsx diff --git a/web/next-app/app/home/sections.tsx b/web/next-app/app/home/sections.tsx index 85931f21e..73840ff9e 100644 --- a/web/next-app/app/home/sections.tsx +++ b/web/next-app/app/home/sections.tsx @@ -2,329 +2,456 @@ import Link from 'next/link' import { useEffect, useRef, useState } from 'react' +import { useRouter } from 'next/navigation' import { LOGIN_HERO } from '../../lib/loginHero' -import { - PIPELINE_STATES, - conceptCount, - domainCounts, - domainLabels, - domainOrder, - levels, -} from './data' +import { FEATURED_FIGURES } from '../../lib/featuredFigures' +import VisualFigure from '../../components/visual/VisualFigure' +import { API_BASE, getConfig, googleOneTap } from '../../lib/api' +import { establishSession } from '../../lib/auth' +import { conceptCount, domainCounts, domainLabels, domainOrder } from './data' + +// The homepage keeps the drawing and the type of the rest of the app. The +// landing page is the one place with a painting, so the buttons on it carry a +// white hairline and every other control keeps the themed border. -// The two hero actions. They are written out in full rather than composed, because -// the ghost button used to be the primary button plus overrides and the two -// background utilities (`bg-mathua-blue` and `bg-transparent`, `hover:bg-mathua-blue-hover` -// and `hover:bg-white/15`) collided: same property, same specificity, so the winner was -// whichever Tailwind emitted last and the GitHub button hovered to blue on the image. -// Separate constants with no overlapping property cannot collide. Both actions are -// content-width and left-aligned on phones: as full-width bars with only the page's -// 16px gutters they read as touching the screen edges. const CTA_PRIMARY = 'inline-flex min-h-[44px] items-center justify-center bg-mathua-blue px-6 py-3 text-sm font-medium text-white transition-colors hover:bg-mathua-blue-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-mathua-blue' -// On the artwork the second action is a white hairline over a dark scrim, not the -// themed surface border: a `mathua-border` line is tuned for the page background, -// not for a photograph, and would disappear against the drawing. -// Wipe-fill ghost: on hover a blue layer sweeps left to right behind the label -// (origin-left scale-x). The fill lives on a child span, not the anchor, so the -// anchor never carries two background utilities at once, the collision that once -// turned this button blue. `overflow-hidden` clips the sweep; the label sits -// `relative` above it. + const CTA_GHOST_ON_ART = - 'group relative inline-flex min-h-[44px] items-center justify-center overflow-hidden border border-white/45 bg-transparent px-6 py-3 text-sm font-medium text-white transition-colors hover:border-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white' + 'group relative inline-flex min-h-[44px] items-center justify-center overflow-hidden border border-white/45 bg-transparent px-6 py-3 text-sm font-medium text-white transition-colors hover:border-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white lg:border-mathua-border lg:text-mathua-primary lg:hover:border-mathua-blue lg:focus-visible:outline-mathua-blue' + +function GhostLabel({ children }: { children: React.ReactNode }) { + return ( + <> +