drift function
Framing of a card's picture by where the card is: scale and sideways shift (box units).
import { drift } from '@dioramajs/media/horizontal'The picture lags the card, shifted against the way it crosses the screen.
function drift(
centre: number,
width: number,
viewport: number,
depth: number,
): [number, number]Parameters
| Name | Type | Description |
|---|---|---|
centre | number | |
width | number | |
viewport | number | |
depth | number |
Defined in packages/media/src/horizontal.ts.