Photo Vortex

ProScrollShowcase & Media3DWebGLpowered by @vectorvesper/motion

A scroll story about a black hole. Your photos fly into the depth towards a small lit hole, are pulled in at its edge and crumple as they fall, until the hole opens onto your next page. It can follow a slider, a timeline or a scroller of your own instead of the page.

Photo Vortex
Preview of Photo Vortex

Included with membership

Members install Photo Vortex with one command and get the full source, the usage code and the Framer remix, licensed for client work. One membership covers the whole library and the CLI.

When to use it

The opening of a page with a body of images to show: a portfolio, a year in review, a collection, a campaign. It takes over the first stretch of scrolling, so use one a page, at the top. Inside a box rather than the page, drive it with progress from a slider, a timeline or a scroller of your own.

  • Mix shapes freely. Each photo keeps its own, and stays upright the whole way in.
  • Size the files to about 1,000 pixels on the long side at most. Each photo is drawn no bigger than 512 pixels square, so larger files only cost download time.
  • Keep the photos on the page the hole opens onto close to the size they are shown at. That page is first drawn as the hole opens, and on a phone, full-size files can hold up a frame or two there.
  • Give each photo alt text. The photos are hidden from screen readers, which read the alt texts as a list instead.
  • Set exitColor to the background of the page that follows, so the hole opens straight onto it.

Avoid:

  • Do not serve the photos from another origin without CORS. They are drawn in WebGL, which cannot show an image it is not allowed to read.
  • Do not put it inside an element that scrolls without passing progress. On its own it follows the window's scroll, so it would never move.
  • Do not count on more than 24 photos. Any after the 24th are left out.

Props

A scroll story about a black hole. Your photos come out of the dark and fly into the depth towards a small lit hole. At its edge each one is pulled in, narrows to fit and crumples into folds as it falls. At the end the hole opens onto your next page.

<PhotoVortex />

The vortex, its title screen and the page the hole opens onto. On its own it adds its length of scrolling to the page and plays as the window scrolls.

PropTypeDefaultDescription
images(string | PhotoVortexImage)[]—The photos that fall in, up to 24. Each keeps its own shape.
childrenReact.ReactNode—Your page, around the vortex. The first child is the title screen, over the vortex. It is laid out over one screen; give it a height of 100% to place things yourself. As you scroll in, it is pulled down into the hole. Everything after it is the page the hole opens onto, on the exit colour. It is in place the moment the hole has opened, with no scrolling to reach it, and carries on for as long as it is.
lengthnumber500How long the story is, as a percentage of the screen's height: 500 is five screens of scrolling.
progressnumber—Where the story is, 0 to 1, when you drive it yourself: from a slider, a timeline or your own scroller. The vortex then fills its box, so give that a height, and adds no scrolling of its own. Leave it out to play it by scrolling the page.
countnumber16Photos in the air at once, once scrolling has poured them all in. Read when the scene is built.
foldsnumber9How many folds a photo crumples into inside the hole. 0 for none.
exitColorstring"#000000"The light in the hole, and the page it opens onto.
backgroundstring"#000000"The dark around the hole.
onProgress(progress: number) => void—Progress through the story, 0 to 1, whenever it changes.
classNamestring—Class for the outer element.

<PhotoVortexImage />

type

A photo, when you want to give it alt text. A plain URL works too.

PropTypeDefaultDescription
src*string—Image URL. A different origin must allow CORS, since it is drawn into WebGL.
altstring—Read by screen readers.
Visitors who prefer reduced motion get a still page instead: the title, the photos in a grid, and the page the hole opens onto. Nothing moves on its own. Devices below the runtime's floor get the same.
It runs on the shared frame loop, and every photo shares one texture, packed once when the vortex is built. The page that follows shows through the hole rather than being drawn into the scene.
Colours and folds change live. The photos and the number in the air at once are read when the vortex is built, so give it a new key to change those.
Client component. The server renders your title and page as they are, and the vortex builds in the browser.
Back to all components