diff --git a/web/next-app/app/home/sections.tsx b/web/next-app/app/home/sections.tsx index 85931f21e..4d8cf7290 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 ( + <> +