anim

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 15 Imported by: 0

README

anim

Package anim contains a range of terminal animations. These are used on cy's splash screen and in the background while fuzzy finding.

Documentation

Index

Constants

View Source
const (
	POSITION_FACTOR = 10
)
View Source
const (
	TICKS_PER_SECOND = 10
)

Variables

View Source
var Animations = map[string]Creator{}

Functions

func NewAnimator

func NewAnimator(
	ctx context.Context,
	animation Animation,
	initial image.Image,
	fps int,
	options ...Option,
) *taro.Program

func NewStory added in v0.1.6

func NewStory(
	ctx context.Context,
	creator Creator,
) *taro.Program

Types

type Animation

type Animation interface {
	Init(image.Image)
	Update(delta time.Duration) image.Image
}

type Animator

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

func (*Animator) Init added in v0.1.6

func (a *Animator) Init() tea.Cmd

func (*Animator) Update added in v0.1.6

func (a *Animator) Update(msg tea.Msg) (taro.Model, tea.Cmd)

func (*Animator) View added in v0.1.6

func (a *Animator) View(state *tty.State)

type Collapse added in v0.1.5

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

func (*Collapse) Init added in v0.1.5

func (c *Collapse) Init(start image.Image)

func (*Collapse) Update added in v0.1.5

func (c *Collapse) Update(delta time.Duration) image.Image

type Conway

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

func (*Conway) Init

func (c *Conway) Init(start image.Image)

func (*Conway) Update

func (c *Conway) Update(delta time.Duration) image.Image

type Cos added in v0.1.13

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

func (*Cos) Init added in v0.1.13

func (cos *Cos) Init(start image.Image)

func (*Cos) Update added in v0.1.13

func (cos *Cos) Update(delta time.Duration) image.Image

type Creator added in v0.1.6

type Creator func() Animation

type Cyform

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

func (*Cyform) Init

func (c *Cyform) Init(start image.Image)

func (*Cyform) Update

func (c *Cyform) Update(delta time.Duration) image.Image

type Fluid added in v0.1.18

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

func (*Fluid) Init added in v0.1.18

func (f *Fluid) Init(start image.Image)

func (*Fluid) Update added in v0.1.18

func (f *Fluid) Update(delta time.Duration) image.Image

type Midjo

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

func (*Midjo) Init

func (m *Midjo) Init(start image.Image)

func (*Midjo) Update

func (mid *Midjo) Update(delta time.Duration) image.Image

type Option added in v0.1.6

type Option func(*Animator)

func WithStartTime added in v0.1.6

func WithStartTime(start time.Time) Option

type Story added in v0.1.6

type Story struct {
	util.Lifetime
	// contains filtered or unexported fields
}

func (*Story) Init added in v0.1.6

func (s *Story) Init() tea.Cmd

func (*Story) Update added in v0.1.6

func (s *Story) Update(msg tea.Msg) (taro.Model, tea.Cmd)

func (*Story) View added in v0.1.6

func (s *Story) View(state *tty.State)

Jump to

Keyboard shortcuts

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