|
1 | 1 | import { Fragment } from 'react' |
2 | 2 | import { createFileRoute } from '@tanstack/react-router' |
3 | | -import { ArrowRight, Cloud, HardDrive, Lock, Plus, Smartphone } from 'lucide-react' |
| 3 | +import { ArrowRight, Cloud, HardDrive, Lock, Play, Plus, Smartphone } from 'lucide-react' |
4 | 4 |
|
5 | 5 | import { CopyCommand } from '@/components/copy-command' |
6 | 6 | import { FleetWindow, PhoneFrame } from '@/components/mock/fleet' |
7 | 7 | import { SwitcherWindow } from '@/components/mock/switcher' |
8 | 8 | import { MockTerminal, ok, output, prompt } from '@/components/mock/terminal' |
9 | 9 | import { SiteFooter } from '@/components/site-footer' |
10 | 10 | import { SiteHeader } from '@/components/site-header' |
| 11 | +import { Button } from '@/components/ui/button' |
11 | 12 | import { Walkthrough } from '@/components/walkthrough' |
12 | 13 | import { GithubMark } from '@/components/wordmark' |
13 | | -import { BREW_CMD, INSTALL_CMD, REPO_URL } from '@/lib/site' |
| 14 | +import { BREW_CMD, INSTALL_CMD, REPO_URL, WALKTHROUGH_RUNTIME } from '@/lib/site' |
14 | 15 |
|
15 | 16 | export const Route = createFileRoute('/')({ |
16 | 17 | component: Home, |
@@ -138,6 +139,29 @@ function InstallBlock({ align = 'left' }: { align?: 'left' | 'center' }) { |
138 | 139 | ) |
139 | 140 | } |
140 | 141 |
|
| 142 | +/** |
| 143 | + * The hero's second action, and deliberately the quieter one. |
| 144 | + * |
| 145 | + * Copying the install line is the thing this page is for, so the command keeps |
| 146 | + * the loud treatment and this gets an outline. It points at the recording |
| 147 | + * further down the page rather than at /docs/setup: the reader who wants to |
| 148 | + * see it work before running a script into their shell is answered in place, |
| 149 | + * without losing the page they were on. |
| 150 | + */ |
| 151 | +function WatchWalkthrough() { |
| 152 | + return ( |
| 153 | + <Button asChild variant="outline" size="lg" className="mt-8"> |
| 154 | + <a href="#walkthrough"> |
| 155 | + <Play className="size-4" aria-hidden="true" /> |
| 156 | + Watch the setup walkthrough |
| 157 | + <span className="font-mono text-sm tabular-nums text-muted-foreground"> |
| 158 | + {WALKTHROUGH_RUNTIME} |
| 159 | + </span> |
| 160 | + </a> |
| 161 | + </Button> |
| 162 | + ) |
| 163 | +} |
| 164 | + |
141 | 165 | /** |
142 | 166 | * The two halves of the claim in one picture: the fleet on a machine, and the |
143 | 167 | * ringed row of it open on a phone. They sit beside each other rather than |
@@ -175,6 +199,7 @@ function Hero() { |
175 | 199 | <div className="w-full"> |
176 | 200 | <InstallBlock align="center" /> |
177 | 201 | </div> |
| 202 | + <WatchWalkthrough /> |
178 | 203 | </div> |
179 | 204 | <div className="mt-16 lg:mt-20"> |
180 | 205 | <ProofMock /> |
@@ -445,8 +470,12 @@ function Install() { |
445 | 470 | {/* Full width, the way the switcher above sits full width in a |
446 | 471 | section that is otherwise columns. The caption is centred with |
447 | 472 | the rest of this section rather than left aligned, since it is |
448 | | - the only line here that would have read off axis. */} |
449 | | - <Walkthrough align="center" className="mt-10 w-full" /> |
| 473 | + the only line here that would have read off axis. |
| 474 | +
|
| 475 | + The id is the hero button's target, and scroll-mt clears the |
| 476 | + sticky header so the jump lands on the player rather than under |
| 477 | + the bar. */} |
| 478 | + <Walkthrough align="center" id="walkthrough" className="mt-10 w-full scroll-mt-20" /> |
450 | 479 | <div className="w-full"> |
451 | 480 | <InstallBlock align="center" /> |
452 | 481 | </div> |
|
0 commit comments