animation
Animation dataclass
Animation instance.
Source code in zendriver/cdp/animation.py
css_id: typing.Optional[str] = None class-attribute instance-attribute
current_time: float instance-attribute
id_: str instance-attribute
name: str instance-attribute
paused_state: bool instance-attribute
play_state: str instance-attribute
playback_rate: float instance-attribute
source: typing.Optional[AnimationEffect] = None class-attribute instance-attribute
start_time: float instance-attribute
type_: str instance-attribute
view_or_scroll_timeline: typing.Optional[ViewOrScrollTimeline] = None class-attribute instance-attribute
__init__(id_, name, paused_state, play_state, playback_rate, start_time, current_time, type_, source=None, css_id=None, view_or_scroll_timeline=None)
from_json(json) classmethod
Source code in zendriver/cdp/animation.py
to_json()
Source code in zendriver/cdp/animation.py
AnimationCanceled dataclass
Event for when an animation has been cancelled.
Source code in zendriver/cdp/animation.py
AnimationCreated dataclass
Event for each animation that has been created.
Source code in zendriver/cdp/animation.py
AnimationEffect dataclass
AnimationEffect instance
Source code in zendriver/cdp/animation.py
backend_node_id: typing.Optional[dom.BackendNodeId] = None class-attribute instance-attribute
delay: float instance-attribute
direction: str instance-attribute
duration: float instance-attribute
easing: str instance-attribute
end_delay: float instance-attribute
fill: str instance-attribute
iteration_start: float instance-attribute
iterations: float instance-attribute
keyframes_rule: typing.Optional[KeyframesRule] = None class-attribute instance-attribute
__init__(delay, end_delay, iteration_start, iterations, duration, direction, fill, easing, backend_node_id=None, keyframes_rule=None)
from_json(json) classmethod
Source code in zendriver/cdp/animation.py
to_json()
Source code in zendriver/cdp/animation.py
AnimationStarted dataclass
Event for animation that has been started.
Source code in zendriver/cdp/animation.py
AnimationUpdated dataclass
Event for animation that has been updated.
Source code in zendriver/cdp/animation.py
KeyframeStyle dataclass
Keyframe Style
Source code in zendriver/cdp/animation.py
easing: str instance-attribute
offset: str instance-attribute
__init__(offset, easing)
from_json(json) classmethod
KeyframesRule dataclass
Keyframes Rule
Source code in zendriver/cdp/animation.py
keyframes: typing.List[KeyframeStyle] instance-attribute
name: typing.Optional[str] = None class-attribute instance-attribute
__init__(keyframes, name=None)
from_json(json) classmethod
ViewOrScrollTimeline dataclass
Timeline instance
Source code in zendriver/cdp/animation.py
axis: dom.ScrollOrientation instance-attribute
end_offset: typing.Optional[float] = None class-attribute instance-attribute
source_node_id: typing.Optional[dom.BackendNodeId] = None class-attribute instance-attribute
start_offset: typing.Optional[float] = None class-attribute instance-attribute
subject_node_id: typing.Optional[dom.BackendNodeId] = None class-attribute instance-attribute
__init__(axis, source_node_id=None, start_offset=None, end_offset=None, subject_node_id=None)
from_json(json) classmethod
Source code in zendriver/cdp/animation.py
to_json()
Source code in zendriver/cdp/animation.py
disable()
Disables animation domain notifications.
enable()
Enables animation domain notifications.
get_current_time(id_)
Returns the current time of the an animation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id_ | str | Id of animation. | required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, float] | Current time of the page. |
Source code in zendriver/cdp/animation.py
get_playback_rate()
Gets the playback rate of the document timeline.
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, float] | Playback rate for animations on page. |
Source code in zendriver/cdp/animation.py
release_animations(animations)
Releases a set of animations to no longer be manipulated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
animations | List[str] | List of animation ids to seek. | required |
Source code in zendriver/cdp/animation.py
resolve_animation(animation_id)
Gets the remote object of the Animation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
animation_id | str | Animation id. | required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, RemoteObject] | Corresponding remote object. |
Source code in zendriver/cdp/animation.py
seek_animations(animations, current_time)
Seek a set of animations to a particular time within each animation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
animations | List[str] | List of animation ids to seek. | required |
current_time | float | Set the current time of each animation. | required |
Source code in zendriver/cdp/animation.py
set_paused(animations, paused)
Sets the paused state of a set of animations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
animations | List[str] | Animations to set the pause state of. | required |
paused | bool | Paused state to set to. | required |
Source code in zendriver/cdp/animation.py
set_playback_rate(playback_rate)
Sets the playback rate of the document timeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
playback_rate | float | Playback rate for animations on page | required |
Source code in zendriver/cdp/animation.py
set_timing(animation_id, duration, delay)
Sets the timing of an animation node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
animation_id | str | Animation id. | required |
duration | float | Duration of the animation. | required |
delay | float | Delay of the animation. | required |