# Screenshot Capture

Playwright-based screenshot capture for pitch videos and demos.

## Setup

```bash
cd applications/pitch
pnpm install
npx playwright install chromium
```

## Usage

1. Create a config file (e.g., `my-screenshots.json`):

```json
{
  "baseUrl": "http://localhost:18188",
  "outputDir": "screenshots/demo",
  "screenshots": [
    { "url": "/skeptic", "name": "skeptic-query.png" },
    { "url": "/skeptic", "name": "skeptic-results.png", "waitFor": ".results" },
    { "url": "/sources", "name": "sources.png", "delay": 500 }
  ]
}
```

2. Run:

```bash
pnpm capture my-screenshots.json
```

3. Screenshots saved to `screenshots/demo/`

## Config Options

| Field | Required | Description |
|-------|----------|-------------|
| `baseUrl` | No | Base URL (default: `http://localhost:18188`) |
| `outputDir` | No | Output directory (default: `screenshots`) |
| `screenshots` | Yes | Array of screenshots to capture |

### Screenshot Fields

| Field | Required | Description |
|-------|----------|-------------|
| `url` | Yes | Page URL (relative to baseUrl or absolute) |
| `name` | Yes | Output filename (e.g., `demo.png`) |
| `waitFor` | No | CSS selector to wait for before capturing |
| `delay` | No | Milliseconds to wait after page load |

## Examples

### Basic capture

```json
{
  "screenshots": [
    { "url": "/dashboard", "name": "dashboard.png" }
  ]
}
```

### Wait for element

```json
{
  "screenshots": [
    { "url": "/results", "name": "results.png", "waitFor": ".data-loaded" }
  ]
}
```

### Wait for animation

```json
{
  "screenshots": [
    { "url": "/chart", "name": "chart.png", "delay": 1000 }
  ]
}
```

### Full URLs

```json
{
  "screenshots": [
    { "url": "https://example.com/page", "name": "external.png" }
  ]
}
```
