Open source CapCut alternative.
TypeScript
feat(site): finish the welcome sequence — six slides, its own URL
David Lec8e4a77c9f76
diff --git a/site/public/cut/onboarding/discord.svg b/site/public/cut/onboarding/discord.svgnew file mode 100644index 00000000..9d7796b8--- /dev/null+++ b/site/public/cut/onboarding/discord.svg@@ -0,0 +1 @@+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Discord</title><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg>\ No newline at end of filediff --git a/site/public/cut/onboarding/instagram.svg b/site/public/cut/onboarding/instagram.svgnew file mode 100644index 00000000..c0e86b0b--- /dev/null+++ b/site/public/cut/onboarding/instagram.svg@@ -0,0 +1 @@+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Instagram</title><path d="M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"/></svg>\ No newline at end of filediff --git a/site/public/cut/onboarding/tiktok.svg b/site/public/cut/onboarding/tiktok.svgnew file mode 100644index 00000000..57ce3ae5--- /dev/null+++ b/site/public/cut/onboarding/tiktok.svg@@ -0,0 +1 @@+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>TikTok</title><path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"/></svg>\ No newline at end of filediff --git a/site/public/cut/onboarding/youtube.svg b/site/public/cut/onboarding/youtube.svgnew file mode 100644index 00000000..0492366a--- /dev/null+++ b/site/public/cut/onboarding/youtube.svg@@ -0,0 +1 @@+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>YouTube</title><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>\ No newline at end of filediff --git a/site/src/app/cut/_components/landing/cutPricingPlans.ts b/site/src/app/cut/_components/landing/cutPricingPlans.tsindex 3322caf1..b21c6667 100644--- a/site/src/app/cut/_components/landing/cutPricingPlans.ts+++ b/site/src/app/cut/_components/landing/cutPricingPlans.ts@@ -1,5 +1,20 @@import type { PricingPlan } from "@/app/_components/landing/pricingPlans";+// What Pro costs and what it gets you, in one place: the landing card below+// and the welcome sequence's last slide both read it, so the price can't say+// two different things in two parts of the product.+export const CUT_PRO = {+ body: "Generate rich media with AI.",+ // What Pro adds. The landing card sits beside the Free card and opens with a+ // line pointing at it; nothing else does, so that line isn't in here.+ features: [+ "50 GB of cloud storage",+ "Generous AI credits every month",+ "Image, video, voiceover, and music generation",+ ],+ price: "$20/month",+};+// Cut's two tiers: the editor itself is free and local; Pro adds monthly AI// generation credits. `root` prefixes in-app links ("" on donkeycut.com,// "/cut" in dev) so the cards work on either host.@@ -30,17 +45,12 @@ export function cutPricingPlans(root: string): PricingPlan[] {kind: "link",label: "Get Pro",},- body: "Generate rich media with AI.",+ body: CUT_PRO.body,color: "coral",detail: "For individuals",- features: [- "Everything in Free",- "50 GB of cloud storage",- "Generous AI credits every month",- "Image, video, voiceover, and music generation",- ],+ features: ["Everything in Free", ...CUT_PRO.features],name: "Pro",- price: "$20/month",+ price: CUT_PRO.price,tapeColor: "yellow",tapePosition: "right",},diff --git a/site/src/app/cut/app/(home)/onboarding/page.tsx b/site/src/app/cut/app/(home)/onboarding/page.tsxnew file mode 100644index 00000000..1d8b7d31--- /dev/null+++ b/site/src/app/cut/app/(home)/onboarding/page.tsx@@ -0,0 +1,22 @@+"use client";++import { Suspense, useEffect } from "react";++import { ProjectsHome } from "@/cut/components/ProjectsHome";+import { openOnboarding } from "@/cut/lib/onboarding";++// The welcome sequence's own address. The sequence is a full-window overlay+// mounted in the app shell, so this route asks for it and renders the app home+// underneath — the same thing that's behind it everywhere else, and where the+// user lands when it closes.+export default function OnboardingPage() {+ useEffect(() => {+ openOnboarding();+ }, []);++ return (+ <Suspense>+ <ProjectsHome />+ </Suspense>+ );+}diff --git a/site/src/cut/components/onboarding/CheckBullet.tsx b/site/src/cut/components/onboarding/CheckBullet.tsxnew file mode 100644index 00000000..54014219--- /dev/null+++ b/site/src/cut/components/onboarding/CheckBullet.tsx@@ -0,0 +1,11 @@+import { Check } from "lucide-react";++// The landing's list marker: a ringed check, black on white, whatever colour+// the card behind it is. Shared by the slides that list what you get.+export function CheckBullet() {+ return (+ <span className="inline-flex size-6 shrink-0 items-center justify-center rounded-full border-2 border-ink bg-white">+ <Check size={14} />+ </span>+ );+}diff --git a/site/src/cut/components/onboarding/CutOnboarding.tsx b/site/src/cut/components/onboarding/CutOnboarding.tsxindex ab5cce44..2c7c587f 100644--- a/site/src/cut/components/onboarding/CutOnboarding.tsx+++ b/site/src/cut/components/onboarding/CutOnboarding.tsx@@ -7,11 +7,17 @@ import { Button } from "@/components/ui/button";import { AiChatSlide } from "@/cut/components/onboarding/slides/AiChat";import { CreditsSlide } from "@/cut/components/onboarding/slides/Credits";import { ModesSlide } from "@/cut/components/onboarding/slides/Modes";+import { PlansSlide } from "@/cut/components/onboarding/slides/Plans";import { ReferralSlide } from "@/cut/components/onboarding/slides/Referral";import { WelcomeSlide } from "@/cut/components/onboarding/slides/Welcome";+import { useCutBase } from "@/cut/lib/nav";import { onOpenOnboarding } from "@/cut/lib/onboarding";import { track } from "@/lib/analytics";-import type { OnboardingRun, ReferralSource } from "@/lib/onboarding/sequence";+import {+ ONBOARDING_VERSION,+ type OnboardingRun,+ type ReferralSource,+} from "@/lib/onboarding/sequence";import { cn } from "@/lib/utils";import {needsOnboarding,@@ -19,91 +25,160 @@ import {useSaveOnboarding,} from "@/queries/onboarding";-const SLIDE_COUNT = 5;+const SLIDE_COUNT = 6;++// The sequence version this browser last finished. It exists so a returning+// load paints the app immediately instead of covering it while the account+// read is in flight; the account row stays the source of truth, and a browser+// that has never finished waits the one request out.+const DONE_KEY = "cut-onboarding-done";++const doneHere = (): boolean =>+ typeof window !== "undefined" &&+ Number(localStorage.getItem(DONE_KEY) ?? 0) >= ONBOARDING_VERSION;// The welcome sequence: five slides over the whole window, shown once to a new// account and again whenever settings asks to replay it. Mounted in the Cut app// shell, above the connect gate, so a first run is the first thing an account-// sees and the gate is waiting underneath when it ends.+// sees and the gate is waiting underneath when it ends. A first run is also the+// first thing it sees: the surface stays covered until the account read says+// whether the sequence is owed, rather than painting the app and taking it back.//// The sequence reads state, it doesn't create it. Credits were granted at// signup (src/lib/onboarding/signup-grants.ts) and the backend is picked by the// connect gate; nothing here grants, switches, or configures anything. The one// thing it writes is what it asks for: where the account heard about us.export function CutOnboarding() {- const { data: state } = useOnboardingState();+ const base = useCutBase();+ const { data: state, isPending } = useOnboardingState();const save = useSaveOnboarding();- const [run, setRun] = useState<OnboardingRun | null>(null);const [step, setStep] = useState(0);- const [referral, setReferral] = useState<ReferralSource | null>(null);- // A first run opens once per page load, and only for an account that hasn't- // finished this sequence.- const autoOpened = useRef(false);- const answerTimer = useRef<number | null>(null);-- const clearAnswerTimer = () => {- if (answerTimer.current !== null) window.clearTimeout(answerTimer.current);- answerTimer.current = null;- };- useEffect(() => clearAnswerTimer, []);+ const [referrals, setReferrals] = useState<ReferralSource[]>([]);+ const [dismissed, setDismissed] = useState(false);+ const [replaying, setReplaying] = useState(false);+ // Read once per mount: whether this browser can skip the wait below.+ const [skipWait] = useState(doneHere);+ // What the account already has, so leaving the question without changing+ // anything writes nothing.+ const savedReferrals = useRef("");- const start = useCallback((source: OnboardingRun) => {- setRun(source);- setStep(0);- setReferral(null);- track("onboarding_started", { source });- }, []);+ // Which run is on screen, derived rather than set: the account read landing+ // is what opens a first run, and nothing has to push that into state.+ const run: OnboardingRun | null = replaying+ ? "replay"+ : !dismissed && needsOnboarding(state)+ ? "first_run"+ : null;++ useEffect(() => {+ if (run) track("onboarding_started", { source: run });+ }, [run]);++ // While the sequence is up, the address says so — it can be linked, reloaded,+ // and read off the bar wherever it was opened from. This rewrites the address+ // rather than navigating: the page underneath is already the right one, and+ // routing away would tear down the overlay showing over it. Closing puts back+ // the address the user arrived with.+ useEffect(() => {+ if (!run) return;+ const target = `${base}/onboarding`;+ const here = window.location.pathname + window.location.search;+ const back = here.startsWith(target) ? base : here;+ if (here !== target) window.history.replaceState(null, "", target);+ return () => {+ if (window.location.pathname === target) {+ window.history.replaceState(null, "", back);+ }+ };+ }, [run, base]);+ // An account that's already done teaches this browser to stop waiting.useEffect(() => {- if (autoOpened.current || !needsOnboarding(state)) return;- autoOpened.current = true;- start("first_run");- }, [state, start]);+ if (!state || needsOnboarding(state)) return;+ localStorage.setItem(DONE_KEY, String(state.version));+ }, [state]);++ useEffect(+ () =>+ onOpenOnboarding(() => {+ setStep(0);+ setReferrals([]);+ setReplaying(true);+ }),+ [],+ );- useEffect(() => onOpenOnboarding(() => start("replay")), [start]);+ // The answers go up when the sequence leaves the question, so picking several+ // is one write rather than one per tap. Every way out passes through here.+ const commitReferrals = useCallback(() => {+ const signature = [...referrals].sort().join(",");+ if (!referrals.length || signature === savedReferrals.current) return;+ savedReferrals.current = signature;+ track("onboarding_referral_selected", { referralSources: referrals });+ save.mutate({ referralSources: referrals });+ }, [referrals, save]);const finish = useCallback((skipped: boolean) => {if (!run) return;- clearAnswerTimer();+ commitReferrals();track("onboarding_completed", { source: run, skipped, step });save.mutate({ completed: true, skipped });- setRun(null);+ localStorage.setItem(DONE_KEY, String(ONBOARDING_VERSION));+ setReplaying(false);+ setDismissed(true);},- [run, save, step],+ [commitReferrals, run, save, step],);- const back = useCallback(() => setStep((s) => Math.max(0, s - 1)), []);- // Past the last slide is the end of the sequence, so one call covers both the- // Next button and Get started.+ const back = useCallback(() => {+ commitReferrals();+ setStep((s) => Math.max(0, s - 1));+ }, [commitReferrals]);const advance = useCallback(() => {- if (step >= SLIDE_COUNT - 1) finish(false);- else setStep(step + 1);- }, [step, finish]);+ commitReferrals();+ // The last slide is the plans slide, and it ends the sequence through its+ // own two answers — Get Pro, or continue free. Arrowing or Entering past it+ // would be a third, silent one, so forward stops here.+ if (step >= SLIDE_COUNT - 1) return;+ setStep(step + 1);+ }, [commitReferrals, step]);useEffect(() => {if (!run) return;const onKey = (event: KeyboardEvent) => {if (event.key === "Escape") return finish(true);if (event.key === "ArrowLeft") return back();- if (event.key === "ArrowRight" || event.key === "Enter") return advance();+ if (event.key === "ArrowRight") return advance();+ if (event.key !== "Enter") return;+ // Enter on a focused control belongs to that control: the browser is+ // about to dispatch its click. Advancing here as well would run both —+ // picking a referral source and leaving the slide in the same keystroke,+ // which is what made the multi-select unusable from the keyboard, and+ // turning Enter on Back into a step forward and back that nets nothing.+ const target = event.target as HTMLElement | null;+ if (target?.closest("button, a, input, select, textarea, [role='button']")) return;+ advance();};window.addEventListener("keydown", onKey);return () => window.removeEventListener("keydown", onKey);}, [run, back, advance, finish]);- if (!run) return null;-- // The answer saves on the click; the sequence moves on a beat later, so the- // row gets to show it landed rather than vanishing under the next slide.- // Tied to the click, not to the slide, so coming back to change an answer- // doesn't bounce forward again.- const selectReferral = (source: ReferralSource) => {- setReferral(source);- track("onboarding_referral_selected", { referralSource: source });- save.mutate({ referralSource: source });- clearAnswerTimer();- answerTimer.current = window.setTimeout(advance, 220);+ // Between the session landing and the account read answering, an account that+ // turns out to need the sequence would otherwise watch the app paint and then+ // be covered. Hold the surface for that one request — only for a browser with+ // no record of finishing, so it isn't a wait everyone pays on every load.+ if (!run) {+ const waiting = isPending && !skipWait;+ return waiting ? <div className="fixed inset-0 z-[80] bg-white" /> : null;+ }++ const toggleReferral = (source: ReferralSource) => {+ setReferrals((current) =>+ current.includes(source)+ ? current.filter((s) => s !== source)+ : [...current, source],+ );};const last = step === SLIDE_COUNT - 1;@@ -115,29 +190,38 @@ export function CutOnboarding() {aria-label="Welcome to Donkey Cut"className="fixed inset-0 z-[80] flex flex-col bg-cream font-system text-ink antialiased">- <div className="flex shrink-0 items-center justify-between px-6 py-5 md:px-10">- <span className="text-[15px] font-semibold tracking-[-0.01em]">Donkey Cut</span>- <button- type="button"- onClick={() => finish(true)}- className="rounded-full px-3 py-1.5 text-[14px] text-[#454545] transition-colors hover:bg-ink/5"- >- Skip- </button>+ <div className="flex shrink-0 items-center px-6 py-2 md:px-10 md:py-2.5">+ {/* The landing nav's lockup, same icon box and wordmark size. */}+ <span className="flex items-center gap-0">+ <span className="flex size-[59px] shrink-0 items-center justify-center overflow-hidden rounded-[10px]">+ <img+ src="/donkey-logo.svg"+ alt=""+ width={59}+ height={59}+ className="block h-full w-full object-contain"+ />+ </span>+ <span className="text-2xl font-semibold">Donkey Cut</span>+ </span></div>- {/* Auto margins rather than items-center: a slide taller than the window- scrolls from its top instead of having it clipped away. */}- <div className="flex min-h-0 flex-1 overflow-y-auto px-6 py-4 md:px-10">- <div className="m-auto w-full max-w-[1100px]">+ {/* Slides sit high rather than centered: the spacers split the free space+ one part above to three below. They collapse first, so a slide taller+ than the window scrolls from its top instead of being clipped. */}+ <div className="flex min-h-0 flex-1 flex-col overflow-x-hidden overflow-y-auto px-6 py-4 md:px-10">+ <div aria-hidden className="min-h-4 flex-[1]" />+ <div className="mx-auto w-full max-w-[1100px]">{step === 0 && <WelcomeSlide />}{step === 1 && (- <ReferralSlide selected={referral} onSelect={selectReferral} />+ <ReferralSlide selected={referrals} onToggle={toggleReferral} />)}{step === 2 && <ModesSlide />}- {step === 3 && <CreditsSlide run={run} />}+ {step === 3 && <CreditsSlide />}{step === 4 && <AiChatSlide />}+ {step === 5 && <PlansSlide onSkipPro={() => finish(false)} />}</div>+ <div aria-hidden className="flex-[3]" /></div><div className="flex shrink-0 items-center justify-between gap-4 px-6 py-5 md:px-10">@@ -161,12 +245,17 @@ export function CutOnboarding() {))}</div>+ {/* The last slide carries its own two ways out — Get Pro, or continue+ free — so the footer keeps only the space, not a third button. */}<ButtononClick={advance}- className="gap-1.5 rounded-full bg-ink px-5 text-white hover:bg-ink/90"+ className={cn(+ "gap-1.5 rounded-full bg-ink px-5 text-white hover:bg-ink/90",+ last && "invisible",+ )}>- {last ? "Get started" : "Next"}- {!last && <ArrowRight className="size-4" />}+ Next+ <ArrowRight className="size-4" /></Button></div></div>diff --git a/site/src/cut/components/onboarding/confetti.ts b/site/src/cut/components/onboarding/confetti.tsindex 7b6fe27e..1826b348 100644--- a/site/src/cut/components/onboarding/confetti.ts+++ b/site/src/cut/components/onboarding/confetti.ts@@ -23,7 +23,7 @@ type Piece = {* the caller's cleanup; a burst also stops on its own once every piece has* fallen past the bottom. No-op under prefers-reduced-motion, where a screenful* of moving paper is the last thing anyone wants. */-export function burstConfetti(canvas: HTMLCanvasElement, count = 130): () => void {+export function burstConfetti(canvas: HTMLCanvasElement): () => void {if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {return () => {};}@@ -36,18 +36,24 @@ export function burstConfetti(canvas: HTMLCanvasElement, count = 130): () => voicanvas.height = Math.round(height * ratio);context.scale(ratio, ratio);+ // Enough pieces to fill the window it's actually covering: a fixed count+ // reads as a shower on a laptop and as a drizzle on a large display.+ const count = Math.round(Math.min(260, Math.max(120, width / 7)));+ // Launch speed scales with the window too, so the burst reaches the edges of+ // a large display instead of hanging around the middle.+ const reach = Math.min(2.4, Math.max(1, width / 900));const originX = width / 2;const originY = height * 0.38;const pieces: Piece[] = Array.from({ length: count }, (_, i) => {// Spread the launch angles evenly and jitter each one, so the burst reads// as a ring rather than a stripe.const angle = (i / count) * Math.PI * 2 + Math.random() * 0.4;- const speed = 3 + Math.random() * 5;+ const speed = (3 + Math.random() * 5) * reach;return {x: originX,y: originY,vx: Math.cos(angle) * speed,- vy: Math.sin(angle) * speed - 3,+ vy: Math.sin(angle) * speed - 3 * reach,w: 5 + Math.random() * 5,h: 8 + Math.random() * 6,rotation: Math.random() * Math.PI,diff --git a/site/src/cut/components/onboarding/slides/AiChat.tsx b/site/src/cut/components/onboarding/slides/AiChat.tsxindex 3d7b7859..d7af528a 100644--- a/site/src/cut/components/onboarding/slides/AiChat.tsx+++ b/site/src/cut/components/onboarding/slides/AiChat.tsx@@ -2,27 +2,66 @@import { EditorMock } from "@/cut/components/editor-mock/EditorMock";+// The one slide that uses the whole window rather than the sequence's reading+// column. The editor is the layout — the slide is exactly as tall as the mock,+// so there's no dead band above or below it — and the copy is laid over its+// left side. Two things keep that legible, and both are needed: the mock's own+// left half dissolves into the cream, and a cream scrim under the copy holds+// the contrast wherever the mock's edge lands at a given window size.export function AiChatSlide() {return (- <div className="mx-auto grid w-full max-w-[900px] items-center gap-10 md:grid-cols-[minmax(0,1fr)_auto]">- <div>- <h2 className="text-[clamp(26px,3.4vw,36px)] leading-[1.1] font-semibold tracking-[-0.02em]">- Tell it what to change- </h2>- <p className="mt-4 text-[16.5px] leading-[1.55] text-[#454545]">- The chat sits inside the editor with full access to your project. It- can cut clips, generate the shot you're missing, write and read- subtitles, add voiceover, and render the export — and you can ask it- about your footage instead.- </p>- <p className="mt-4 text-[16.5px] leading-[1.55] text-[#454545]">- It runs on Gemini Flash out of the box, or on your own Claude or Codex- subscription if you already pay for one.- </p>+ <div className="relative left-1/2 w-screen -translate-x-1/2 px-6 md:px-10">+ {/* Capped and centered, so a very wide window doesn't leave the copy+ stranded on one edge and the editor on the other. */}+ <div className="mx-auto hidden max-w-[1680px] md:block">+ {/* Copy and scrim are positioned against the mock, not the slide, so+ the composition holds the same proportions however wide the window+ gets — the editor can't drift away from the words. */}+ {/* Centered, and capped by height as well as width: the mock is 1.24×+ as wide as it is tall, so a short window has to bound it or it runs+ past the bottom of the slide. */}+ <div className="relative mx-auto w-[min(100%,86vh)]">+ <div className="pointer-events-none [mask-image:linear-gradient(to_right,transparent_10%,black_70%)] [-webkit-mask-image:linear-gradient(to_right,transparent_10%,black_70%)]">+ <EditorMock view="ai" showSwitcher={false} shadow={false} />+ </div>+ <div className="pointer-events-none absolute inset-y-0 left-0 w-[64%] bg-gradient-to-r from-cream via-cream/85 to-transparent" />+ <div className="absolute top-[15%] left-0 z-10 w-[48%] min-w-[320px]">+ <Copy />+ </div>+ </div></div>- <div className="h-[min(52vh,420px)]">- <EditorMock view="ai" fit="height" showSwitcher={false} />++ {/* Narrow windows stack instead: the copy, then the editor at its own+ size, with nothing overlapping it. */}+ <div className="md:hidden">+ <div className="mx-auto max-w-[560px]">+ <Copy />+ </div>+ {/* Edge to edge: the slide's own padding is cancelled so the editor+ uses the whole width it has down here. */}+ <div className="-mx-6 mt-8">+ <EditorMock view="ai" showSwitcher={false} shadow={false} />+ </div></div></div>);}++function Copy() {+ return (+ <div className="max-w-[620px]">+ <h2 className="text-[clamp(26px,3.2vw,38px)] leading-[1.05] font-semibold tracking-[-0.02em]">+ Chat with your editor.+ </h2>+ <p className="mt-5 text-[16.5px] leading-[1.55] text-[#454545]">+ The AI has access to your entire project. Ask it to trim clips, generate+ missing shots, write subtitles, add voiceovers, rearrange your timeline,+ or answer questions about your footage.+ </p>+ <p className="mt-4 text-[16.5px] leading-[1.55] text-[#454545]">+ Works out of the box with Gemini, or use your own Claude or Codex+ subscription.+ </p>+ </div>+ );+}diff --git a/site/src/cut/components/onboarding/slides/Credits.tsx b/site/src/cut/components/onboarding/slides/Credits.tsxindex 4b6e7699..4a9ad412 100644--- a/site/src/cut/components/onboarding/slides/Credits.tsx+++ b/site/src/cut/components/onboarding/slides/Credits.tsx@@ -3,51 +3,50 @@import { useEffect, useRef } from "react";import { burstConfetti } from "@/cut/components/onboarding/confetti";-import { formatUsd } from "@/lib/credits/format-usd";-import { signupAppCredits, type OnboardingRun } from "@/lib/onboarding/sequence";-import { useCreditBalance } from "@/queries/credits";+import { signupAppCredits } from "@/lib/onboarding/sequence";// The signup grant already landed when the account was created, so this slide-// never grants anything — it shows what is there. A first run celebrates it; a-// replay is a balance check, without the confetti or the news framing.-export function CreditsSlide({ run }: { run: OnboardingRun }) {+// never grants anything — it says what's there. That's as true on a replay as+// on a first run, so the words don't change between them; the burst fires every+// time the slide is reached.+export function CreditsSlide() {const canvasRef = useRef<HTMLCanvasElement>(null);- const { data: balance } = useCreditBalance();- const firstRun = run === "first_run";useEffect(() => {const canvas = canvasRef.current;- if (!canvas || !firstRun) return;+ if (!canvas) return;return burstConfetti(canvas);- }, [firstRun]);+ }, []);return (<div className="relative flex flex-col items-center text-center">{/* Fixed to the window: the burst covers the whole overlay and, being out- of flow, can't stretch the slide's scroll area. */}- {firstRun && (- <canvas ref={canvasRef} aria-hidden className="pointer-events-none fixed inset-0" />- )}- <div className="relative max-w-[560px]">- <div className="text-[clamp(56px,9vw,96px)] leading-none font-semibold tracking-[-0.03em] text-coral tabular-nums">- {formatUsd(signupAppCredits)}- </div>- <h2 className="mt-5 text-[clamp(24px,3.2vw,34px)] leading-[1.1] font-semibold tracking-[-0.02em]">- {firstRun ? "In AI credits, on the house" : "Your AI credits"}+ of flow, can't stretch the slide's scroll area. The explicit size is+ load-bearing — a canvas left to `auto` takes its 300×150 intrinsic+ size rather than the inset box. */}+ <canvas+ ref={canvasRef}+ aria-hidden+ className="pointer-events-none fixed inset-0 h-full w-full"+ />+ <div className="relative max-w-[900px]">+ {/* One line, two sizes: the amount at display size in coral, the words+ a couple of steps down and thin beside it. Cents belong on a+ balance, not on the offer. */}+ <h2 className="flex flex-wrap items-baseline justify-center gap-x-4 leading-[1.02] tracking-[-0.03em]">+ <span className="text-[clamp(40px,7.4vw,84px)] font-semibold text-coral tabular-nums">+ ${signupAppCredits}+ </span>+ <span className="text-[clamp(26px,4.4vw,52px)] font-light">+ in AI credits is on us+ </span></h2>- <p className="mt-4 text-[16px] leading-[1.55] text-[#454545]">- {firstRun- ? "Already in your account — nothing to claim. Spend it on generated images, video, voiceover, and music, right inside the timeline."- : "Credits pay for generated images, video, voiceover, and music. Top up any time from Settings → Billing."}+ {/* Ragged right on a narrow measure: the line breaks stay put instead+ of the last line floating in the middle of the slide. */}+ <p className="mx-auto mt-4 max-w-[460px] text-left text-[16px] leading-[1.55] text-[#454545]">+ Already in your account — nothing to claim. Spend it on generated+ video, audio and images.</p>- {balance?.balance && (- <p className="mt-6 text-[14px] text-[#454545]">- Balance today:{" "}- <span className="font-medium text-ink tabular-nums">- {formatUsd(balance.balance)}- </span>- </p>- )}</div></div>);diff --git a/site/src/cut/components/onboarding/slides/Modes.tsx b/site/src/cut/components/onboarding/slides/Modes.tsxindex cbeb32c0..2cea410c 100644--- a/site/src/cut/components/onboarding/slides/Modes.tsx+++ b/site/src/cut/components/onboarding/slides/Modes.tsx@@ -2,42 +2,42 @@import { Cloud, Laptop } from "lucide-react";+import { TapedCard } from "@/app/_components/landing/LandingPrimitives";+import { CheckBullet } from "@/cut/components/onboarding/CheckBullet";+export function ModesSlide() {return (- <div className="mx-auto w-full max-w-[880px]">- <h2 className="text-center text-[clamp(26px,3.4vw,36px)] leading-[1.1] font-semibold tracking-[-0.02em]">- Two places to work+ <div className="mx-auto w-full max-w-[760px]">+ <h2 className="text-center text-[clamp(24px,3vw,32px)] leading-[1.1] font-semibold tracking-[-0.02em]">+ Works in the cloud or on your Mac</h2>- <p className="mx-auto mt-3 max-w-[560px] text-center text-[16px] leading-[1.5] text-[#454545]">- Donkey Cut edits in the cloud or on your own machine, and the editor is- the same either way.+ <p className="mx-auto mt-3 max-w-[560px] text-center text-[16px] leading-[1.5] text-[#454545] italic">+ Same editor. Choose what works for you.</p>- <div className="mt-9 grid gap-4 md:grid-cols-2">+ {/* The landing's taped cards, so the two places to work are framed the+ same way the site frames everything else. */}+ <div className="mt-10 grid gap-5 md:grid-cols-2"><Modeicon={<Cloud className="size-5" />}title="In the cloud"- points={[- "Any browser, any OS, nothing to install",- "Projects and media stored for you",- "Exports rendered by our workers",- ]}+ tape="coral"+ points={["No install", "Works in any browser", "We handle rendering"]}/><Modeicon={<Laptop className="size-5" />}title="On your Mac"+ tape="yellow"points={[- "The Donkey app, macOS only",- "Footage stays in your own file system",- "Free on-device speech-to-text, and exports on your hardware",+ "Your files stay local",+ "Uses your Mac's hardware",+ "Faster exports & AI features",]}/></div>- <p className="mx-auto mt-7 max-w-[560px] text-center text-[15px] leading-[1.5] text-[#454545]">- Nothing to choose now. Donkey Cut works locally whenever the Mac app is- running and in the cloud when it isn't — each project remembers- where it lives, and you can move between them any time.+ <p className="mt-9 text-center text-[15px] leading-[1.5] text-[#454545]">+ Automatically switches between cloud and local when available.</p></div>);@@ -45,32 +45,38 @@ export function ModesSlide() {function Mode({icon,- title,points,+ tape,+ title,}: {icon: React.ReactNode;- title: string;points: string[];+ tape: "coral" | "yellow";+ title: string;}) {return (- <div className="rounded-2xl border border-ink/10 bg-white p-6">- <div className="flex items-center gap-2.5">- <span className="grid size-9 place-items-center rounded-lg bg-ink/5">- {icon}- </span>- <h3 className="text-[17px] font-semibold">{title}</h3>+ <TapedCard color="cream" fill tapeColor={tape} tapePosition="left">+ {/* Deep top and bottom padding on a narrower card, so the pair reads as+ squares rather than banners. */}+ <div className="px-7 py-14">+ <div className="flex items-center gap-2.5">+ <span className="grid size-9 place-items-center rounded-lg border-2 border-ink bg-white">+ {icon}+ </span>+ <h3 className="text-[18px] font-semibold">{title}</h3>+ </div>+ <ul className="mt-5 flex flex-col gap-2.5">+ {points.map((point) => (+ <li+ key={point}+ className="flex items-center gap-2.5 text-[14px] font-semibold"+ >+ <CheckBullet />+ {point}+ </li>+ ))}+ </ul></div>- <ul className="mt-4 flex flex-col gap-2.5">- {points.map((point) => (- <li- key={point}- className="flex gap-2.5 text-[14.5px] leading-[1.45] text-[#454545]"- >- <span className="mt-[7px] size-1.5 shrink-0 rounded-full bg-coral" />- {point}- </li>- ))}- </ul>- </div>+ </TapedCard>);}diff --git a/site/src/cut/components/onboarding/slides/Plans.tsx b/site/src/cut/components/onboarding/slides/Plans.tsxnew file mode 100644index 00000000..5106df6f--- /dev/null+++ b/site/src/cut/components/onboarding/slides/Plans.tsx@@ -0,0 +1,77 @@+"use client";++import { Check } from "lucide-react";++import { TapedCard } from "@/app/_components/landing/LandingPrimitives";+import { CUT_PRO } from "@/app/cut/_components/landing/cutPricingPlans";+import { Button } from "@/components/ui/button";+import { useUpgradeToPro } from "@/cut/lib/proUpgrade";++// The sequence's last word: Pro is the offer, free is the default, and the+// benefits sit in the card so nobody has to take the price on faith. It's the+// landing's own Pro card — same taped coral frame, same ringed check bullets —+// so the offer looks the same wherever it's met. Checkout is the one the+// storage wall and the billing page start.+export function PlansSlide({ onSkipPro }: { onSkipPro: () => void }) {+ const pro = useUpgradeToPro();++ return (+ <div className="mx-auto w-full max-w-[520px]">+ <h2 className="text-center text-[clamp(24px,3vw,32px)] leading-[1.1] font-semibold tracking-[-0.02em]">+ Simple pricing+ </h2>+ <p className="mt-3 text-center text-[16px] text-[#454545]">+ The editor is free. Pay only for AI generated media.+ </p>++ <div className="mt-8">+ <TapedCard color="coral" tapeColor="yellow" tapePosition="right">+ <div className="p-7 md:p-9">+ <div className="text-[22px] font-semibold">Pro</div>+ <div className="mt-4 text-[clamp(34px,4.4vw,48px)] leading-[0.95] font-semibold">+ {CUT_PRO.price}+ </div>+ <div className="mt-2.5 text-[13px] font-semibold text-[#201715]">+ For individuals+ </div>+ <p className="mt-5 text-[15px] leading-[1.55] text-[#1a1a1a]">+ {CUT_PRO.body}+ </p>++ <div className="mt-6 grid gap-2.5">+ {CUT_PRO.features.map((feature) => (+ <div+ key={feature}+ className="flex items-center gap-2.5 text-[14px] font-semibold"+ >+ <span className="inline-flex size-6 shrink-0 items-center justify-center rounded-full border-2 border-ink bg-white">+ <Check size={14} />+ </span>+ {feature}+ </div>+ ))}+ </div>++ <Button+ onClick={pro.start}+ disabled={pro.isPending}+ className="mt-7 h-11 rounded-full bg-ink px-6 text-[15px] text-white hover:bg-ink/90"+ >+ Get Pro+ </Button>+ </div>+ </TapedCard>+ </div>++ <div className="mt-5 text-right">+ <button+ type="button"+ onClick={onSkipPro}+ className="text-[15px] text-[#454545] underline-offset-4 transition-colors hover:text-ink hover:underline"+ >+ Continue free+ </button>+ </div>+ </div>+ );+}diff --git a/site/src/cut/components/onboarding/slides/Referral.tsx b/site/src/cut/components/onboarding/slides/Referral.tsxindex 227f15c4..b28b2ff7 100644--- a/site/src/cut/components/onboarding/slides/Referral.tsx+++ b/site/src/cut/components/onboarding/slides/Referral.tsx@@ -1,41 +1,58 @@"use client";-import { Check } from "lucide-react";+import type { ReactNode } from "react";+import { Check, Search, Users } from "lucide-react";import { REFERRAL_SOURCES, type ReferralSource } from "@/lib/onboarding/sequence";import { cn } from "@/lib/utils";+// The brand marks are files (public/cut/onboarding), the generic answers are+// icons; both render in the same box so every row lines up.+const MARKS: Record<ReferralSource, ReactNode> = {+ discord: <BrandMark src="/cut/onboarding/discord.svg" />,+ tiktok: <BrandMark src="/cut/onboarding/tiktok.svg" />,+ instagram: <BrandMark src="/cut/onboarding/instagram.svg" />,+ youtube: <BrandMark src="/cut/onboarding/youtube.svg" />,+ search: <Search className="size-[18px]" />,+ friend: <Users className="size-[18px]" />,+};+type Props = {- selected: ReferralSource | null;- onSelect: (source: ReferralSource) => void;+ selected: ReferralSource[];+ onToggle: (source: ReferralSource) => void;};-export function ReferralSlide({ selected, onSelect }: Props) {+export function ReferralSlide({ selected, onToggle }: Props) {return (<div className="mx-auto w-full max-w-[440px]">- <h2 className="text-center text-[clamp(26px,3.4vw,36px)] leading-[1.1] font-semibold tracking-[-0.02em]">+ <h2 className="text-center text-[clamp(24px,3vw,32px)] leading-[1.1] font-semibold tracking-[-0.02em]">How did you hear about us?</h2><p className="mt-3 text-center text-[16px] text-[#454545]">- It tells us where to show up next.+ Pick as many as apply — it tells us where to show up next.</p><div className="mt-8 flex flex-col gap-2">{REFERRAL_SOURCES.map((source) => {- const active = selected === source.id;+ const active = selected.includes(source.id);return (<buttonkey={source.id}type="button"- onClick={() => onSelect(source.id)}+ onClick={() => onToggle(source.id)}aria-pressed={active}className={cn(- "flex items-center justify-between rounded-xl border px-4 py-3.5 text-left text-[15px] font-medium transition-colors",+ // Selection is a border and a check, not a filled row: the+ // brand marks keep their own colors and stay legible.+ "flex items-center gap-3 rounded-xl border bg-white px-4 py-3.5 text-left text-[15px] font-medium transition-colors",active- ? "border-ink bg-ink text-white"- : "border-ink/15 bg-white hover:border-ink/40",+ ? "border-ink ring-1 ring-ink"+ : "border-ink/15 hover:border-ink/40",)}>- {source.label}+ <span className="grid size-5 shrink-0 place-items-center">+ {MARKS[source.id]}+ </span>+ <span className="flex-1">{source.label}</span><Check className={cn("size-4", active ? "opacity-100" : "opacity-0")} /></button>);@@ -44,3 +61,9 @@ export function ReferralSlide({ selected, onSelect }: Props) {</div>);}++function BrandMark({ src }: { src: string }) {+ return (+ <img src={src} alt="" width={18} height={18} className="block size-[18px]" />+ );+}diff --git a/site/src/cut/components/onboarding/slides/Welcome.tsx b/site/src/cut/components/onboarding/slides/Welcome.tsxindex 11d1faf9..74b27175 100644--- a/site/src/cut/components/onboarding/slides/Welcome.tsx+++ b/site/src/cut/components/onboarding/slides/Welcome.tsx@@ -5,17 +5,20 @@ import { EditorMock } from "@/cut/components/editor-mock/EditorMock";export function WelcomeSlide() {return (<div className="flex flex-col items-center gap-9 text-center">- <div className="max-w-[700px]">- <h2 className="text-[clamp(30px,4.4vw,46px)] leading-[1.02] font-semibold tracking-[-0.02em]">- Welcome to Donkey Cut+ {/* Sized to hold the headline on one line: the clamp's vw term shrinks it+ with the window rather than letting it wrap. */}+ <div className="max-w-[860px]">+ <h2 className="text-[clamp(22px,3.1vw,34px)] leading-[1.1] font-semibold tracking-[-0.02em]">+ The AI video editor that works anywhere.</h2><p className="mt-4 text-[17px] leading-[1.55] text-[#454545]">- A video editor that runs in your browser, generates the shots you- don't have, and does the heavy lifting on your own Mac.+ Chat to edit videos. Generate the shots you don't have.</p></div>- <div className="w-full max-w-[840px]">- <EditorMock showSwitcher={false} />+ {/* Contained rather than width-driven: on a short window the mock gives+ up size instead of pushing the slide into a scroll. */}+ <div className="h-[min(56vh,640px)] w-full max-w-[1060px]">+ <EditorMock fit="contain" showSwitcher={false} shadow={false} /></div></div>);