Documentation
¶
Overview ¶
Package animation provides the time model shared by CSS transitions and animations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animation ¶
Animation advances one animation to a frame timestamp. It reports whether it remains active after the frame.
type Clock ¶
Clock supplies the current animation time. Implementations must prefer a monotonic time source; Timeline additionally prevents observed time from moving backwards.
type CubicBezier ¶
type CubicBezier struct {
X1, Y1, X2, Y2 float64
}
CubicBezier is a CSS cubic-bezier easing function.
func NewCubicBezier ¶
func NewCubicBezier(x1, y1, x2, y2 float64) (CubicBezier, error)
NewCubicBezier creates a curve whose x control points are valid CSS values.
type EasingFunction ¶
EasingFunction maps an input progress to an output progress.
type Phase ¶
type Phase uint8
Phase identifies where a sample lies relative to an effect's active time.
type StepPosition ¶
type StepPosition uint8
StepPosition selects where discontinuities occur in a steps() easing.
const ( JumpStart StepPosition = iota JumpEnd JumpNone JumpBoth )
type Steps ¶
type Steps struct {
Count int
Position StepPosition
}
Steps is a CSS step easing function.
type SystemClock ¶
type SystemClock struct{}
SystemClock supplies the process monotonic wall-clock time for production.
func (SystemClock) Now ¶
func (SystemClock) Now() time.Time
type Timeline ¶
type Timeline struct {
// contains filtered or unexported fields
}
Timeline advances every registered animation against one shared clock.
func NewTimeline ¶
NewTimeline creates an empty timeline driven by clock.
type Timing ¶
type Timing struct {
Duration time.Duration
Delay time.Duration
Easing EasingFunction
}
Timing describes the duration, delay, and easing of one effect.
type TimingSample ¶
TimingSample is the phase and eased progress at one timestamp.