# Closeup

> Film any part of a web page in close-up, sharp at any size, with a camera that closes in on clicks.

Source: https://cesarvenzac.com/closeup

Package: [@cesarvenzac/closeup](https://www.npmjs.com/package/@cesarvenzac/closeup) 1.3.0 on npm, MIT licence. Source code: https://github.com/cesarvenzac/closeup

```sh
npm install @cesarvenzac/closeup
```

*Live example on the page: Closeup. Film it opens Closeup on the set. Anywhere on this site, ⌥⇧C opens it.* Its source:

```tsx
// Closeup is a package (npm install @cesarvenzac/closeup), loaded only when
// it's wanted. Film it opens it on the set, ready to record.
const film = () =>
  import("@cesarvenzac/closeup").then((closeup) => closeup.open({ pick: set.current }));

// It stays sharp by enlarging the page, not the take: <body> is scaled round
// the pick until the frame fills most of the window, so the browser draws it
// large at the screen's own resolution. The layout doesn't change, only how
// big it's drawn.
body.style.transformOrigin = "0 0";
body.style.transform = `translate(${stage.tx}px, ${stage.ty}px) scale(${stage.scale})`;

// Then this tab is captured and cropped to the frame by Region Capture, so
// Closeup's own controls, outside it, never show. Chromium only, for now.
const stream = await navigator.mediaDevices.getDisplayMedia({ video: true, preferCurrentTab: true });
const [track] = stream.getVideoTracks();
await track.cropTo(await CropTarget.fromElement(frame));

// A button of your own on the finished take, as this site's Save to library is.
closeup.addAction({
  label: "Save to library",
  async run(take, { progress }) {
    await upload(take.blob, progress);
    return "Saved.";
  },
});
```

Closeup films any part of a web page in close-up, sharp at any size: photos and videos of an element or a region, with a drawn cursor that follows your mouse or plays a path you draw, and a camera that pans as you scroll and can close in on each click. Keep a take trimmed, faster or slower, as a video or a GIF.

## Use

```typescript
import { install } from "@cesarvenzac/closeup";

install(); // ⌥⇧C opens and closes it
```

Press ⌥⇧C, point at what to film, and press Record.

## What it does

- **Sharp at any size.** The page is drawn large round your pick before it's filmed, never a small capture blown up.
- **A cursor that's drawn.** Like macOS's, following your mouse, or a path you draw once and play on every take.
- **A camera.** It pans down the page as you scroll and, set to close in, comes in on each click and draws back after.
- **Scripts.** Moves, clicks, typing and scrolling at a hand's pace, kept for each page and exported as JSON.
- **Takes you can keep.** Trimmed, at another speed, as an MP4 or a GIF, and sent anywhere by buttons of your own.

It needs a Chromium browser on a desktop: Chrome, Edge, Arc or Brave. How it stays sharp is in [the Lab](https://cesarvenzac.com/lab/closeup).

Parts of it run [Brume](https://brume.tools): its GIF encoder makes the GIFs of [Video to GIF](https://brume.tools/video-to-gif), and its MP4 fix makes the [screen recorder](https://brume.tools/screen-recorder)'s recordings play everywhere.

## Docs

- [Getting started](https://cesarvenzac.com/closeup/docs/getting-started.md): Install Closeup, open it on a shortcut or on an element, and film a first take.
- [Filming](https://cesarvenzac.com/closeup/docs/filming.md): Picking what to film, the frame and its background, the cursor, and the camera that closes in on clicks and pans as you scroll.
- [Scripts](https://cesarvenzac.com/closeup/docs/scripts.md): Draw the cursor's path once and play it on every take: the editor, what each point does, rendering a take a frame at a time, and the JSON a script is kept as.
- [Keeping a take](https://cesarvenzac.com/closeup/docs/keeping.md): Trim a take, change its speed, keep it as a video or a GIF, and add buttons of your own that send it somewhere.
- [API reference](https://cesarvenzac.com/closeup/docs/api.md): Everything the package exports: opening it, actions on a take, scripts, and their types.
