Skip to content

Homepage: give the feature tabs motion of their own - #1207

Merged
ngnijland merged 5 commits into
masterfrom
claude/homepage-feature-tabs-motion
Oct 9, 2026
Merged

ngnijland merged 5 commits into
masterfrom
claude/homepage-feature-tabs-motion

Conversation

@ngnijland

@ngnijland ngnijland commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The feature tabs (Agentic Coding, Network, Testing and Teams chapters) get their own motion and look, separate from the highlights gallery and the closer-look window.

  • Inset media on a blurred copy. A blurred copy of the media fills the whole stage, and the media (images and videos) sits inset on it with rounded corners, instead of a glow only around its edges.
  • Focus zoom. While an image tab shows, the image zooms slowly in on the detail its tab talks about: "Copy as cURL" drifts to the cURL entry, "Speed control" to the 3G picker, and so on. Chapter items take an optional focus: { x, y, zoom } (0–1 across and down the image). The image zooms within its own rounded rectangle, which clips it, so the inset stays, and it lands about a second before autoplay moves on. All 14 screenshots in the four chapters have a focus point. A focus on a video fails the build.
  • Directional transitions. The old media slides away, blurs and fades, and the new media comes into focus from the other side. Going forward, the media moves left; going back, it moves right. Autoplay always moves forward.
  • Swipe on touch screens. A sideways swipe on the stage changes tabs. The media follows the finger at half speed and resists past the first and last tab. A short swipe settles back, and vertical swipes still scroll the page (touch-action: pan-y). Mouse drags are left alone.
  • Phone caption slides in from the side the media comes from.
  • Own look. The progress line fills in the chapter's colour (purple, blue, green, yellow). The play/pause button is the gallery's round grey one; its round option is gone, since both now use that style. Unselected tabs' descriptions step back until hovered.
  • Reduced motion keeps today's instant switch, with no zoom and no drag.
  • knip fix. knip's Astro compiler treats a word followed by a backtick as a tagged template and blanks everything up to the next backtick. Once the script had template literals, that hid its imports and flagged autoplay.ts as unused. The template now avoids that pattern, and a comment explains why.

Test plan

  • npm run lint, format:check, typecheck, build, knip in docs/
  • npm test: 94 pass, including new tests for the zoom geometry (focus-zoom.test.js), the swipe decision, and focus resolution and validation
  • Checked on /home-next/ at 1280px and 375px: every focus point lands on its detail, a mid-transition screenshot shows the slide and blur, and simulated touch swipes go forward and back, while short and vertical swipes do nothing
  • Try a real swipe on an iPhone

🤖 Generated with Claude Code

- Images zoom slowly in on the detail their tab describes. Chapter items
  take an optional `focus` (x, y and zoom); the zoom moves the focus to
  the middle of the stage without showing past the image's edges, and
  lands a second before autoplay moves on.
- Changing tabs slides the old media away as it blurs and fades, and
  brings the new media into focus from the other side. Going forward the
  media moves left, the way the tabs read; autoplay always moves forward.
- On touch screens a sideways swipe on the stage changes tabs. The media
  follows the finger, resists past the first and last tab, and settles
  back after a short swipe; vertical swipes still scroll the page.
- The phone caption swaps in from the side the media comes from.
- The progress line fills in the chapter's colour, and the play button
  lights up in it on hover, so the tabs look unlike the gallery.
- The other tabs' descriptions step back until hovered.
- Reduced motion keeps the instant switch, with no zoom or drag.
- Template literals in Tabs.astro no longer end in a word: knip reads
  that as a tagged template and missed the script's imports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ngnijland and others added 4 commits October 7, 2026 22:35
- A blurred copy of the media fills the whole stage, and the media sits
  inset on it with rounded corners, instead of filling the stage with a
  glow only around its edges. Videos inset too.
- An image now zooms within its own rounded rectangle, which clips it, so
  the inset stays while it zooms. The script measures the image to set
  the zoom and the clip.
- Push notifications zooms in less, so the arrow panel stays in view in
  its narrow portrait frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The play, pause and replay button is round, borderless and grey in both
the tabs and the gallery, so the `round` option is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- InsetMedia.astro holds the media that sits inset on a full-frame
  backdrop, shrinking to fit so its rounded corners sit on its own
  edges. The gallery and the tabs both use it instead of each repeating
  the frame, the sizing classes and why they work.
- Tabs: the panel-change animations no longer need an ID to spare the
  focus zoom, which is a transition on the image inside. The swipe keeps
  how far the media followed the finger instead of reading it back from
  the style, and checks the first and last tab directly. The media to
  animate is looked up once.
- Tabs: the ResizeObserver is disconnected before the tabs set up again,
  since the ClientRouter keeps the script running from page to page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ngnijland
ngnijland enabled auto-merge (squash) October 9, 2026 18:27
@ngnijland
ngnijland merged commit 44c538c into master Oct 9, 2026
1 check passed
@ngnijland
ngnijland deleted the claude/homepage-feature-tabs-motion branch October 9, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant