Installation
Install the component
Run the following command to install the component and its dependencies:
npx @motion-core/cli add image-trailImport the component
Import the component into your Svelte file:
import { ImageTrail } from "$lib/motion-core";import { ImageTrail } from "$lib/motion-core";Usage
Props
ImageTrail
| Prop | Type | Default |
|---|---|---|
images | string[] | — |
class | string | "" |
config | TrailConfig | DEFAULT_CONFIG |
Config options
| Key | Type | Default |
|---|---|---|
imageLifespan | number | 600 |
removalTickMs | number | 16 |
mouseThreshold | number | 40 |
minMovementForImage | number | 5 |
inDuration | number | 600 |
outDuration | number | 800 |
maxRotationFactor | number | 3 |
baseRotation | number | 30 |
speedSmoothingFactor | number | 0.25 |
minImageSize | number | 260 |
maxImageSize | number | 340 |
staggerOut | number | 40 |