# drift

function in `@dioramajs/media/horizontal`

```ts
import { drift } from '@dioramajs/media/horizontal'
```

Framing of a card's picture by where the card is: scale and sideways shift (box units). The
picture lags the card, shifted against the way it crosses the screen.

```ts
function drift(
  centre: number,
  width: number,
  viewport: number,
  depth: number,
): [number, number]
```

| Parameter | Type | Description |
| --- | --- | --- |
| `centre` | `number` |  |
| `width` | `number` |  |
| `viewport` | `number` |  |
| `depth` | `number` |  |

Defined in [packages/media/src/horizontal.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/media/src/horizontal.ts#L59).
