Back
Back

View Sweep

A page transition for switching a long page between two versions of itself, with a skill so your agent can set it up.

Type
Skill and script
Built on
glimm · View Transitions
Works in
Astro, React, plain HTML
License
MIT

Or see it right here, on this page.

I. The skill

1.1

Getting started

I made it for my portfolio, where case studies have a TL;DR and a detailed version. Swapping them instantly worked, but it read as a glitch: the header stays where it is and only what’s below changes, so on a laptop it looked like nothing happened. The change needed a moment, without turning into a show.

# the wave is drawn by glimm
npm install glimm
# the skill, for any agent
npx skills add jordialmanza-ram/skills --skill view-sweep

The skill lives in my skills repo on GitHub, so you can read every file before adding it. Then ask for the switch you have in mind, in one sentence:

Add a View Sweep to the TL;DR / Detailed switch on my case study pages, in my brand’s warm colours.

The agent reads the skill, copies two files into your project, wires them to your switch, picks the wave’s colours from your styles and checks it frame by frame in a browser. What you get is plain TypeScript and CSS.

1.2

What’s in it

SKILL.md
What the agent reads first: when a sweep fits and when it doesn’t, the setup in five steps, the defaults and what each one is for.
view-sweep.ts
The script. One function, createViewSweep(), and one method, run(change, from). You give it the change; it takes care of the rest.
view-sweep.css
How the old and new page snapshots move. Every value is written by the script, frame by frame.
references/
Timing (why each number is what it is), frameworks (Astro, React, plain HTML), colours (a muted palette from your tokens) and checks (how to film it and what to look for).

II. How it moves

2.1

One clock

Three things happen when you press: the page eases back towards your finger, the wave crosses the screen, and the page comes forward again. My first versions ran them as three animations, and they drifted. Sometimes the transition ended before the wave did, and the rest of the page changed at once. Now they all read one clock, every frame.

0s0.5s1s1.5s2s
WavePage eased back

The page starts back with the press and is home exactly when the wave leaves. The transition ends there, when the snapshots already match the live page, so there’s nothing left to jump.

2.2

The details

  • Only snapshots move. The browser takes a picture of the page before and after the change (View Transitions), and the sweep animates those. Animating the live page made the text shimmer when it settled.
  • It starts with the press. The page begins to ease back on the same frame you press, and the wave follows right away. Any pause in between reads as lag.
  • It goes where the change is. The wave travels from the top down, from the switch to the content that changes, so the cause comes before the effect.
  • Navigation comes back last. The section menu at the bottom steps out with the old version and returns once the new one is in. It can’t point at sections that aren’t there yet.
  • Your colours, muted. The wave is a gradient of two to four tones from your palette, kept soft. Bright, saturated waves look like a loading state.
  • It knows when not to run. With reduced motion, without WebGL or without View Transitions, the change happens straight away, and you decide what that looks like.

III. Notes

3.1

About Astro

This site is built with Astro, a framework for content sites. Pages are written like HTML with a little logic on top, and it sends the browser plain HTML and CSS by default; JavaScript only goes where a page needs it, like the sweep on this page. That keeps long case studies light, which is why I picked it. View Sweep doesn’t depend on it, though: it’s a TypeScript module you call from a click.

3.2

Limits and credits

The wave is drawn with glimm by Noman, which does the hard part: a WebGL band with real depth and colour. glimm can also ripple the content itself as the band passes, but that needs HTML-in-Canvas, which only recent Chrome supports and works best on a box of fixed height. For a long page, View Sweep moves the whole page instead, and the content doesn’t bend.

Same-page View Transitions work in Chrome and Edge 111, Safari 18 and Firefox 144. Anywhere else, the switch is instant.


Jordi Almanza, 2026
Crafted with intention

Designed and built in
Monterrey, MX