Apple News API PHP Client

MoveInAnimation
in package
implements AnimationInterface

FinalYes

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
see
https://developer.apple.com/documentation/apple_news/moveinanimation

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_LEFT

Valid preferred starting positions.

public mixed POSITION_LEFT = 'left'

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
$this

setUserControllable()

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
$this

        
On this page

Search results