Skip to content
party.js logoparty.js logo

ReferenceBehaviorsFunction

fade()

Fades a particle in and out.

function fade(inDuration: number, outDuration: number, ease?: Easing): Behavior;

Creates a behavior that fades a particle’s opacity in and out over the specified durations.

The fade-in takes place during the first inDuration seconds of a particle’s lifetime, while the fade-out happens during the last outDuration seconds of the particle’s lifetime. The supplied easing is applied forwards when fading in, and in reverse when fading out.

inDurationnumber

The duration in seconds it takes for the particle to fade in fully, or 0 if no fade-in should be applied.

outDurationnumber

The duration in seconds it takes for the particle to fade out fully, or 0 if no fade-out should be applied.

easeoptionalEasing

How the transition progresses. Defaults to linear().