animation

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(anim Animation) seed.Option

Types

type Animation

type Animation struct {
	// contains filtered or unexported fields
}

Animation can be added to a seed as the current playing animation of that seed.

func New

func New(options ...Option) Animation

New returns a new animation. It also takes a variable amount of options that will be applied to any seed with this animation set. These are useful for setting default animation durations, looping etc.

func (Animation) AddTo

func (anim Animation) AddTo(c seed.Seed)

func (Animation) InReverse

func (anim Animation) InReverse() Animation

InReverse returns a new animation which is the reverse of anim.

type Frame

type Frame []css.Style

Frame is a individual keyframe of an animation.

func (Frame) Rules

func (f Frame) Rules() css.Rules

Rules implements css.Style

type Frames

type Frames map[float64]css.Style

Frames is a mapping between time and a keyframe.

type NewOption

type NewOption func(*Animation)

NewOption can be used to create new Options.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option values can be passed to New to configure the animation.

func Duration

func Duration(d time.Duration) Option

Duration sets the duration of the current playing animation.

func Loop

func Loop() Option

Loop sets the current playing animation to loop back and forth.

func Reverse

func Reverse() Option

Reverse sets the current playing animation to play in reverse.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL