diff --git a/public/images/home/why-fill-palm.webp b/public/images/home/why-fill-palm.webp new file mode 100644 index 000000000..53ee5b105 Binary files /dev/null and b/public/images/home/why-fill-palm.webp differ diff --git a/public/images/home/why-fill-sand.webp b/public/images/home/why-fill-sand.webp new file mode 100644 index 000000000..f220afc34 Binary files /dev/null and b/public/images/home/why-fill-sand.webp differ diff --git a/public/images/home/why-fill-sun.webp b/public/images/home/why-fill-sun.webp new file mode 100644 index 000000000..0c21de859 Binary files /dev/null and b/public/images/home/why-fill-sun.webp differ diff --git a/public/images/home/why-fill-water.webp b/public/images/home/why-fill-water.webp new file mode 100644 index 000000000..0cc947768 Binary files /dev/null and b/public/images/home/why-fill-water.webp differ diff --git a/src/blog/introducing-tanstack-oracles.md b/src/blog/introducing-tanstack-oracles.md index 8535d55a3..e16a48d5e 100644 --- a/src/blog/introducing-tanstack-oracles.md +++ b/src/blog/introducing-tanstack-oracles.md @@ -101,13 +101,13 @@ The model keeps task records in a plain JavaScript `Map`. After applying each ba ```ts function expectedTopTasks(tasks: Iterable) { return [...tasks] - .filter(task => !task.completed) - .sort((a, b) => - b.priority - a.priority || - (a.id < b.id ? -1 : a.id > b.id ? 1 : 0) + .filter((task) => !task.completed) + .sort( + (a, b) => + b.priority - a.priority || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0), ) .slice(0, 10) - .map(task => task.id) + .map((task) => task.id) } ``` @@ -138,7 +138,7 @@ Neither is automatically authoritative. The law records the behavior I've decide When they disagree, that difference gives the agent a precise clue about what to investigate. It can replay the history, trace how each side arrived at its answer, and work out what needs to change to reconcile them with the law. If the law itself doesn't settle the question, the agent asks me to make the design decision. -In Oracles, a sequence of actions like this is called a *history*. A **driver** executes those actions against production and records what happens. A **check** compares the observations with the answers calculated by the model. +In Oracles, a sequence of actions like this is called a _history_. A **driver** executes those actions against production and records what happens. A **check** compares the observations with the answers calculated by the model. The framework brings these pieces together through `oracleProperty`: @@ -211,7 +211,7 @@ Constructed histories capture that judgment. I want Oracles to guide agents thro For that I can add a **calibration**. Take an existing passing history where two equal-priority tasks both fit in the result, so the model expects `[A, B]`. I tell Oracles to feed the checker `[B, A]` instead. -That deliberately wrong observation is called a *corruption*. I'm not changing production code. I'm checking whether the oracle would recognize this particular mistake. +That deliberately wrong observation is called a _corruption_. I'm not changing production code. I'm checking whether the oracle would recognize this particular mistake. Oracles handles the execution: it runs the original history, substitutes the wrong answer, and requires the ordering law to reject it. If the change doesn't take effect, the wrong law fires, or the test crashes for an unrelated reason, the calibration fails. diff --git a/src/components/ApplicationStarter.tsx b/src/components/ApplicationStarter.tsx index 29a2032a8..47765bc53 100644 --- a/src/components/ApplicationStarter.tsx +++ b/src/components/ApplicationStarter.tsx @@ -144,6 +144,11 @@ function buildCursorStartUrl(prompt: string) { return `cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(prompt)}` } +// The home prompt box: an outline with no fill. Hover firms the line, press +// sinks the fill, and focus holds a soft, warmer line with a faint fill. +const homePromptBoxClassName = + 'corner-squircle relative overflow-visible rounded-2xl border border-border-default bg-transparent transition-[background-color,border-color,transform] duration-150 ease-out not-focus-within:hover:border-border-strong/35 hover:bg-background-surface/40 active:scale-[0.997] active:bg-background-surface/80 focus-within:border-border-strong/60 focus-within:bg-background-surface/40 motion-reduce:transition-none' + export function ApplicationStarter({ applicationStarterIntegration, className, @@ -967,45 +972,16 @@ export function ApplicationStarter({

) : null}
- {/* Home: a warm terracotta glow that grows in from behind the card - while the prompt is focused, drifting in a slow wave. Sits at - -z-10 so the opaque card hides all but the bottom bleed. */} - {isHomeStarter ? ( -
-
-
- ) : null}
@@ -1145,7 +1121,7 @@ export function ApplicationStarter({ onComplete={completeHomePayoff} /> ) : !hasInput ? ( - + Press Shift + Enter ) : ( diff --git a/src/components/MaintainerCard.tsx b/src/components/MaintainerCard.tsx index dae903454..b99050488 100644 --- a/src/components/MaintainerCard.tsx +++ b/src/components/MaintainerCard.tsx @@ -211,7 +211,7 @@ function MaintainerSocialLinks({ onClick={(e) => e.stopPropagation()} className={ variant === 'card' - ? 'inline-flex size-4 items-center justify-center text-icon-muted transition-colors duration-200 hover:text-icon-default focus-visible:rounded-sm focus-visible:corner-squircle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus motion-reduce:transition-none [&_svg]:size-4' + ? "relative inline-flex size-4 items-center justify-center text-icon-muted after:absolute after:-inset-x-2 after:-inset-y-3.5 after:content-[''] transition-colors duration-200 hover:text-icon-default focus-visible:rounded-sm focus-visible:corner-squircle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus motion-reduce:transition-none [&_svg]:size-4" : 'p-2 -mb-2 -ml-2 transition-colors hover:scale-110 hover:text-gray-700 hover:grayscale-0 dark:hover:text-gray-200' } > diff --git a/src/components/NewsletterSignup.tsx b/src/components/NewsletterSignup.tsx index 26fd70b83..d034935ae 100644 --- a/src/components/NewsletterSignup.tsx +++ b/src/components/NewsletterSignup.tsx @@ -6,6 +6,7 @@ import { useToast } from '~/components/ToastProvider' import { useLoginModal } from '~/contexts/LoginModalContext' import { currentUserQueryOptions, useCurrentUser } from '~/hooks/useCurrentUser' import { Button } from '~/ui' +import { Button as DsButton } from '~/components/ds/ui' import { addUserSignupSource } from '~/utils/users.functions' type NewsletterSignupProps = { @@ -14,6 +15,11 @@ type NewsletterSignupProps = { noteClassName?: string successClassName?: string showNote?: boolean + /** Overrides the button label in both the logged-in and logged-out states. */ + label?: string + showIcon?: boolean + /** `ds` renders the design-system Button; `legacy` keeps the docs-era one. */ + appearance?: 'legacy' | 'ds' } export function NewsletterSignup({ @@ -22,6 +28,9 @@ export function NewsletterSignup({ noteClassName, successClassName, showNote = true, + label, + showIcon = true, + appearance = 'legacy', }: NewsletterSignupProps) { const user = useCurrentUser() const queryClient = useQueryClient() @@ -86,25 +95,26 @@ export function NewsletterSignup({ ) } + const ButtonComponent = appearance === 'ds' ? DsButton : Button + return (
- + : (label ?? + (user ? 'Subscribe with my login' : 'Log in to subscribe'))} + {showNote ? (

- + {label}

@@ -65,26 +65,26 @@ const tierLayout: Record< } > = { gold: { - flexBasis: 'basis-full sm:basis-1/2', - minHeight: 'min-h-[240px]', - logoMaxWidth: 'max-w-[420px]', - logoMaxHeight: 'max-h-[130px]', - padding: 'p-12', + flexBasis: 'basis-1/2 lg:basis-1/3', + minHeight: 'min-h-[144px]', + logoMaxWidth: 'max-w-[240px]', + logoMaxHeight: 'max-h-[72px]', + padding: 'p-6 sm:p-8', }, silver: { - flexBasis: 'basis-full sm:basis-1/2 lg:basis-1/3', - minHeight: 'min-h-[140px]', - logoMaxWidth: 'max-w-[200px]', - logoMaxHeight: 'max-h-[60px]', - padding: 'p-8', - }, - bronze: { flexBasis: 'basis-1/2 sm:basis-1/3 lg:basis-1/4', - minHeight: 'min-h-[120px]', - logoMaxWidth: 'max-w-[130px]', + minHeight: 'min-h-[104px]', + logoMaxWidth: 'max-w-[150px]', logoMaxHeight: 'max-h-[44px]', padding: 'p-6', }, + bronze: { + flexBasis: 'basis-1/3 sm:basis-1/4 lg:basis-1/5', + minHeight: 'min-h-[88px]', + logoMaxWidth: 'max-w-[110px]', + logoMaxHeight: 'max-h-[32px]', + padding: 'p-4', + }, } function PartnerGridItem({ diff --git a/src/components/PartnersPyramid.tsx b/src/components/PartnersPyramid.tsx new file mode 100644 index 000000000..d7b952b8b --- /dev/null +++ b/src/components/PartnersPyramid.tsx @@ -0,0 +1,258 @@ +import * as React from 'react' +import { + PartnerImage, + getPartnerHref, + partnerTierLabels, + partners as allPartners, + type PartnerTier, +} from '~/utils/partners' +import { + getPartnerPlacementAnalyticsMetadata, + getPartnerTierGroupsForPlacement, + type PartnerPlacementContext, +} from '~/utils/partner-placement' +import { usePartnerPlacementContext } from '~/utils/usePartnerPlacementContext' +import { + trackEvent, + useTrackedImpression, + type PartnerPlacement, +} from '~/utils/analytics' + +// Centered and borderless: whitespace and logo scale alone carry the hierarchy. +// Each tier is introduced by a hairline with its name set in it, which doubles +// as the section's heading — there is no separate "Partners" title. + +type Partner = (typeof allPartners)[number] + +export const partnerRuleHeadingClassName = + 'font-ds-mono text-ds-mono-xs uppercase tracking-wider text-text-muted' + +// Equal visual weight: every logo in a tier is drawn at the same *area*, not +// fitted into the same box. A box makes a wide wordmark tiny and a compact mark +// huge; a fixed area gives the wide one more width and the compact one more +// height, so they read as the same size. Each tier steps down by 0.75 linear +// (0.5625 area), matching the DS partner-logo rubric. +const tierArea: Record = { + gold: 12000, + silver: 6750, + bronze: 3800, +} + +// Tallest a logo may get, so a near-square mark can't outgrow its row. +const tierMaxHeight: Record = { + gold: 70, + silver: 54, + bronze: 40, +} + +const FALLBACK_ASPECT = 4 + +// Equal area assumes the artwork fills its own frame. These logos don't — the +// file carries decoration or padding around the wordmark — so they need a +// linear boost to read at the same weight as their neighbours. +const opticalBoost: Partial> = { + netlify: 1.3, +} + +function AreaLogo({ + id, + image, + name, + tier, +}: { + id: string + image: Partner['image'] + name: string + tier: PartnerTier +}) { + const ref = React.useRef(null) + // The logo's own width/height ratio, read from the loaded image. + const [aspect, setAspect] = React.useState(FALLBACK_ASPECT) + + React.useEffect(() => { + const element = ref.current + if (!element) return + const images = Array.from(element.querySelectorAll('img')) + const read = () => { + const loaded = images.find( + (img) => img.naturalWidth > 0 && img.naturalHeight > 0, + ) + if (loaded) setAspect(loaded.naturalWidth / loaded.naturalHeight) + } + read() + images.forEach((img) => img.addEventListener('load', read)) + return () => images.forEach((img) => img.removeEventListener('load', read)) + }, []) + + const height = + Math.min(Math.sqrt(tierArea[tier] / aspect), tierMaxHeight[tier]) * + (opticalBoost[id] ?? 1) + + return ( + // `max-w-full` is a guard for unusually wide wordmarks; the image keeps + // its ratio, so only the size changes. The per-logo optical `scale` is + // dropped: it was tuned for box-fitting. +
+ +
+ ) +} + +// Logos are sized for the widest layout and scaled down as one group through +// `--logo-scale`, so every logo shrinks by the same factor and the tiers keep +// their relative weight. Each step is the largest scale at which the widest +// gold wordmark still fits its cell at that breakpoint's column count. +const logoScaleClassName = + '[--logo-scale:0.55] sm:[--logo-scale:0.65] md:[--logo-scale:0.78] lg:[--logo-scale:0.8] xl:[--logo-scale:1]' + +// `min-w-0` lets a cell be narrower than its logo's preferred width; without it +// the flex row drops to fewer columns instead of shrinking the logo. +const tierItem: Record = { + gold: 'min-w-0 h-[calc(110px*var(--logo-scale))] basis-1/2 sm:basis-1/3 lg:basis-1/4', + silver: + 'min-w-0 h-[calc(92px*var(--logo-scale))] basis-1/2 sm:basis-1/3 xl:basis-1/5', + bronze: + 'min-w-0 h-[calc(74px*var(--logo-scale))] basis-1/2 sm:basis-1/4 xl:basis-1/6', +} + +/** A hairline rule with a heading set in the middle of it. */ +export function PartnerRuleHeading({ + children, +}: { + children: React.ReactNode +}) { + return ( +
+ +

{children}

+ +
+ ) +} + +export function PartnersPyramid({ + analyticsPlacement, +}: { + analyticsPlacement: PartnerPlacement +}) { + const placementContext = usePartnerPlacementContext({ + orderStrategy: 'tier-rotated', + surface: analyticsPlacement, + }) + + const groups = getPartnerTierGroupsForPlacement( + allPartners.filter((partner) => partner.status === 'active'), + placementContext, + ) + + // Running slot index across tiers, matching what PartnersGrid reports. + let slotIndex = 0 + const tiers = groups.map((group) => ({ + tier: group.tier, + partners: group.partners.map((partner) => ({ + partner, + index: slotIndex++, + })), + })) + + return ( +
+ {tiers.map((row) => ( +
+ {/* Same gap above the logos as `space-y-12` leaves below them. */} +
+ + {partnerTierLabels[row.tier]} Partners + +
+
    + {row.partners.map(({ partner, index }) => ( +
  • + + + +
  • + ))} +
+
+ ))} +
+ ) +} + +function PartnerPyramidLink({ + analyticsPlacement, + placementContext, + partner, + index, + children, +}: { + analyticsPlacement: PartnerPlacement + placementContext: PartnerPlacementContext + partner: Partner + index: number + children: React.ReactNode +}) { + const analyticsMetadata = getPartnerPlacementAnalyticsMetadata( + partner, + placementContext, + ) + const ref = useTrackedImpression<'partner_viewed', HTMLAnchorElement>({ + event: 'partner_viewed', + props: { + partner_id: partner.id, + ...analyticsMetadata, + placement: analyticsPlacement, + slot_index: index, + }, + }) + const href = getPartnerHref(partner, analyticsPlacement) + + return ( + { + let destinationHost: string | undefined + try { + destinationHost = new URL(href).host + } catch { + // Bad/relative href — track without host rather than dropping. + } + trackEvent('partner_clicked', { + partner_id: partner.id, + placement: analyticsPlacement, + destination: 'external', + destination_host: destinationHost, + ...analyticsMetadata, + slot_index: index, + }) + }} + > + {children} + + ) +} diff --git a/src/components/PartnersSponsorsSection.tsx b/src/components/PartnersSponsorsSection.tsx index 4f0efeb7c..18502285d 100644 --- a/src/components/PartnersSponsorsSection.tsx +++ b/src/components/PartnersSponsorsSection.tsx @@ -1,10 +1,15 @@ import { Link } from '@tanstack/react-router' +import { useQuery } from '@tanstack/react-query' import { Hydrate } from '@tanstack/react-start' import { visible } from '@tanstack/react-start/hydration' import { ArrowRightIcon } from '@phosphor-icons/react/ArrowRight' import { Button } from '~/components/ds/ui' import { OssSponsorsWithQuery } from '~/components/OssSponsorsSection' -import { PartnersGrid, TierBand } from '~/components/PartnersGrid' +import { getOssSponsors } from '~/utils/sponsors.functions' +import { + PartnerRuleHeading, + PartnersPyramid, +} from '~/components/PartnersPyramid' import type { PartnerPlacement } from '~/utils/analytics' type PartnersSponsorsContentProps = { @@ -18,20 +23,31 @@ type PartnersSponsorsSectionProps = { } function OssSponsorsBand() { + // Same query OssSponsorsWithQuery runs (deduped by key). With no sponsors to + // draw, skip the fixed-height canvas so the band doesn't hold empty space. + const { data: sponsors } = useQuery({ + queryKey: ['sponsors'], + queryFn: () => getOssSponsors(), + staleTime: 5 * 60 * 1000, + }) + const hasNoSponsors = sponsors?.length === 0 + return (
- + OSS Sponsors
-
- -
-

- Sponsors get special perks like{' '} - - private discord channels, priority issue requests, and direct - support - - ! + {hasNoSponsors ? null : ( +

+ +
+ )} +

+ + Learn more about partnerships. +

- -
+
+ {/* Hero — Figma node 802:2027. Full-bleed palm and sky: + headline bottom-left, description + CTA bottom-right. The sky is + always light, so text uses a mode-stable dark token (neutral-500) + rather than a theme-flipping semantic. */} +
+ {/* The small viewport height keeps the hero stable as mobile browser chrome collapses. */} +
+ +

+ The{' '} + + open source + +
application stack +
for the web +

+
+

+ Headless, type-safe, composable tools for building modern web + applications that work naturally for developers and reliably for + agents +

+ {/* The sky is always light, so scope the CTAs to the DS + light mode — the Buttons then render as their standard DS + light-mode selves (no per-button color overrides). */} +
+ +
-
- -
-
- +
+
+
+ +
- - -
+ +
@@ -172,14 +160,90 @@ function Index() { type PrincipleProof = 'adapters' | 'types' | 'adoption' | 'portable' type WhyTanStackPrinciple = { + phrase: string title: string body: string - Icon: Icon - accentClassName: string - iconClassName: string + // Literal classes so Tailwind emits them. + // The phrase's resting color, reused for its detail heading. + colorClassName: string + // The filled block with black type, shown on hover or while open. + fillClassName: string + // Photo printed into the fill while the phrase is hovered or open. + pattern: FillPattern proof: PrincipleProof } +type FillPattern = Pick< + React.CSSProperties, + | 'backgroundImage' + | 'backgroundSize' + | 'backgroundPosition' + | 'backgroundBlendMode' +> + +/** + * A grayscale photo blended into a phrase's filled block, so it reads as a + * one-color print in the phrase's own color. + * + * `screen` (the default) can only lighten the fill, so the black type is never + * less readable than on the flat color. `multiply` is for fills already too + * pale for a lighter print to show; its image must be high-key (no dark tones). + */ +function photoFill( + src: string, + blend: 'screen' | 'multiply' = 'screen', +): FillPattern { + return { + backgroundImage: `url(${src})`, + backgroundSize: 'cover', + backgroundPosition: 'center', + backgroundBlendMode: blend, + } +} + +const whyTanStackPrinciples = [ + { + phrase: 'framework agnostic', + title: 'One core, every framework.', + body: 'The logic lives in a framework-free core. Thin adapters bring it to React, Vue, Solid, Svelte, Angular, or plain JavaScript, so switching frameworks does not mean relearning your tools.', + fillClassName: + 'bg-ds-blue-400 text-black dark:bg-ds-blue-300 dark:text-black', + pattern: photoFill('/images/home/why-fill-water.webp'), + colorClassName: 'text-[#288dad] dark:text-ds-blue-300', + proof: 'adapters', + }, + { + phrase: 'type-safe', + title: 'Types that follow your data.', + body: 'Written in TypeScript from the first line. Route params, query results, and form fields arrive already typed, so your editor catches the mistake before you run the code.', + fillClassName: + 'bg-ds-green-400 text-black dark:bg-ds-green-300 dark:text-black', + pattern: photoFill('/images/home/why-fill-palm.webp'), + colorClassName: 'text-[#279633] dark:text-ds-green-300', + proof: 'types', + }, + { + phrase: 'production-grade', + title: 'Built for real workloads.', + body: 'Caching, concurrency, and keeping state in sync are the hard parts of an app. The libraries handle them for you, so growing does not force a rewrite.', + fillClassName: + 'bg-ds-terracotta-400 text-black dark:bg-ds-terracotta-300 dark:text-black', + pattern: photoFill('/images/home/why-fill-sun.webp'), + colorClassName: 'text-ds-terracotta-400 dark:text-ds-terracotta-300', + proof: 'adoption', + }, + { + phrase: 'yours to keep', + title: 'Yours to keep.', + body: 'Open source and independent. No cloud provider or framework team sets the roadmap, and you can host what you build anywhere.', + fillClassName: + 'bg-ds-amber-400 text-black dark:bg-ds-amber-300 dark:text-black', + pattern: photoFill('/images/home/why-fill-sand.webp', 'multiply'), + colorClassName: 'text-[#cf7c00] dark:text-ds-amber-300', + proof: 'portable', + }, +] satisfies ReadonlyArray + type AdapterGraphNode = { height: number label: string @@ -199,49 +263,6 @@ type AdapterGraphCurve = { path: string } -// Accent hues come from the DS palette (--color-ds-*), not the library -// `category-*` tokens: these are product principles, not library categories. -// Figma specifies near-neighbours of these values (e.g. #d3481b vs the DS -// terracotta-400 #c3502b); the DS token wins per the design-system-first rule. -const whyTanStackPrinciples = [ - { - title: 'Framework Agnostic', - body: 'Our library cores are provider-agnostic and logic-driven, meaning you can use the same logic in React, Vue, Svelte, Solid, and more.', - Icon: StackIcon, - accentClassName: 'from-blue-500 to-cyan-500', - iconClassName: - 'border-cyan-200 bg-cyan-50 text-cyan-700 dark:border-cyan-900 dark:bg-cyan-950/40 dark:text-cyan-300', - proof: 'adapters', - }, - { - title: 'Type-Safe by Design', - body: 'Built with TypeScript from the ground up, providing incredible autocomplete and safety across your entire data-fetching and state management stack.', - Icon: CodeIcon, - accentClassName: 'from-emerald-500 to-teal-500', - iconClassName: - 'border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-300', - proof: 'types', - }, - { - title: 'Production-Grade', - body: "Battle-tested in the world's largest apps. We build for scale, handling complex concurrency, caching, and state synchronization with ease.", - Icon: LightningIcon, - accentClassName: 'from-orange-500 to-red-500', - iconClassName: - 'border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-900 dark:bg-orange-950/40 dark:text-orange-300', - proof: 'adoption', - }, - { - title: 'No Vendor Lock-in', - body: "Open source and independent. We aren't beholden to any single cloud provider or framework team, ensuring the best tools for the community.", - Icon: ShieldIcon, - accentClassName: 'from-purple-500 to-pink-500', - iconClassName: - 'border-purple-200 bg-purple-50 text-purple-700 dark:border-purple-900 dark:bg-purple-950/40 dark:text-purple-300', - proof: 'portable', - }, -] satisfies ReadonlyArray - const adapterGraphWidth = 320 const adapterGraphHeight = 128 @@ -266,14 +287,7 @@ const frameworkAdapterConnections = frameworkAdapterNodes.map((node) => { const end = edgeAnchor(node, frameworkAdapterCore) const curve = curveBetween(start, end, 0.5) - return { - control1: curve.control1, - control2: curve.control2, - end, - label: node.label, - path: curve.path, - start, - } + return { label: node.label, path: curve.path } }) function centerPoint(node: AdapterGraphNode): AdapterGraphPoint { @@ -345,180 +359,145 @@ function adapterGraphStyle(node: AdapterGraphNode): React.CSSProperties { } } -function adapterGraphPointStyle(point: AdapterGraphPoint): React.CSSProperties { - return { - left: `${(point.x / adapterGraphWidth) * 100}%`, - top: `${(point.y / adapterGraphHeight) * 100}%`, - } -} - -function cubicPoint( - start: AdapterGraphPoint, - control1: AdapterGraphPoint, - control2: AdapterGraphPoint, - end: AdapterGraphPoint, - progress: number, -): AdapterGraphPoint { - const inverse = 1 - progress - - return { - x: - inverse ** 3 * start.x + - 3 * inverse ** 2 * progress * control1.x + - 3 * inverse * progress ** 2 * control2.x + - progress ** 3 * end.x, - y: - inverse ** 3 * start.y + - 3 * inverse ** 2 * progress * control1.y + - 3 * inverse * progress ** 2 * control2.y + - progress ** 3 * end.y, - } -} - -function cubicAngle( - start: AdapterGraphPoint, - control1: AdapterGraphPoint, - control2: AdapterGraphPoint, - end: AdapterGraphPoint, - progress: number, -): number { - const inverse = 1 - progress - const deltaX = - 3 * inverse ** 2 * (control1.x - start.x) + - 6 * inverse * progress * (control2.x - control1.x) + - 3 * progress ** 2 * (end.x - control2.x) - const deltaY = - 3 * inverse ** 2 * (control1.y - start.y) + - 6 * inverse * progress * (control2.y - control1.y) + - 3 * progress ** 2 * (end.y - control2.y) - - return (Math.atan2(deltaY, deltaX) * 180) / Math.PI -} - /** - * The "Why TanStack?" principles stack — Figma 478:1734. - * - * On desktop, the stack is 960px wide. Each card has 233px of content with - * 24px of padding above and below and a 70px gap between the two columns. + * "Why TanStack?" as one sentence. Each claim in the sentence is a control: + * hovering tints it, selecting it opens that principle's explanation and proof + * underneath. Nothing but the sentence shows until the reader asks. */ function WhyTanStackSection() { + // `shown` keeps the last principle mounted while the panel collapses. + const [isOpen, setIsOpen] = React.useState(false) + const [shown, setShown] = React.useState(0) + // Only one block is ever filled: the phrase under the pointer, or failing + // that the open one. Hovering another phrase takes the fill from the open one. + const [hovered, setHovered] = React.useState(null) + // Leaving a phrase clears the hover a beat late. Crossing the gap to the next + // phrase would otherwise report "nothing hovered" for a frame or two, and the + // open phrase's fill would flash on and off in between. + const clearHoverTimer = React.useRef(undefined) + const hoverPhrase = (index: number) => { + window.clearTimeout(clearHoverTimer.current) + setHovered(index) + } + const leavePhrase = () => { + window.clearTimeout(clearHoverTimer.current) + clearHoverTimer.current = window.setTimeout(() => setHovered(null), 120) + } + React.useEffect(() => () => window.clearTimeout(clearHoverTimer.current), []) + const principle = whyTanStackPrinciples[shown] + return ( -
-
-

- Why TanStack? -

- - {/* features-stack — 478:1742 */} -
    - {whyTanStackPrinciples.map((principle, index) => ( -
  1. - {/* copy column — 478:1745. Everything is left-aligned to the - card edge; at desktop sizes the title and description stay - grouped at the center of the 233px proof panel. */} -
    -

    - {principle.title} -

    -

    - {principle.body} -

    -
    +
    + Why TanStack? + {/* From `sm` up the sentence is set as two fixed lines and sized off the + container, so the longer first line spans the content width (it + measures about 19.3em, hence 5.1cqw). */} +
    +

    + TanStack is{' '} + {whyTanStackPrinciples.map((item, index) => { + const isLast = index === whyTanStackPrinciples.length - 1 + const isActive = isOpen && shown === index + const isFilled = hovered === index || (isActive && hovered === null) - {/* proof panel — 478:1744 */} - - - -

  2. - ))} -
- - {/* Quiet corner CTA — hugs the bottom-right of the section. Muted at - rest so it doesn't compete with the stack; on hover the label - brightens and the arrow slides to afford that it goes somewhere. */} -
- + {isLast ? 'and ' : null} + {/* Keeps the trailing comma/period on the phrase's line. */} + + + {isLast ? '.' : ','} + + {isLast ? null : index === 1 ? ( + <> + {' '} +
+ + ) : ( + ' ' + )} + + ) + })} + +
+ +
+
+
- Read our product tenets - - +
+ {/* Template string, not twMerge: it reads the type-scale and + color utilities as one conflicting `text-*` group. */} +

+ {principle.title} +

+

+ {principle.body} +

+
+
+ +
+
-
- ) -} -/** - * The 460×233 proof slot from Figma (478:1744 et al). - * - * Deliberately chrome-less: no border, no fill. The design draws a surface - * here, but the proofs read better floating directly on the card — the row - * dividers and the 70px gutter already separate them from the copy, so a - * second frame around each one was redundant weight. - */ -function PrinciplePanel({ children }: { children: React.ReactNode }) { - return ( -
- {children} -
+
+ + Read our product tenets + + +
+ ) } -function FrameworkAdapterGraph({ - accentClassName, -}: { - accentClassName: string -}) { - const [activeAdapterIndex, setActiveAdapterIndex] = React.useState(0) - const [flowProgress, setFlowProgress] = React.useState(0) +function FrameworkAdapterGraph() { const rootRef = React.useRef(null) - const isVisible = useInView(rootRef) - const prefersReducedMotion = usePrefersReducedMotion() - - React.useEffect(() => { - if (!isVisible || prefersReducedMotion !== false) return - - const intervalId = window.setInterval(() => { - setActiveAdapterIndex( - (currentIndex) => (currentIndex + 1) % frameworkAdapterNodes.length, - ) - }, 1150) - - return () => window.clearInterval(intervalId) - }, [isVisible, prefersReducedMotion]) - - React.useEffect(() => { - if (!isVisible || prefersReducedMotion !== false) return - - let frameId = 0 - let lastUpdate = 0 - const duration = 1500 - - const update = (timestamp: number) => { - if (timestamp - lastUpdate > 33) { - setFlowProgress((timestamp % duration) / duration) - lastUpdate = timestamp - } - - frameId = window.requestAnimationFrame(update) - } - - frameId = window.requestAnimationFrame(update) - - return () => window.cancelAnimationFrame(frameId) - }, [isVisible, prefersReducedMotion]) + const isVisible = useInView(rootRef, { threshold: 0.6 }) + // Draw the connectors once, the first time the graph scrolls into view, + // then leave it at rest. + const [hasEntered, setHasEntered] = React.useState(false) + if (isVisible && !hasEntered) setHasEntered(true) return ( // The node positions below are hard-coded against a 320×128 grid @@ -534,141 +513,69 @@ function FrameworkAdapterGraph({ style={{ transform: 'scale(clamp(0.75, calc(100cqw / 320px), 1.35))', }} - className="relative h-32 w-[320px] shrink-0 origin-center font-mono text-[10px] font-bold" + className="relative h-32 w-[320px] shrink-0 origin-center font-ds-mono text-[10px] font-medium" > -
- {frameworkAdapterNodes.map((adapter, adapterIndex) => { - const isActive = activeAdapterIndex === adapterIndex - - return ( - - {adapter.label} - - ) - })} +
+ + {frameworkAdapterConnections.map((connection, index) => ( + + ))} + + + {frameworkAdapterNodes.map((adapter) => ( + + {adapter.label} + + ))} core - - {frameworkAdapterConnections.map((connection, connectionIndex) => { - const progress = (flowProgress - connectionIndex * 0.13 + 1) % 1 - const point = cubicPoint( - connection.start, - connection.control1, - connection.control2, - connection.end, - progress, - ) - const angle = cubicAngle( - connection.start, - connection.control1, - connection.control2, - connection.end, - progress, - ) - - return ( - 0.92 - ? 'opacity-0' - : 'opacity-100', - )} - /> - ) - })} - - {frameworkAdapterConnections.map((connection, connectionIndex) => { - const isActive = activeAdapterIndex === connectionIndex - - return ( - - - - - ) - })}
) } -function PrincipleProof({ - proof, - accentClassName, -}: { - proof: PrincipleProof - accentClassName: string -}) { +function PrincipleProof({ proof }: { proof: PrincipleProof }) { if (proof === 'adapters') { - return + return } if (proof === 'types') { return ( -
-
- {[ - ['params.postId', 'string'], - ['query.data', 'Project[]'], - ['form.email', 'Field'], - ].map(([name, value]) => ( -
- {name} - - {value} - -
- ))} -
+
+ {[ + ['params.postId', 'string'], + ['query.data', 'Project[]'], + ['form.email', 'Field'], + ].map(([name, value]) => ( +
+ {name} + {value} +
+ ))}
) } @@ -677,77 +584,52 @@ function PrincipleProof({ return } - return + return } +/** + * Production-Grade proof: the live npm download count already prefetched by + * the route loader. One real number rather than adjectives — the hero strip + * carries the compact totals, so this panel shows only the full ticking count. + */ function AdoptionProof() { const { initialStats } = Route.useLoaderData() const { data: summary, dataUpdatedAt } = useQuery( homepageNpmStatsSummaryQuery(), ) - const { data: stats } = useQuery(ossStatsQuery()) const totalDownloads = summary?.totalDownloads ?? initialStats.totalDownloads ?? 0 - const weeklyDownloads = - summary?.weeklyDownloads ?? initialStats.weeklyDownloads ?? 0 - const starCount = stats?.github?.starCount ?? initialStats.starCount ?? 0 const liveDownloads = { ratePerDay: summary?.weeklyRatePerDay ?? initialStats.weeklyRatePerDay ?? 0, fetchedAt: dataUpdatedAt || initialStats.npmStatsFetchedAt, } return ( -
-
- - npm downloads - - - {totalDownloads > 0 ? ( - - ) : ( - '—' - )} - -
-
- {[ - { - label: 'per week', - value: - weeklyDownloads > 0 ? ( - - ) : ( - '—' - ), - }, - { - label: 'github stars', - value: starCount > 0 ? : '—', - }, - ].map(({ label, value }) => ( -
- - {label} - - - {value} - -
- ))} -
+
+ + npm downloads, and counting + + {/* npm can be slow, rate-limited, or down — a literal 0 would claim no + users, so show a placeholder until there is a real number. */} + + {totalDownloads > 0 ? ( + + ) : ( + '—' + )} +
) } /** - * No Vendor Lock-in proof: the same four claims the chip list made, but as a - * checked ledger so the panel reads as substantiated rather than decorative. + * No Vendor Lock-in proof: four claims as a ledger so the panel reads as + * substantiated rather than decorative. */ -function IndependenceProof({ accentClassName }: { accentClassName: string }) { +function IndependenceProof() { return ( -
+
{[ ['license', 'MIT'], ['hosting', 'self-host anywhere'], @@ -758,18 +640,13 @@ function IndependenceProof({ accentClassName }: { accentClassName: string }) { key={term} className={twMerge( 'flex items-baseline justify-between gap-4 py-3', - index > 0 && 'border-t border-gray-200/70 dark:border-gray-800/70', + index > 0 && 'border-t border-border-default', )} > -
+
{term}
-
+
{value}
diff --git a/src/styles/app.css b/src/styles/app.css index 5c15dc9c6..74fd20f66 100644 --- a/src/styles/app.css +++ b/src/styles/app.css @@ -2610,6 +2610,106 @@ html:not(.dark) .library-landing-graphic [style*='drop-shadow'] { filter: none !important; } +/* Muted outlines: panel and card borders in the library colour sit at a lower + strength so the pointer glow, not the outline, carries the colour. Hover and + focus keep whatever border the element defines for those states. */ +.library-landing .library-landing-graphic { + border-color: rgb(var(--landing-glow) / 0.24); +} + +.library-landing + :is( + [class*='border-[var(--landing-accent)]'], + [class*='border-(--landing-accent)'], + [class*='border-[rgb(var(--landing-glow)'] + ):not(.library-landing-graphic, :hover, :focus-visible) { + border-color: rgb(var(--landing-glow) / 0.32); +} + +/* Pointer glow: one spot of the library colour on the inner edge of a panel + and of the cards inside it, centred on the pointer (set per element from + LibraryLandingShell). + + The glow is an inset box-shadow on a pseudo-element that inherits the + element's own border-radius, so its shape always matches the outline and it + cannot spill outside it. A radial mask centred on the pointer reveals only + the part of that ring near the cursor, and fades it with distance. */ +/* Which elements glow: the panel, any rounded element inside a panel, and any + larger rounded card elsewhere on the page. Squircle-cornered blocks (the + partner grid) are left out: their corner shape is not a plain radius. */ +@layer base { + .library-landing-graphic, + .library-landing-graphic [class*='rounded-md'], + .library-landing + :is( + [class*='rounded-lg'], + [class*='rounded-xl'], + [class*='rounded-2xl'], + [class*='rounded-3xl'] + ):not([class*='corner-squircle']) { + position: relative; + } +} + +.dark .library-landing-graphic::after, +.dark .library-landing-graphic [class*='rounded-md']::after, +.dark + .library-landing + :is( + [class*='rounded-lg'], + [class*='rounded-xl'], + [class*='rounded-2xl'], + [class*='rounded-3xl'] + ):not([class*='corner-squircle'])::after { + content: ''; + position: absolute; + inset: 0; + border-radius: inherit; + pointer-events: none; + /* Cards: tighter than a panel, and no resting glow, so a page full of cards + is quiet until the pointer arrives. */ + --glow-band: 24px; + --glow-reach: 200px; + --glow-rest: -999px; + /* Three stacked shadows: a bright rim, then two wider, fainter layers, so + the light falls off gradually into the element instead of reading as a + thicker stroke. */ + box-shadow: + inset 0 0 calc(var(--glow-band) * 0.25) rgb(var(--landing-glow) / 0.55), + inset 0 0 var(--glow-band) rgb(var(--landing-glow) / 0.32), + inset 0 0 calc(var(--glow-band) * 2.25) rgb(var(--landing-glow) / 0.2); + /* A faint fill in the glow colour gives the grain something to bite into + across the spotlight, not only along the rim. */ + background-color: rgb(var(--landing-glow) / 0.07); + /* The second mask layer is fine noise in the alpha channel, intersected with + the pointer spotlight, so the glow breaks up like film grain instead of + falling off as a clean gradient. */ + mask-image: + radial-gradient( + circle var(--glow-reach) at var(--glow-x, var(--glow-rest)) + var(--glow-y, var(--glow-rest)), + #000, + rgb(0 0 0 / 0.5) 28%, + rgb(0 0 0 / 0.18) 55%, + rgb(0 0 0 / 0.04) 78%, + transparent + ), + url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 0 0 0 -2.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); + mask-size: + auto, + 180px 180px; + mask-repeat: no-repeat, repeat; + mask-composite: intersect; +} + +/* Panels: a wider, softer band, resting in the bottom-right corner. The + doubled class outranks the card rule above, which also matches panels. */ +.dark .library-landing .library-landing-graphic.library-landing-graphic::after { + --glow-band: 36px; + --glow-reach: 360px; + --glow-rest: 100%; +} + /* Staggered grid reveal for the /libraries waypoint cards. The transform rests at its identity value (fill: both), so per-card hover transforms are unaffected. */ @keyframes library-card-reveal { @@ -2717,21 +2817,115 @@ html:not(.dark) .library-landing-graphic [style*='drop-shadow'] { pointer-events: none; } -.home-adapter-graph-flow { - display: block; - width: 1.25rem; - height: 3px; +/* Homepage atmosphere (trial): one continuous gradient running the length of + the page, so colour drifts across section boundaries instead of resetting at + each one, with a single film-grain layer over it and under the content. */ +.home-grain { + position: relative; + isolation: isolate; + overflow-x: clip; +} + +.home-grain::before, +.home-grain::after { + content: ''; + position: absolute; + inset: 0; pointer-events: none; - border-radius: 9999px; - background: linear-gradient( - 90deg, - rgb(34 211 238 / 0), - rgb(165 243 252 / 0.98), - rgb(34 211 238 / 0.98), - rgb(59 130 246 / 0) - ); - box-shadow: 0 0 10px rgb(34 211 238 / 0.7); - transition: opacity 120ms linear; +} + +.home-grain::before { + z-index: -2; + background: + radial-gradient( + ellipse 70% 26% at var(--wash-1-at, 0% 30%), + color-mix( + in oklab, + var(--wash-1, var(--color-ds-blue-400)) 16%, + transparent + ), + color-mix( + in oklab, + var(--wash-1, var(--color-ds-blue-400)) 5%, + transparent + ) + 40%, + transparent 70% + ), + radial-gradient( + ellipse 70% 26% at var(--wash-2-at, 100% 55%), + color-mix( + in oklab, + var(--wash-2, var(--color-ds-purple-400)) 14%, + transparent + ), + color-mix( + in oklab, + var(--wash-2, var(--color-ds-purple-400)) 4%, + transparent + ) + 40%, + transparent 70% + ), + radial-gradient( + ellipse 70% 26% at var(--wash-3-at, 0% 82%), + color-mix( + in oklab, + var(--wash-3, var(--color-ds-amber-300)) 14%, + transparent + ), + color-mix( + in oklab, + var(--wash-3, var(--color-ds-amber-300)) 4%, + transparent + ) + 40%, + transparent 70% + ); +} + +/* The grain is masked to the same three shapes, so it fades out with the + colour and the page background stays untouched between washes. */ +.home-grain::after { + z-index: -1; + opacity: 0.12; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 1.4 0 0 0 -.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); + mask-image: + radial-gradient( + ellipse 70% 26% at var(--wash-1-at, 0% 30%), + #000, + transparent 70% + ), + radial-gradient( + ellipse 70% 26% at var(--wash-2-at, 100% 55%), + #000, + transparent 70% + ), + radial-gradient( + ellipse 70% 26% at var(--wash-3-at, 0% 82%), + #000, + transparent 70% + ); +} + +/* Library landing pages use the same motif in the library's own hue. It is the + only background treatment on the page: the hero's own glow is switched off + and every section fill is transparent, so one gradient runs through all of + them instead of each section drawing its own. */ +.library-landing.home-grain { + --wash-1: rgb(var(--landing-glow)); + --wash-2: rgb(var(--landing-glow)); + --wash-3: rgb(var(--landing-glow)); + --wash-1-at: 100% 12%; + --wash-2-at: 0% 45%; + --wash-3-at: 100% 78%; + --landing-hero-glow: 0; + --landing-hero-wash: 0; +} + +.library-landing.home-grain > section, +.library-landing.home-grain > div { + background-color: transparent; } .home-palm-sky { @@ -2785,10 +2979,6 @@ html:not(.dark) .library-landing-graphic [style*='drop-shadow'] { .home-open-source-gradient { animation: none; } - - .home-adapter-graph-flow { - display: none; - } } /* Dropdown animations */