MoveInAnimation
in package
implements
AnimationInterface
Move-in animation for components.
The move_in animation causes a component to slide into view from a specified direction when it enters the viewport.
Tags
Table of Contents
Interfaces
- AnimationInterface
- Interface for all ANF component animations.
Constants
- POSITION_BOTTOM = 'bottom'
- POSITION_LEFT = 'left'
- Valid preferred starting positions.
- POSITION_RIGHT = 'right'
- POSITION_TOP = 'top'
Properties
- $preferredStartingPosition : string|null
- The direction from which the component moves in.
- $userControllable : bool|null
- Whether the animation is controllable by user scroll position.
Methods
- fromBottom() : self
- Create a MoveInAnimation from the bottom.
- fromLeft() : self
- Create a MoveInAnimation from the left.
- fromRight() : self
- Create a MoveInAnimation from the right.
- fromTop() : self
- Create a MoveInAnimation from the top.
- getType() : string
- Get the animation type identifier.
- jsonSerialize() : array<string, mixed>
- {@inheritdoc}
- setPreferredStartingPosition() : $this
- Set the preferred starting position (direction).
- setUserControllable() : $this
- Set whether the animation is user controllable.
Constants
POSITION_BOTTOM
public
mixed
POSITION_BOTTOM
= 'bottom'
POSITION_LEFT
Valid preferred starting positions.
public
mixed
POSITION_LEFT
= 'left'
POSITION_RIGHT
public
mixed
POSITION_RIGHT
= 'right'
POSITION_TOP
public
mixed
POSITION_TOP
= 'top'
Properties
$preferredStartingPosition
The direction from which the component moves in.
private
string|null
$preferredStartingPosition
= null
$userControllable
Whether the animation is controllable by user scroll position.
private
bool|null
$userControllable
= null
Methods
fromBottom()
Create a MoveInAnimation from the bottom.
public
static fromBottom() : self
Return values
self —A new MoveInAnimation instance.
fromLeft()
Create a MoveInAnimation from the left.
public
static fromLeft() : self
Return values
self —A new MoveInAnimation instance.
fromRight()
Create a MoveInAnimation from the right.
public
static fromRight() : self
Return values
self —A new MoveInAnimation instance.
fromTop()
Create a MoveInAnimation from the top.
public
static fromTop() : self
Return values
self —A new MoveInAnimation instance.
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>setPreferredStartingPosition()
Set the preferred starting position (direction).
public
setPreferredStartingPosition(string $position) : $this
Parameters
- $position : string
-
One of 'left', 'right', 'top', 'bottom'.
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.