Documentation
¶
Overview ¶
Package animation provides the Chrome DevTools Protocol commands, types, and events for the Animation domain.
Generated by the cdproto-gen command.
Index ¶
- Constants
- type Animation
- type DisableParams
- type Effect
- type EnableParams
- type EventAnimationCanceled
- type EventAnimationCreated
- type EventAnimationStarted
- type EventAnimationUpdated
- type GetCurrentTimeParams
- type GetCurrentTimeReturns
- type GetPlaybackRateParams
- type GetPlaybackRateReturns
- type KeyframeStyle
- type KeyframesRule
- type ReleaseAnimationsParams
- type ResolveAnimationParams
- type ResolveAnimationReturns
- type SeekAnimationsParams
- type SetPausedParams
- type SetPlaybackRateParams
- type SetTimingParams
- type Type
- type ViewOrScrollTimeline
Constants ¶
const ( CommandDisable = "Animation.disable" CommandEnable = "Animation.enable" CommandGetCurrentTime = "Animation.getCurrentTime" CommandGetPlaybackRate = "Animation.getPlaybackRate" CommandReleaseAnimations = "Animation.releaseAnimations" CommandResolveAnimation = "Animation.resolveAnimation" CommandSeekAnimations = "Animation.seekAnimations" CommandSetPaused = "Animation.setPaused" CommandSetPlaybackRate = "Animation.setPlaybackRate" CommandSetTiming = "Animation.setTiming" )
Command names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animation ¶
type Animation struct {
ID string `json:"id"` // Animation's id.
Name string `json:"name"` // Animation's name.
PausedState bool `json:"pausedState"` // Animation's internal paused state.
PlayState string `json:"playState"` // Animation's play state.
PlaybackRate float64 `json:"playbackRate"` // Animation's playback rate.
StartTime float64 `json:"startTime"` // Animation's start time. Milliseconds for time based animations and percentage [0 - 100] for scroll driven animations (i.e. when viewOrScrollTimeline exists).
CurrentTime float64 `json:"currentTime"` // Animation's current time.
Type Type `json:"type"` // Animation type of Animation.
Source *Effect `json:"source,omitempty"` // Animation's source animation node.
CSSID string `json:"cssId,omitempty"` // A unique ID for Animation representing the sources that triggered this CSS animation/transition.
ViewOrScrollTimeline *ViewOrScrollTimeline `json:"viewOrScrollTimeline,omitempty"` // View or scroll timeline
}
Animation animation instance.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#type-Animation
type DisableParams ¶
type DisableParams struct{}
DisableParams disables animation domain notifications.
func Disable ¶
func Disable() *DisableParams
Disable disables animation domain notifications.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#method-disable
type Effect ¶
type Effect struct {
Delay float64 `json:"delay"` // AnimationEffect's delay.
EndDelay float64 `json:"endDelay"` // AnimationEffect's end delay.
IterationStart float64 `json:"iterationStart"` // AnimationEffect's iteration start.
Iterations float64 `json:"iterations"` // AnimationEffect's iterations.
Duration float64 `json:"duration"` // AnimationEffect's iteration duration. Milliseconds for time based animations and percentage [0 - 100] for scroll driven animations (i.e. when viewOrScrollTimeline exists).
Direction string `json:"direction"` // AnimationEffect's playback direction.
Fill string `json:"fill"` // AnimationEffect's fill mode.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // AnimationEffect's target node.
KeyframesRule *KeyframesRule `json:"keyframesRule,omitempty"` // AnimationEffect's keyframes.
Easing string `json:"easing"` // AnimationEffect's timing function.
}
Effect animationEffect instance.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#type-AnimationEffect
type EnableParams ¶
type EnableParams struct{}
EnableParams enables animation domain notifications.
func Enable ¶
func Enable() *EnableParams
Enable enables animation domain notifications.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#method-enable
type EventAnimationCanceled ¶
type EventAnimationCanceled struct {
ID string `json:"id"` // Id of the animation that was cancelled.
}
EventAnimationCanceled event for when an animation has been cancelled.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#event-animationCanceled
type EventAnimationCreated ¶
type EventAnimationCreated struct {
ID string `json:"id"` // Id of the animation that was created.
}
EventAnimationCreated event for each animation that has been created.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#event-animationCreated
type EventAnimationStarted ¶
type EventAnimationStarted struct {
Animation *Animation `json:"animation"` // Animation that was started.
}
EventAnimationStarted event for animation that has been started.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#event-animationStarted
type EventAnimationUpdated ¶
type EventAnimationUpdated struct {
Animation *Animation `json:"animation"` // Animation that was updated.
}
EventAnimationUpdated event for animation that has been updated.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#event-animationUpdated
type GetCurrentTimeParams ¶
type GetCurrentTimeParams struct {
ID string `json:"id"` // Id of animation.
}
GetCurrentTimeParams returns the current time of the an animation.
func GetCurrentTime ¶
func GetCurrentTime(id string) *GetCurrentTimeParams
GetCurrentTime returns the current time of the an animation.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#method-getCurrentTime
parameters:
id - Id of animation.
type GetCurrentTimeReturns ¶
type GetCurrentTimeReturns struct {
CurrentTime float64 `json:"currentTime,omitempty"` // Current time of the page.
}
GetCurrentTimeReturns return values.
type GetPlaybackRateParams ¶
type GetPlaybackRateParams struct{}
GetPlaybackRateParams gets the playback rate of the document timeline.
func GetPlaybackRate ¶
func GetPlaybackRate() *GetPlaybackRateParams
GetPlaybackRate gets the playback rate of the document timeline.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#method-getPlaybackRate
type GetPlaybackRateReturns ¶
type GetPlaybackRateReturns struct {
PlaybackRate float64 `json:"playbackRate,omitempty"` // Playback rate for animations on page.
}
GetPlaybackRateReturns return values.
type KeyframeStyle ¶
type KeyframeStyle struct {
Offset string `json:"offset"` // Keyframe's time offset.
Easing string `json:"easing"` // AnimationEffect's timing function.
}
KeyframeStyle keyframe Style.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#type-KeyframeStyle
type KeyframesRule ¶
type KeyframesRule struct {
Name string `json:"name,omitempty"` // CSS keyframed animation's name.
Keyframes []*KeyframeStyle `json:"keyframes"` // List of animation keyframes.
}
KeyframesRule keyframes Rule.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#type-KeyframesRule
type ReleaseAnimationsParams ¶
type ReleaseAnimationsParams struct {
Animations []string `json:"animations"` // List of animation ids to seek.
}
ReleaseAnimationsParams releases a set of animations to no longer be manipulated.
func ReleaseAnimations ¶
func ReleaseAnimations(animations []string) *ReleaseAnimationsParams
ReleaseAnimations releases a set of animations to no longer be manipulated.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#method-releaseAnimations
parameters:
animations - List of animation ids to seek.
type ResolveAnimationParams ¶
type ResolveAnimationParams struct {
AnimationID string `json:"animationId"` // Animation id.
}
ResolveAnimationParams gets the remote object of the Animation.
func ResolveAnimation ¶
func ResolveAnimation(animationID string) *ResolveAnimationParams
ResolveAnimation gets the remote object of the Animation.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#method-resolveAnimation
parameters:
animationID - Animation id.
func (*ResolveAnimationParams) Do ¶
func (p *ResolveAnimationParams) Do(ctx context.Context) (remoteObject *runtime.RemoteObject, err error)
Do executes Animation.resolveAnimation against the provided context.
returns:
remoteObject - Corresponding remote object.
type ResolveAnimationReturns ¶
type ResolveAnimationReturns struct {
RemoteObject *runtime.RemoteObject `json:"remoteObject,omitempty"` // Corresponding remote object.
}
ResolveAnimationReturns return values.
type SeekAnimationsParams ¶
type SeekAnimationsParams struct {
Animations []string `json:"animations"` // List of animation ids to seek.
CurrentTime float64 `json:"currentTime"` // Set the current time of each animation.
}
SeekAnimationsParams seek a set of animations to a particular time within each animation.
func SeekAnimations ¶
func SeekAnimations(animations []string, currentTime float64) *SeekAnimationsParams
SeekAnimations seek a set of animations to a particular time within each animation.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#method-seekAnimations
parameters:
animations - List of animation ids to seek. currentTime - Set the current time of each animation.
type SetPausedParams ¶
type SetPausedParams struct {
Animations []string `json:"animations"` // Animations to set the pause state of.
Paused bool `json:"paused"` // Paused state to set to.
}
SetPausedParams sets the paused state of a set of animations.
func SetPaused ¶
func SetPaused(animations []string, paused bool) *SetPausedParams
SetPaused sets the paused state of a set of animations.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#method-setPaused
parameters:
animations - Animations to set the pause state of. paused - Paused state to set to.
type SetPlaybackRateParams ¶
type SetPlaybackRateParams struct {
PlaybackRate float64 `json:"playbackRate"` // Playback rate for animations on page
}
SetPlaybackRateParams sets the playback rate of the document timeline.
func SetPlaybackRate ¶
func SetPlaybackRate(playbackRate float64) *SetPlaybackRateParams
SetPlaybackRate sets the playback rate of the document timeline.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#method-setPlaybackRate
parameters:
playbackRate - Playback rate for animations on page
type SetTimingParams ¶
type SetTimingParams struct {
AnimationID string `json:"animationId"` // Animation id.
Duration float64 `json:"duration"` // Duration of the animation.
Delay float64 `json:"delay"` // Delay of the animation.
}
SetTimingParams sets the timing of an animation node.
func SetTiming ¶
func SetTiming(animationID string, duration float64, delay float64) *SetTimingParams
SetTiming sets the timing of an animation node.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#method-setTiming
parameters:
animationID - Animation id. duration - Duration of the animation. delay - Delay of the animation.
type Type ¶
type Type string
Type animation type of Animation.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#type-Animation
const ( TypeCSSTransition Type = "CSSTransition" TypeCSSAnimation Type = "CSSAnimation" TypeWebAnimation Type = "WebAnimation" )
Type values.
func (Type) MarshalJSON ¶
MarshalJSON satisfies json.Marshaler.
func (*Type) UnmarshalJSON ¶
UnmarshalJSON satisfies json.Unmarshaler.
type ViewOrScrollTimeline ¶
type ViewOrScrollTimeline struct {
SourceNodeID cdp.BackendNodeID `json:"sourceNodeId,omitempty"` // Scroll container node
StartOffset float64 `json:"startOffset,omitempty"` // Represents the starting scroll position of the timeline as a length offset in pixels from scroll origin.
EndOffset float64 `json:"endOffset,omitempty"` // Represents the ending scroll position of the timeline as a length offset in pixels from scroll origin.
SubjectNodeID cdp.BackendNodeID `json:"subjectNodeId,omitempty"` // The element whose principal box's visibility in the scrollport defined the progress of the timeline. Does not exist for animations with ScrollTimeline
Axis dom.ScrollOrientation `json:"axis"` // Orientation of the scroll
}
ViewOrScrollTimeline timeline instance.
See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#type-ViewOrScrollTimeline