FadeInAnimation
in package
implements
AnimationInterface
Fade-in animation for components.
The fade_in animation causes a component to fade in from transparent to fully opaque when it enters the viewport.
Tags
Table of Contents
Interfaces
- AnimationInterface
- Interface for all ANF component animations.
Properties
- $initialAlpha : float|null
- The initial opacity of the component (0.0 to 1.0).
- $userControllable : bool|null
- Whether the animation is controllable by user scroll position.
Methods
- fromTransparent() : self
- Create a FadeInAnimation starting from fully transparent.
- getType() : string
- Get the animation type identifier.
- jsonSerialize() : array<string, mixed>
- {@inheritdoc}
- setInitialAlpha() : $this
- Set the initial alpha (opacity) value.
- setUserControllable() : $this
- Set whether the animation is user controllable.
- subtle() : self
- Create a subtle fade-in starting from 50% opacity.
- withInitialAlpha() : self
- Create a FadeInAnimation with a specific initial alpha.
Properties
$initialAlpha
The initial opacity of the component (0.0 to 1.0).
private
float|null
$initialAlpha
= null
$userControllable
Whether the animation is controllable by user scroll position.
private
bool|null
$userControllable
= null
Methods
fromTransparent()
Create a FadeInAnimation starting from fully transparent.
public
static fromTransparent() : self
Return values
self —A new FadeInAnimation with initialAlpha of 0.
getType()
Get the animation type identifier.
public
getType() : string
Return values
string —The animation type (e.g., 'fade_in', 'move_in').
jsonSerialize()
{@inheritdoc}
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>setInitialAlpha()
Set the initial alpha (opacity) value.
public
setInitialAlpha(float $initialAlpha) : $this
The component will fade from this value to 1.0 (fully opaque).
Parameters
- $initialAlpha : float
-
Initial opacity from 0.0 (transparent) to 1.0 (opaque).
Return values
$thissetUserControllable()
Set whether the animation is user controllable.
public
setUserControllable(bool $userControllable) : $this
When true, the animation progress is tied to scroll position.
Parameters
- $userControllable : bool
-
Whether user can control the animation.
Return values
$thissubtle()
Create a subtle fade-in starting from 50% opacity.
public
static subtle() : self
Return values
self —A new FadeInAnimation with initialAlpha of 0.5.
withInitialAlpha()
Create a FadeInAnimation with a specific initial alpha.
public
static withInitialAlpha(float $initialAlpha) : self
Parameters
- $initialAlpha : float
-
The starting opacity (0.0 to 1.0).
Return values
self —A new FadeInAnimation instance.