Skip to content

Commit a5b5dde

Browse files
karngyanclaude
andcommitted
feat(site): a second hero action, pointing at the recording
The hero asked for one thing: pipe a script into your shell. The reader who wants to see it work first had no way to get there without scrolling the whole page, and the recording that answers them was already sitting in the Install section. An outline button rather than a filled one, and below the command rather than beside it, because copying the install line is still the thing this page is for. It targets the player on this page rather than /docs/setup, so the question is answered without losing the page. Walkthrough takes an optional id for this; scroll-mt-20 on it clears the sticky header so the jump lands on the player and not under the bar. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 3ca20d6 commit a5b5dde

2 files changed

Lines changed: 37 additions & 5 deletions

File tree

site/src/components/walkthrough.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ import { cn } from '@/lib/utils'
3333
export function Walkthrough({
3434
align = 'left',
3535
className,
36+
id,
3637
}: {
3738
/** Follows the section it lands in, the same way InstallBlock does. */
3839
align?: 'left' | 'center'
3940
className?: string
41+
/** Set when something on the page links to the player. */
42+
id?: string
4043
}) {
4144
return (
42-
<figure className={className}>
45+
<figure id={id} className={className}>
4346
<div className="relative aspect-video overflow-hidden rounded-xl bg-zinc-950 ring-1 ring-zinc-950/10 dark:ring-white/10">
4447
<MuxPlayer
4548
playbackId={WALKTHROUGH_PLAYBACK_ID}

site/src/routes/index.tsx

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import { Fragment } from 'react'
22
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'
44

55
import { CopyCommand } from '@/components/copy-command'
66
import { FleetWindow, PhoneFrame } from '@/components/mock/fleet'
77
import { SwitcherWindow } from '@/components/mock/switcher'
88
import { MockTerminal, ok, output, prompt } from '@/components/mock/terminal'
99
import { SiteFooter } from '@/components/site-footer'
1010
import { SiteHeader } from '@/components/site-header'
11+
import { Button } from '@/components/ui/button'
1112
import { Walkthrough } from '@/components/walkthrough'
1213
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'
1415

1516
export const Route = createFileRoute('/')({
1617
component: Home,
@@ -138,6 +139,29 @@ function InstallBlock({ align = 'left' }: { align?: 'left' | 'center' }) {
138139
)
139140
}
140141

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+
141165
/**
142166
* The two halves of the claim in one picture: the fleet on a machine, and the
143167
* ringed row of it open on a phone. They sit beside each other rather than
@@ -175,6 +199,7 @@ function Hero() {
175199
<div className="w-full">
176200
<InstallBlock align="center" />
177201
</div>
202+
<WatchWalkthrough />
178203
</div>
179204
<div className="mt-16 lg:mt-20">
180205
<ProofMock />
@@ -445,8 +470,12 @@ function Install() {
445470
{/* Full width, the way the switcher above sits full width in a
446471
section that is otherwise columns. The caption is centred with
447472
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" />
450479
<div className="w-full">
451480
<InstallBlock align="center" />
452481
</div>

0 commit comments

Comments
 (0)