Open source CapCut alternative.
TypeScript
Add site auth and pricing pages
David Ledb32c85abea2
diff --git a/site/src/app/_components/landing/AuthScreen.tsx b/site/src/app/_components/landing/AuthScreen.tsxnew file mode 100644index 00000000..7b510f31--- /dev/null+++ b/site/src/app/_components/landing/AuthScreen.tsx@@ -0,0 +1,239 @@+"use client";++import { ArrowRight, ShieldCheck, Sparkles } from "lucide-react";+import { useCallback, useState } from "react";++import {+ PillButton,+ SectionLabel,+ TapedCard,+} from "@/app/_components/landing/LandingPrimitives";+import { Footer } from "@/app/_components/landing/Footer";+import { TopNav } from "@/app/_components/landing/TopNav";+import { BG, BLACK, CARD } from "@/app/_components/landing/theme";+import { useMediaQuery } from "@/app/_components/landing/useMediaQuery";+import { authClient } from "@/lib/auth-client";++type AuthMode = "sign-in" | "sign-up";++type Props = {+ mode: AuthMode;+};++const copy = {+ "sign-in": {+ alternateHref: "/sign-up",+ alternateLabel: "Create account",+ eyebrow: "Welcome back",+ heading: "Sign in and send Donkey back to work.",+ supporting:+ "Use the same Google account you used for Donkey. Your billing and downloads stay tied to one clean account.",+ title: "Sign in",+ },+ "sign-up": {+ alternateHref: "/sign-in",+ alternateLabel: "Sign in",+ eyebrow: "Start your account",+ heading: "Create an account for the work Donkey carries.",+ supporting:+ "Google OAuth keeps setup quick and gives checkout a real account to attach your subscription to.",+ title: "Sign up",+ },+} satisfies Record<+ AuthMode,+ {+ alternateHref: string;+ alternateLabel: string;+ eyebrow: string;+ heading: string;+ supporting: string;+ title: string;+ }+>;++export function AuthScreen({ mode }: Props) {+ const isDesktop = useMediaQuery("(min-width: 900px)");+ const [isPending, setIsPending] = useState(false);+ const [statusMessage, setStatusMessage] = useState<string | null>(null);+ const screenCopy = copy[mode];++ const handleGoogleAuth = useCallback(async () => {+ const searchParams = new URLSearchParams(window.location.search);+ const callbackURL = searchParams.get("callbackURL") ?? "/pricing";++ setIsPending(true);+ setStatusMessage(null);++ try {+ await authClient.signIn.social({+ callbackURL,+ provider: "google",+ });+ } catch {+ setStatusMessage("Google sign-in could not start. Please try again.");+ } finally {+ setIsPending(false);+ }+ }, []);++ return (+ <main+ style={{+ WebkitFontSmoothing: "antialiased",+ background: BG,+ color: BLACK,+ boxSizing: "border-box",+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',+ maxWidth: "100%",+ minHeight: "100vh",+ overflowX: "hidden",+ width: "100%",+ }}+ >+ <TopNav ctaHref="/pricing" ctaLabel="Pricing" />+ <section+ style={{+ display: "grid",+ gap: isDesktop ? 48 : 32,+ gridTemplateColumns: isDesktop ? "minmax(0, 1.05fr) minmax(360px, 0.8fr)" : "1fr",+ boxSizing: "border-box",+ margin: "0 auto",+ maxWidth: 1400,+ padding: isDesktop ? "72px 48px 120px" : "44px 24px 80px",+ width: "100%",+ }}+ >+ <div>+ <SectionLabel number={1}>{screenCopy.eyebrow}</SectionLabel>+ <h1+ style={{+ fontSize: isDesktop ? 92 : 52,+ fontWeight: 900,+ letterSpacing: 0,+ lineHeight: 0.9,+ margin: 0,+ maxWidth: 920,+ overflowWrap: "break-word",+ }}+ >+ {screenCopy.heading}+ </h1>+ <p+ style={{+ color: "#454545",+ fontSize: isDesktop ? 20 : 18,+ lineHeight: 1.55,+ marginTop: 32,+ maxWidth: 620,+ }}+ >+ {screenCopy.supporting}+ </p>+ </div>++ <div style={{ alignSelf: "start" }}>+ <TapedCard color="cream" tapeColor="coral" tapePosition="center">+ <div style={{ padding: isDesktop ? 36 : 28 }}>+ <div+ style={{+ alignItems: "center",+ background: CARD.blue,+ border: `2px solid ${BLACK}`,+ borderRadius: 14,+ display: "inline-flex",+ height: 56,+ justifyContent: "center",+ marginBottom: 28,+ width: 56,+ }}+ >+ <Sparkles size={24} />+ </div>+ <h2+ style={{+ fontSize: isDesktop ? 42 : 34,+ fontWeight: 900,+ lineHeight: 1,+ margin: "0 0 14px",+ }}+ >+ {screenCopy.title}+ </h2>+ <p+ style={{+ color: "#444",+ fontSize: 15,+ lineHeight: 1.55,+ margin: "0 0 28px",+ }}+ >+ Donkey uses Google sign-in so checkout, subscriptions, and account+ access stay simple.+ </p>+ <div style={{ display: "grid", gap: 12 }}>+ <PillButton+ disabled={isPending}+ onClick={handleGoogleAuth}+ size="lg"+ variant="dark"+ >+ {isPending ? "Opening Google..." : "Continue with Google"}+ <ArrowRight size={18} />+ </PillButton>+ <PillButton+ href={screenCopy.alternateHref}+ size="lg"+ variant="secondary"+ >+ {screenCopy.alternateLabel}+ </PillButton>+ </div>+ {statusMessage ? (+ <div+ role="status"+ style={{+ color: "#4a403d",+ fontSize: 13,+ fontWeight: 700,+ lineHeight: 1.4,+ marginTop: 14,+ }}+ >+ {statusMessage}+ </div>+ ) : null}+ </div>+ </TapedCard>++ <div+ style={{+ alignItems: "center",+ display: "flex",+ gap: 12,+ marginTop: 24,+ }}+ >+ <div+ style={{+ alignItems: "center",+ background: CARD.mint,+ border: `2px solid ${BLACK}`,+ borderRadius: 12,+ display: "flex",+ height: 44,+ justifyContent: "center",+ width: 44,+ }}+ >+ <ShieldCheck size={20} />+ </div>+ <div style={{ color: "#555", fontSize: 14, lineHeight: 1.4 }}>+ OAuth only. No passwords to store, reset, or lose.+ </div>+ </div>+ </div>+ </section>+ <Footer />+ </main>+ );+}diff --git a/site/src/app/_components/landing/BillingPortalButton.tsx b/site/src/app/_components/landing/BillingPortalButton.tsxnew file mode 100644index 00000000..8071aeca--- /dev/null+++ b/site/src/app/_components/landing/BillingPortalButton.tsx@@ -0,0 +1,67 @@+"use client";++import { ArrowRight } from "lucide-react";+import { useCallback, useState } from "react";++import {+ BillingApiError,+ createBillingPortalSession,+} from "@/app/api-clients/billingApi";+import { PillButton } from "@/app/_components/landing/LandingPrimitives";+import { authClient } from "@/lib/auth-client";++export function BillingPortalButton() {+ const [isPending, setIsPending] = useState(false);+ const [statusMessage, setStatusMessage] = useState<string | null>(null);++ const handleOpenPortal = useCallback(async () => {+ setIsPending(true);+ setStatusMessage(null);++ try {+ const session = await createBillingPortalSession();+ window.location.assign(session.url);+ } catch (error) {+ if (+ error instanceof BillingApiError &&+ error.code === "unauthorized"+ ) {+ await authClient.signIn.social({+ callbackURL: "/pricing",+ provider: "google",+ });+ return;+ }++ if (error instanceof BillingApiError && error.code === "not-found") {+ setStatusMessage("Billing portal is not available yet.");+ } else {+ setStatusMessage("Billing portal is not available yet.");+ }+ } finally {+ setIsPending(false);+ }+ }, []);++ return (+ <div>+ <PillButton disabled={isPending} onClick={handleOpenPortal} variant="secondary">+ {isPending ? "Opening..." : "Manage billing"} <ArrowRight size={14} />+ </PillButton>+ {statusMessage ? (+ <div+ role="status"+ style={{+ color: "rgba(255,255,255,0.7)",+ fontSize: 13,+ fontWeight: 700,+ lineHeight: 1.4,+ marginTop: 12,+ }}+ >+ {statusMessage}+ </div>+ ) : null}+ </div>+ );+}diff --git a/site/src/app/_components/landing/FinalCTA.tsx b/site/src/app/_components/landing/FinalCTA.tsxindex d13d31e9..7c36cb9f 100644--- a/site/src/app/_components/landing/FinalCTA.tsx+++ b/site/src/app/_components/landing/FinalCTA.tsx@@ -14,9 +14,11 @@ export function FinalCTA() {<sectionid="download"style={{+ boxSizing: "border-box",padding: isDesktop ? "64px 48px 120px" : "48px 24px 80px",maxWidth: 1400,margin: "0 auto",+ width: "100%",}}><div style={{ position: "relative" }}>@@ -100,7 +102,7 @@ export function FinalCTA() {<PillButton href={GITHUB_REPO_URL} variant="primary" size="lg">Download for Mac <ArrowRight size={18} /></PillButton>- <PillButton href="#pricing" variant="secondary" size="lg">+ <PillButton href="/pricing" variant="secondary" size="lg">See pricing</PillButton></div>diff --git a/site/src/app/_components/landing/Footer.tsx b/site/src/app/_components/landing/Footer.tsxindex 14dcf3a0..cd1460ff 100644--- a/site/src/app/_components/landing/Footer.tsx+++ b/site/src/app/_components/landing/Footer.tsx@@ -23,7 +23,9 @@ export function Footer() {<footerstyle={{borderTop: `2px solid ${BLACK}`,+ boxSizing: "border-box",padding: isDesktop ? "80px 48px" : "64px 24px",+ width: "100%",}}><div style={{ maxWidth: 1400, margin: "0 auto" }}>diff --git a/site/src/app/_components/landing/LandingPrimitives.tsx b/site/src/app/_components/landing/LandingPrimitives.tsxindex f1b7bbc0..2a3838ad 100644--- a/site/src/app/_components/landing/LandingPrimitives.tsx+++ b/site/src/app/_components/landing/LandingPrimitives.tsx@@ -34,7 +34,14 @@ export function TapedCard({: "rotate(-2deg)";return (- <div style={{ position: "relative", ...style }}>+ <div+ style={{+ boxSizing: "border-box",+ minWidth: 0,+ position: "relative",+ ...style,+ }}+ ><divstyle={{position: "absolute",@@ -47,6 +54,7 @@ export function TapedCard({<divstyle={{position: "relative",+ boxSizing: "border-box",borderRadius: 16,border: `2px solid ${BLACK}`,background: CARD[color],@@ -75,15 +83,21 @@ export function TapedCard({}type PillButtonProps = {+ ariaLabel?: string;children: ReactNode;+ disabled?: boolean;href?: string;+ onClick?: () => void | Promise<void>;size?: ButtonSize;variant?: ButtonVariant;};export function PillButton({+ ariaLabel,children,+ disabled = false,href,+ onClick,size = "md",variant = "primary",}: PillButtonProps) {@@ -112,24 +126,31 @@ export function PillButton({gap: 8,borderRadius: 999,fontWeight: 700,- cursor: "pointer",+ cursor: disabled ? "not-allowed" : "pointer",minHeight: size === "lg" ? 56 : 40,+ opacity: disabled ? 0.65 : 1,textDecoration: "none",transition: "transform 0.15s ease, opacity 0.15s ease",...sizes[size],...variants[variant],};- if (href) {+ if (href && !disabled && !onClick) {return (- <a href={href} style={sharedStyle}>+ <a aria-label={ariaLabel} href={href} style={sharedStyle}>{children}</a>);}return (- <button type="button" style={sharedStyle}>+ <button+ aria-label={ariaLabel}+ disabled={disabled}+ onClick={onClick}+ style={sharedStyle}+ type="button"+ >{children}</button>);diff --git a/site/src/app/_components/landing/Pricing.tsx b/site/src/app/_components/landing/Pricing.tsxindex b1934e07..a6eb0b63 100644--- a/site/src/app/_components/landing/Pricing.tsx+++ b/site/src/app/_components/landing/Pricing.tsx@@ -5,9 +5,9 @@ import { ArrowRight } from "lucide-react";import {Headline,PillButton,- SectionLabel,- TapedCard,} from "@/app/_components/landing/LandingPrimitives";+import { PricingPlanCard } from "@/app/_components/landing/PricingPlanCard";+import { pricingPreviewPlans } from "@/app/_components/landing/pricingPlans";import { useMediaQuery } from "@/app/_components/landing/useMediaQuery";export function Pricing() {@@ -17,15 +17,29 @@ export function Pricing() {<sectionid="pricing"style={{+ boxSizing: "border-box",padding: isDesktop ? "96px 48px" : "80px 24px",maxWidth: 1400,margin: "0 auto",+ width: "100%",}}>- <SectionLabel number={7}>Pricing</SectionLabel><Headline>- Free for now. <span style={{ fontStyle: "italic" }}>Forever curious.</span>+ Plans for the work.{" "}+ <span style={{ fontStyle: "italic" }}>Built for momentum.</span></Headline>+ <p+ style={{+ color: "#454545",+ fontSize: isDesktop ? 18 : 16,+ lineHeight: 1.55,+ margin: "24px 0 0",+ maxWidth: 620,+ }}+ >+ Start with Pro when you are ready for self-serve billing, or talk to us+ about rolling Donkey out across a team.+ </p><divstyle={{marginTop: 48,@@ -34,79 +48,14 @@ export function Pricing() {gap: 24,}}>- <TapedCard color="cream" tapeColor="coral">- <div style={{ padding: isDesktop ? 36 : 28 }}>- <div style={{ fontWeight: 900, fontSize: 22, marginBottom: 8 }}>- Free- </div>- <div style={{ display: "flex", alignItems: "baseline", gap: 8 }}>- <span style={{ fontWeight: 900, fontSize: isDesktop ? 56 : 44 }}>- $0- </span>- </div>- <div- style={{- fontSize: 13,- fontWeight: 700,- color: "#444",- marginBottom: 24,- }}- >- during beta- </div>- <p- style={{- fontSize: 15,- lineHeight: 1.55,- color: "#222",- margin: "0 0 28px",- }}- >- Everything Donkey can do, no caps, no credit card. We want you- using it.- </p>- <PillButton href="#download" variant="dark" size="md">- Get Donkey <ArrowRight size={14} />- </PillButton>- </div>- </TapedCard>-- <TapedCard color="coral" tapeColor="yellow" tapePosition="right">- <div style={{ padding: isDesktop ? 36 : 28 }}>- <div style={{ fontWeight: 900, fontSize: 22, marginBottom: 8 }}>- Enterprise- </div>- <div style={{ display: "flex", alignItems: "baseline", gap: 8 }}>- <span style={{ fontWeight: 900, fontSize: isDesktop ? 56 : 44 }}>- Let's talk- </span>- </div>- <div- style={{- fontSize: 13,- fontWeight: 700,- color: "#222",- marginBottom: 24,- }}- >- built around your team- </div>- <p- style={{- fontSize: 15,- lineHeight: 1.55,- color: "#1a1a1a",- margin: "0 0 28px",- }}- >- Running Donkey across an org? Reach out and we will figure out- what makes sense.- </p>- <PillButton href="mailto:[email protected]" variant="dark" size="md">- Contact us <ArrowRight size={14} />- </PillButton>- </div>- </TapedCard>+ {pricingPreviewPlans.map((plan) => (+ <PricingPlanCard key={plan.name} plan={plan} />+ ))}+ </div>+ <div style={{ marginTop: 36 }}>+ <PillButton href="/pricing" variant="secondary" size="lg">+ Open pricing <ArrowRight size={18} />+ </PillButton></div></section>);diff --git a/site/src/app/_components/landing/PricingPage.tsx b/site/src/app/_components/landing/PricingPage.tsxnew file mode 100644index 00000000..3f846153--- /dev/null+++ b/site/src/app/_components/landing/PricingPage.tsx@@ -0,0 +1,176 @@+"use client";++import { ArrowRight } from "lucide-react";++import { BillingPortalButton } from "@/app/_components/landing/BillingPortalButton";+import {+ Headline,+ PillButton,+} from "@/app/_components/landing/LandingPrimitives";+import { Footer } from "@/app/_components/landing/Footer";+import { PricingPlanCard } from "@/app/_components/landing/PricingPlanCard";+import { TopNav } from "@/app/_components/landing/TopNav";+import { pricingPlans } from "@/app/_components/landing/pricingPlans";+import { BG, BLACK } from "@/app/_components/landing/theme";+import { useMediaQuery } from "@/app/_components/landing/useMediaQuery";++export function PricingPage() {+ const isDesktop = useMediaQuery("(min-width: 768px)");+ const isWideDesktop = useMediaQuery("(min-width: 1400px)");++ return (+ <main+ style={{+ WebkitFontSmoothing: "antialiased",+ background: BG,+ color: BLACK,+ boxSizing: "border-box",+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',+ maxWidth: "100%",+ minHeight: "100vh",+ overflowX: "hidden",+ width: "100%",+ }}+ >+ <TopNav ctaHref="/sign-in" ctaLabel="Sign in" />+ <section+ style={{+ boxSizing: "border-box",+ margin: "0 auto",+ maxWidth: 1400,+ padding: isDesktop ? "72px 48px 64px" : "44px 24px 48px",+ width: "100%",+ }}+ >+ <h1+ style={{+ fontSize: isDesktop ? 112 : 52,+ fontWeight: 900,+ letterSpacing: 0,+ lineHeight: 0.9,+ margin: 0,+ maxWidth: isDesktop ? 1304 : 700,+ overflowWrap: "break-word",+ }}+ >+ Pick the plan.+ <br />+ <span style={{ whiteSpace: isWideDesktop ? "nowrap" : "normal" }}>+ Let Donkey <span style={{ fontStyle: "italic" }}>carry it.</span>+ </span>+ </h1>+ <p+ style={{+ color: "#454545",+ fontSize: isDesktop ? 20 : 18,+ lineHeight: 1.55,+ marginTop: 32,+ maxWidth: 640,+ }}+ >+ Pro is the self-serve path through Stripe. Enterprise stays personal:+ tell us what your team needs, and we will shape the rollout around it.+ </p>+ </section>++ <section+ style={{+ boxSizing: "border-box",+ margin: "0 auto",+ maxWidth: 1400,+ padding: isDesktop ? "0 48px 96px" : "0 24px 80px",+ width: "100%",+ }}+ >+ <div+ style={{+ display: "grid",+ gap: 24,+ gridTemplateColumns: isDesktop ? "1fr 1fr" : "1fr",+ }}+ >+ {pricingPlans.map((plan) => (+ <PricingPlanCard key={plan.name} plan={plan} />+ ))}+ </div>+ </section>++ <section+ style={{+ boxSizing: "border-box",+ margin: "0 auto",+ maxWidth: 1400,+ padding: isDesktop ? "0 48px 120px" : "0 24px 80px",+ width: "100%",+ }}+ >+ <div style={{ position: "relative" }}>+ <div+ style={{+ background: "#EC7868",+ borderRadius: 24,+ inset: 0,+ position: "absolute",+ transform: "translate(8px, 8px)",+ }}+ />+ <div+ style={{+ background: BLACK,+ border: `2px solid ${BLACK}`,+ borderRadius: 24,+ color: "#fff",+ display: "grid",+ gap: isDesktop ? 36 : 24,+ gridTemplateColumns: isDesktop ? "1fr auto" : "1fr",+ padding: isDesktop ? "56px 48px" : "36px 28px",+ position: "relative",+ }}+ >+ <div>+ <div+ style={{+ color: "rgba(255,255,255,0.55)",+ fontSize: 12,+ fontWeight: 800,+ letterSpacing: "0.12em",+ marginBottom: 18,+ textTransform: "uppercase",+ }}+ >+ Already subscribed+ </div>+ <Headline size="lg">Keep billing boring.</Headline>+ <p+ style={{+ color: "rgba(255,255,255,0.72)",+ fontSize: isDesktop ? 17 : 15,+ lineHeight: 1.55,+ margin: "18px 0 0",+ maxWidth: 560,+ }}+ >+ Manage payment methods, receipts, and subscription details from+ one Stripe-hosted place.+ </p>+ </div>+ <div+ style={{+ alignSelf: "center",+ display: "flex",+ flexWrap: "wrap",+ gap: 12,+ }}+ >+ <BillingPortalButton />+ <PillButton href="/sign-in" variant="primary">+ Sign in <ArrowRight size={14} />+ </PillButton>+ </div>+ </div>+ </div>+ </section>+ <Footer />+ </main>+ );+}diff --git a/site/src/app/_components/landing/PricingPlanCard.tsx b/site/src/app/_components/landing/PricingPlanCard.tsxnew file mode 100644index 00000000..021cd63d--- /dev/null+++ b/site/src/app/_components/landing/PricingPlanCard.tsx@@ -0,0 +1,172 @@+"use client";++import { ArrowRight, Check } from "lucide-react";+import { useCallback, useState } from "react";++import {+ BillingApiError,+ createCheckoutSession,+} from "@/app/api-clients/billingApi";+import {+ PillButton,+ TapedCard,+} from "@/app/_components/landing/LandingPrimitives";+import type { PricingPlan } from "@/app/_components/landing/pricingPlans";+import { useMediaQuery } from "@/app/_components/landing/useMediaQuery";+import { authClient } from "@/lib/auth-client";++type Props = {+ plan: PricingPlan;+};++export function PricingPlanCard({ plan }: Props) {+ const isDesktop = useMediaQuery("(min-width: 768px)");+ const [isPending, setIsPending] = useState(false);+ const [statusMessage, setStatusMessage] = useState<string | null>(null);+ const action = plan.action;++ const handleCheckout = useCallback(async () => {+ if (action.kind !== "checkout") {+ return;+ }++ setIsPending(true);+ setStatusMessage(null);++ try {+ const session = await createCheckoutSession(action.planKey);+ window.location.assign(session.url);+ } catch (error) {+ if (+ error instanceof BillingApiError &&+ error.code === "unauthorized"+ ) {+ await authClient.signIn.social({+ callbackURL: `/pricing?checkout=${action.planKey}`,+ provider: "google",+ });+ return;+ }++ if (error instanceof BillingApiError && error.code === "not-found") {+ setStatusMessage("Checkout is not available yet.");+ } else {+ setStatusMessage("Checkout is not available yet. Please try again soon.");+ }+ } finally {+ setIsPending(false);+ }+ }, [action]);++ const button =+ action.kind === "checkout" ? (+ <PillButton+ disabled={isPending}+ onClick={handleCheckout}+ variant="dark"+ >+ {isPending ? "Opening..." : action.label} <ArrowRight size={14} />+ </PillButton>+ ) : (+ <PillButton href={action.href} variant="dark">+ {action.label} <ArrowRight size={14} />+ </PillButton>+ );++ return (+ <TapedCard+ color={plan.color}+ tapeColor={plan.tapeColor}+ tapePosition={plan.tapePosition}+ >+ <div style={{ padding: isDesktop ? 36 : 28 }}>+ <div style={{ fontWeight: 900, fontSize: 22, marginBottom: 18 }}>+ {plan.name}+ </div>+ <div style={{ display: "flex", alignItems: "baseline", gap: 8 }}>+ <span+ style={{+ fontWeight: 900,+ fontSize: isDesktop ? 54 : 42,+ lineHeight: 0.95,+ }}+ >+ {plan.price}+ </span>+ </div>+ <div+ style={{+ fontSize: 13,+ fontWeight: 800,+ color: plan.color === "coral" ? "#201715" : "#444",+ marginBottom: 24,+ marginTop: 10,+ }}+ >+ {plan.detail}+ </div>+ <p+ style={{+ color: plan.color === "coral" ? "#1a1a1a" : "#222",+ fontSize: 15,+ lineHeight: 1.55,+ margin: "0 0 24px",+ }}+ >+ {plan.body}+ </p>+ <div+ style={{+ display: "grid",+ gap: 10,+ marginBottom: 28,+ }}+ >+ {plan.features.map((feature) => (+ <div+ key={feature}+ style={{+ alignItems: "center",+ display: "flex",+ gap: 10,+ fontSize: 14,+ fontWeight: 750,+ }}+ >+ <span+ style={{+ alignItems: "center",+ background: "#fff",+ border: "2px solid #0F0E0D",+ borderRadius: 999,+ display: "inline-flex",+ height: 24,+ justifyContent: "center",+ width: 24,+ }}+ >+ <Check size={14} />+ </span>+ <span>{feature}</span>+ </div>+ ))}+ </div>+ {button}+ {statusMessage ? (+ <div+ role="status"+ style={{+ color: "#4a403d",+ fontSize: 13,+ fontWeight: 700,+ lineHeight: 1.4,+ marginTop: 14,+ }}+ >+ {statusMessage}+ </div>+ ) : null}+ </div>+ </TapedCard>+ );+}diff --git a/site/src/app/_components/landing/TopNav.tsx b/site/src/app/_components/landing/TopNav.tsxindex 7e0d969a..a94dc61a 100644--- a/site/src/app/_components/landing/TopNav.tsx+++ b/site/src/app/_components/landing/TopNav.tsx@@ -6,7 +6,17 @@ import { PillButton } from "@/app/_components/landing/LandingPrimitives";import { useMediaQuery } from "@/app/_components/landing/useMediaQuery";import { BLACK } from "@/app/_components/landing/theme";-export function TopNav() {+type Props = {+ ctaHref?: string;+ ctaLabel?: string;+ homeHref?: string;+};++export function TopNav({+ ctaHref = "#download",+ ctaLabel = "Download",+ homeHref = "/",+}: Props) {const isDesktop = useMediaQuery("(min-width: 768px)");return (@@ -14,14 +24,16 @@ export function TopNav() {style={{display: "flex",alignItems: "center",+ boxSizing: "border-box",justifyContent: "space-between",padding: isDesktop ? "28px 48px" : "24px 24px",maxWidth: 1400,margin: "0 auto",+ width: "100%",}}><a- href="https://www.donkeyuse.com"+ href={homeHref}style={{display: "flex",alignItems: "center",@@ -45,8 +57,8 @@ export function TopNav() {</div><span style={{ fontWeight: 900, fontSize: 24 }}>donkey</span></a>- <PillButton href="#download" variant="dark" size="sm">- Download <ArrowRight size={14} />+ <PillButton href={ctaHref} variant="dark" size="sm">+ {ctaLabel} <ArrowRight size={14} /></PillButton></nav>);diff --git a/site/src/app/_components/landing/pricingPlans.ts b/site/src/app/_components/landing/pricingPlans.tsnew file mode 100644index 00000000..72369461--- /dev/null+++ b/site/src/app/_components/landing/pricingPlans.ts@@ -0,0 +1,83 @@+import type { BillingPlanKey } from "@/app/api-clients/billingApi";+import type { CardColor } from "@/app/_components/landing/theme";++export type PricingPlanAction =+ | {+ href: string;+ kind: "contact" | "link";+ label: string;+ }+ | {+ kind: "checkout";+ label: string;+ planKey: BillingPlanKey;+ };++export type PricingPlan = {+ action: PricingPlanAction;+ body: string;+ color: CardColor;+ detail: string;+ features: string[];+ name: string;+ price: string;+ tapeColor: CardColor;+ tapePosition?: "left" | "right" | "center";+};++const enterpriseFeatures = [+ "Team rollout planning",+ "Security and deployment review",+ "Custom support around your stack",+];++export const pricingPlans = [+ {+ action: {+ kind: "checkout",+ label: "Start checkout",+ planKey: "pro",+ },+ body: "For people who want Donkey running real work across their Mac without waiting for a team rollout.",+ color: "cream",+ detail: "monthly subscription",+ features: [+ "Local Mac automation",+ "Specialised agents for everyday work",+ "Review-first execution",+ "Stripe billing and account access",+ ],+ name: "Pro",+ price: "$20/month",+ tapeColor: "coral",+ },+ {+ action: {+ href: "mailto:[email protected]",+ kind: "contact",+ label: "Contact us",+ },+ body: "Running Donkey across an org? Reach out and we will figure out what makes sense.",+ color: "coral",+ detail: "built around your team",+ features: enterpriseFeatures,+ name: "Enterprise",+ price: "Let's talk",+ tapeColor: "yellow",+ tapePosition: "right",+ },+] satisfies PricingPlan[];++export const pricingPreviewPlans = [+ {+ ...pricingPlans[0],+ action: {+ href: "/pricing",+ kind: "link",+ label: "See Pro",+ },+ body: "Start with the self-serve plan when you are ready to connect billing.",+ detail: "Stripe checkout",+ },+ pricingPlans[1],+] satisfies PricingPlan[];diff --git a/site/src/app/api-clients/billingApi.ts b/site/src/app/api-clients/billingApi.tsnew file mode 100644index 00000000..f74bb192--- /dev/null+++ b/site/src/app/api-clients/billingApi.ts@@ -0,0 +1,109 @@+export type BillingPlanKey = "pro";++export type BillingCheckoutResponse = {+ url: string;+};++export type BillingPortalResponse = {+ url: string;+};++export type BillingSubscription = {+ cancelAtPeriodEnd: boolean;+ currentPeriodEnd: string | null;+ planKey: BillingPlanKey;+ status: string;+};++export type BillingSubscriptionResponse = {+ subscription: BillingSubscription | null;+};++type BillingApiErrorCode =+ | "bad-request"+ | "not-found"+ | "server-error"+ | "unauthorized"+ | "unknown";++export class BillingApiError extends Error {+ code: BillingApiErrorCode;+ status: number;++ constructor(message: string, status: number, code: BillingApiErrorCode) {+ super(message);+ this.name = "BillingApiError";+ this.code = code;+ this.status = status;+ }+}++function errorCodeForStatus(status: number): BillingApiErrorCode {+ if (status === 400) {+ return "bad-request";+ }++ if (status === 401) {+ return "unauthorized";+ }++ if (status === 404) {+ return "not-found";+ }++ if (status >= 500) {+ return "server-error";+ }++ return "unknown";+}++async function readJson<T>(response: Response): Promise<T> {+ return (await response.json()) as T;+}++async function requireOk(response: Response, fallbackMessage: string) {+ if (response.ok) {+ return;+ }++ throw new BillingApiError(+ fallbackMessage,+ response.status,+ errorCodeForStatus(response.status),+ );+}++export async function createCheckoutSession(planKey: BillingPlanKey) {+ const response = await fetch("/api/billing/checkout/", {+ body: JSON.stringify({ planKey }),+ headers: {+ "Content-Type": "application/json",+ },+ method: "POST",+ });++ await requireOk(response, "Unable to start checkout.");++ return readJson<BillingCheckoutResponse>(response);+}++export async function createBillingPortalSession() {+ const response = await fetch("/api/billing/portal/", {+ method: "POST",+ });++ await requireOk(response, "Unable to open billing portal.");++ return readJson<BillingPortalResponse>(response);+}++export async function getBillingSubscription() {+ const response = await fetch("/api/billing/subscription/", {+ method: "GET",+ });++ await requireOk(response, "Unable to load subscription.");++ return readJson<BillingSubscriptionResponse>(response);+}diff --git a/site/src/app/pricing/page.tsx b/site/src/app/pricing/page.tsxnew file mode 100644index 00000000..d2c1ce43--- /dev/null+++ b/site/src/app/pricing/page.tsx@@ -0,0 +1,12 @@+import type { Metadata } from "next";++import { PricingPage } from "@/app/_components/landing/PricingPage";++export const metadata: Metadata = {+ title: "Pricing | Donkey",+ description: "Pick a Donkey plan for self-serve Pro billing or team rollout.",+};++export default function Page() {+ return <PricingPage />;+}diff --git a/site/src/app/sign-in/page.tsx b/site/src/app/sign-in/page.tsxnew file mode 100644index 00000000..0a75e7ac--- /dev/null+++ b/site/src/app/sign-in/page.tsx@@ -0,0 +1,12 @@+import type { Metadata } from "next";++import { AuthScreen } from "@/app/_components/landing/AuthScreen";++export const metadata: Metadata = {+ title: "Sign in | Donkey",+ description: "Sign in to Donkey with Google.",+};++export default function Page() {+ return <AuthScreen mode="sign-in" />;+}diff --git a/site/src/app/sign-up/page.tsx b/site/src/app/sign-up/page.tsxnew file mode 100644index 00000000..df664dfd--- /dev/null+++ b/site/src/app/sign-up/page.tsx@@ -0,0 +1,12 @@+import type { Metadata } from "next";++import { AuthScreen } from "@/app/_components/landing/AuthScreen";++export const metadata: Metadata = {+ title: "Sign up | Donkey",+ description: "Create a Donkey account with Google.",+};++export default function Page() {+ return <AuthScreen mode="sign-up" />;+}diff --git a/site/src/lib/auth-client.ts b/site/src/lib/auth-client.tsnew file mode 100644index 00000000..2f75fd48--- /dev/null+++ b/site/src/lib/auth-client.ts@@ -0,0 +1,5 @@+"use client";++import { createAuthClient } from "better-auth/react";++export const authClient = createAuthClient();