fader

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package fader implements sway container fading.

Index

Constants

View Source
const (
	DefaultFrom     = 0.7
	DefaultTo       = 1.0
	DefaultFPS      = 60.0
	DefaultDuration = 200 * time.Millisecond
	DefaultEase     = "linear" // camelCase function name from https://github.com/fogleman/ease
)

Fader constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder func(*options)

Builder builds a fader.

func New

func New() Builder

New creates a new fader.

func (Builder) Build

func (build Builder) Build() *Fader

Build the handler.

func (Builder) WithContainerAppIDFade

func (build Builder) WithContainerAppIDFade(r *regexp.Regexp, from, to float64) Builder

WithContainerAppIDFade configures a container's opacities by app_id.

func (Builder) WithContainerClassFade

func (build Builder) WithContainerClassFade(r *regexp.Regexp, from, to float64) Builder

WithContainerClassFade configures a container's opacities by class.

func (Builder) WithFPS

func (build Builder) WithFPS(fps float64) Builder

WithFPS configures the framerate for transitions.

func (Builder) WithFadeDuration

func (build Builder) WithFadeDuration(d time.Duration) Builder

WithFadeDuration configures the fade duration.

type Fader

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

Fader runs fades on containers.

func (*Fader) StartFade

func (h *Fader) StartFade(node *i3.Node)

StartFade starts a preconfigured fade on container.

Jump to

Keyboard shortcuts

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