Animation#
This CDP domain is experimental.
Types#
Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.
- class Animation(id_, name, paused_state, play_state, playback_rate, start_time, current_time, type_, source=None, css_id=None, view_or_scroll_timeline=None)[source]#
Animation instance.
-
start_time:
float# Animation’s start time. Milliseconds for time based animations and percentage [0 - 100] for scroll driven animations (i.e. when viewOrScrollTimeline exists).
-
source:
Optional[AnimationEffect] = None# Animation’s source animation node.
-
css_id:
Optional[str] = None# A unique ID for
Animationrepresenting the sources that triggered this CSS animation/transition.
-
view_or_scroll_timeline:
Optional[ViewOrScrollTimeline] = None# View or scroll timeline
-
start_time:
- class ViewOrScrollTimeline(axis, source_node_id=None, start_offset=None, end_offset=None, subject_node_id=None)[source]#
Timeline instance
-
axis:
ScrollOrientation# Orientation of the scroll
-
source_node_id:
Optional[BackendNodeId] = None# Scroll container node
-
start_offset:
Optional[float] = None# Represents the starting scroll position of the timeline as a length offset in pixels from scroll origin.
-
end_offset:
Optional[float] = None# Represents the ending scroll position of the timeline as a length offset in pixels from scroll origin.
-
subject_node_id:
Optional[BackendNodeId] = None# The element whose principal box’s visibility in the scrollport defined the progress of the timeline. Does not exist for animations with ScrollTimeline
-
axis:
- class AnimationEffect(delay, end_delay, iteration_start, iterations, duration, direction, fill, easing, backend_node_id=None, keyframes_rule=None)[source]#
AnimationEffect instance
-
duration:
float# AnimationEffect’s iteration duration. Milliseconds for time based animations and percentage [0 - 100] for scroll driven animations (i.e. when viewOrScrollTimeline exists).
-
backend_node_id:
Optional[BackendNodeId] = None# AnimationEffect’s target node.
-
keyframes_rule:
Optional[KeyframesRule] = None# AnimationEffect’s keyframes.
-
duration:
- class KeyframesRule(keyframes, name=None)[source]#
Keyframes Rule
-
keyframes:
List[KeyframeStyle]# List of animation keyframes.
-
keyframes:
Commands#
Each command is a generator function. The return
type Generator[x, y, z] indicates that the generator
yields arguments of type x, it must be resumed with
an argument of type y, and it returns type z. In
this library, types x and y are the same for all
commands, and z is the return type you should pay attention
to. For more information, see
Getting Started: Commands.
- seek_animations(animations, current_time)[source]#
Seek a set of animations to a particular time within each animation.
Events#
Generally, you do not need to instantiate CDP events yourself. Instead, the API creates events for you and then you use the event’s attributes.