Documentation
¶
Overview ¶
Package animations provides terminal animation effects for Go applications.
sysc-Go includes multiple animation effects with customizable color themes:
- Fire: DOOM PSX-style fire effect
- Matrix: Digital rain with falling character streaks
- Fireworks: Physics-based particle fireworks
- Rain: ASCII character rain effect
Basic usage:
palette := animations.GetFirePalette("dracula")
fire := animations.NewFireEffect(80, 24, palette)
for frame := 0; frame < 200; frame++ {
fire.Update(frame)
output := fire.Render()
fmt.Print(output)
}
See GUIDE.md for detailed usage examples and integration patterns.
registry.go - Unified effect registry for sysc-Go animations This provides metadata about all available effects and enables automatic synchronization with consumers like sysc-walls
Index ¶
- Constants
- Variables
- func GetDefaultFirePalette() []string
- func GetEffectNames() []string
- func GetFirePalette(themeName string) []string
- func GetFireworksPalette(themeName string) []string
- func GetLibraryVersion() string
- func GetMatrixPalette(themeName string) []string
- func GetParticlePalette(themeName string) []string
- func GetRainPalette(themeName string) []string
- func GetScreensaverPalette(themeName string) []string
- func GetTextBasedEffects() []string
- func GetThemeNames() []string
- func IsTextBasedEffect(name string) bool
- type Anchor
- type Animation
- type AquariumConfig
- type AquariumEffect
- type BeamCharacter
- type BeamGroup
- type BeamTextConfig
- type BeamTextEffect
- type BeamsConfig
- type BeamsEffect
- type BlackholeCharacter
- type BlackholeConfig
- type BlackholeEffect
- type Boat
- type BorderCharacter
- type Bubble
- type Config
- type DecryptAnimationFrame
- type DecryptCharacter
- type DecryptConfig
- type DecryptEffect
- type Diver
- type EffectMetadata
- type FireEffect
- type FireTextEffect
- type FireworksEffect
- type Fish
- type FrozenChar
- type FrozenMatrixChar
- type GradientDirection
- type MatrixArtEffect
- type MatrixChar
- type MatrixEffect
- type MatrixStreak
- type Mermaid
- type Particle
- type PourCharacter
- type PourConfig
- type PourEffect
- type PrintConfig
- type PrintEffect
- type RainArtEffect
- type RainDrop
- type RainEffect
- type Ring
- type RingTextCharacter
- type RingTextConfig
- type RingTextEffect
- type RoastingTicker
- type Seaweed
- type ThemeMetadata
- type TickerAnimation
- type TypewriterTicker
Constants ¶
const (
// LibraryVersion is the sysc-Go animations library version
LibraryVersion = "1.0.2"
)
Variables ¶
var EffectRegistry = []EffectMetadata{ { Name: "matrix", RequiresText: false, Description: "Classic Matrix digital rain effect", VersionAdded: "1.0.0", Category: "particle", }, { Name: "matrix-art", RequiresText: true, Description: "Matrix rain revealing ASCII art", VersionAdded: "1.0.0", Category: "text", }, { Name: "fire", RequiresText: false, Description: "Doom-style fire effect", VersionAdded: "1.0.0", Category: "particle", }, { Name: "fire-text", RequiresText: true, Description: "Fire effect with text as negative space", VersionAdded: "1.0.1", Category: "text", }, { Name: "fireworks", RequiresText: false, Description: "Animated fireworks display", VersionAdded: "1.0.0", Category: "particle", }, { Name: "rain", RequiresText: false, Description: "Falling rain droplets", VersionAdded: "1.0.0", Category: "particle", }, { Name: "rain-art", RequiresText: true, Description: "Rain revealing ASCII art", VersionAdded: "1.0.0", Category: "text", }, { Name: "beams", RequiresText: false, Description: "Light beams crossing the screen", VersionAdded: "1.0.0", Category: "abstract", }, { Name: "beam-text", RequiresText: true, Description: "Light beams revealing ASCII art", VersionAdded: "1.0.0", Category: "text", }, { Name: "ring-text", RequiresText: true, Description: "ASCII art with rotating colored rings", VersionAdded: "1.0.0", Category: "text", }, { Name: "blackhole", RequiresText: true, Description: "Text consumed by an animated blackhole", VersionAdded: "1.0.0", Category: "text", }, { Name: "aquarium", RequiresText: false, Description: "Animated underwater scene with fish", VersionAdded: "1.0.0", Category: "scene", }, { Name: "pour", RequiresText: true, Description: "Text pouring onto screen with color transition", VersionAdded: "1.0.0", Category: "text", }, { Name: "print", RequiresText: true, Description: "Typewriter-style text printing effect", VersionAdded: "1.0.0", Category: "text", }, { Name: "decrypt", RequiresText: true, Description: "Text decryption/reveal effect", VersionAdded: "1.0.0", Category: "text", }, }
EffectRegistry contains metadata for all available effects
var ThemeRegistry = []ThemeMetadata{ { Name: "dracula", Aliases: []string{}, Description: "Dracula dark theme with purple and pink accents", VersionAdded: "1.0.0", }, { Name: "catppuccin", Aliases: []string{"catppuccin-mocha"}, Description: "Catppuccin Mocha - soothing pastel theme", VersionAdded: "1.0.0", }, { Name: "nord", Aliases: []string{}, Description: "Nord arctic, north-bluish color palette", VersionAdded: "1.0.0", }, { Name: "tokyo-night", Aliases: []string{"tokyonight"}, Description: "Tokyo Night dark theme inspired by Tokyo", VersionAdded: "1.0.0", }, { Name: "gruvbox", Aliases: []string{}, Description: "Gruvbox retro groove color scheme", VersionAdded: "1.0.0", }, { Name: "material", Aliases: []string{}, Description: "Material Design color palette", VersionAdded: "1.0.0", }, { Name: "solarized", Aliases: []string{}, Description: "Solarized precision colors for machines and people", VersionAdded: "1.0.0", }, { Name: "monochrome", Aliases: []string{}, Description: "Grayscale monochrome theme", VersionAdded: "1.0.0", }, { Name: "transishardjob", Aliases: []string{}, Description: "Trans pride colors", VersionAdded: "1.0.0", }, { Name: "rama", Aliases: []string{}, Description: "Rama custom color scheme", VersionAdded: "1.0.0", }, { Name: "eldritch", Aliases: []string{}, Description: "Eldritch dark theme with purple and cyan", VersionAdded: "1.0.0", }, { Name: "dark", Aliases: []string{}, Description: "Simple dark theme with grayscale", VersionAdded: "1.0.0", }, }
ThemeRegistry contains metadata for all available themes
Functions ¶
func GetDefaultFirePalette ¶
func GetDefaultFirePalette() []string
GetDefaultFirePalette returns classic DOOM-style fire palette
func GetEffectNames ¶ added in v1.0.2
func GetEffectNames() []string
GetEffectNames returns all available effect names
func GetFirePalette ¶
GetFirePalette returns theme-specific fire colors
func GetFireworksPalette ¶
GetFireworksPalette returns theme-specific fireworks colors
func GetLibraryVersion ¶ added in v1.0.2
func GetLibraryVersion() string
GetLibraryVersion returns the sysc-Go animations library version
func GetMatrixPalette ¶
GetMatrixPalette returns theme-specific matrix rain colors
func GetParticlePalette ¶
GetParticlePalette returns theme-specific particle colors
func GetRainPalette ¶
GetRainPalette returns theme-specific rain colors
func GetScreensaverPalette ¶
CHANGED 2025-10-10 - Screensaver palette for theme-aware colors GetScreensaverPalette returns theme-specific colors for screensaver elements Returns: [background, ascii_primary, ascii_secondary, clock_primary, clock_secondary, date_color]
func GetTextBasedEffects ¶ added in v1.0.2
func GetTextBasedEffects() []string
GetTextBasedEffects returns names of effects that require text input
func GetThemeNames ¶ added in v1.0.2
func GetThemeNames() []string
GetThemeNames returns all available theme names (including aliases)
func IsTextBasedEffect ¶ added in v1.0.2
IsTextBasedEffect checks if an effect requires text input
Types ¶
type Anchor ¶ added in v1.0.1
type Anchor struct {
// contains filtered or unexported fields
}
Anchor represents a static anchor on the ocean floor
type Animation ¶
type Animation interface {
// Update advances the animation by one frame
Update()
// Render returns the current frame as a string
Render() string
// Reset restarts the animation from the beginning
Reset()
}
Animation interface that all effects implement
type AquariumConfig ¶ added in v1.0.1
type AquariumConfig struct {
Width int
Height int
FishColors []string
WaterColors []string
SeaweedColors []string
BubbleColor string
DiverColor string
BoatColor string
MermaidColor string
AnchorColor string
}
AquariumConfig holds configuration for the aquarium effect
type AquariumEffect ¶ added in v1.0.1
type AquariumEffect struct {
// contains filtered or unexported fields
}
AquariumEffect implements an animated aquarium scene
func NewAquariumEffect ¶ added in v1.0.1
func NewAquariumEffect(config AquariumConfig) *AquariumEffect
NewAquariumEffect creates a new aquarium effect
func (*AquariumEffect) Render ¶ added in v1.0.1
func (a *AquariumEffect) Render() string
Render converts the aquarium to colored text output
func (*AquariumEffect) Reset ¶ added in v1.0.1
func (a *AquariumEffect) Reset()
Reset restarts the animation
func (*AquariumEffect) Resize ¶ added in v1.0.1
func (a *AquariumEffect) Resize(width, height int)
Resize updates the aquarium dimensions
func (*AquariumEffect) Update ¶ added in v1.0.1
func (a *AquariumEffect) Update()
Update advances the aquarium animation
type BeamCharacter ¶ added in v1.0.1
type BeamCharacter struct {
// contains filtered or unexported fields
}
BeamCharacter represents a single character in the beams animation
type BeamGroup ¶ added in v1.0.1
type BeamGroup struct {
// contains filtered or unexported fields
}
BeamGroup represents a group of characters for beam animation
type BeamTextConfig ¶ added in v1.0.1
type BeamTextConfig struct {
Width int
Height int
Text string
Auto bool // Auto-size canvas to fit text
Display bool // Display mode: complete once and hold (true) or loop continuously (false)
BeamRowSymbols []rune
BeamColumnSymbols []rune
BeamDelay int
BeamRowSpeedRange [2]int
BeamColumnSpeedRange [2]int
BeamGradientStops []string
BeamGradientSteps int
BeamGradientFrames int
FinalGradientStops []string
FinalGradientSteps int
FinalGradientFrames int
FinalWipeSpeed int
}
BeamTextConfig holds configuration for the beam text effect
type BeamTextEffect ¶ added in v1.0.1
type BeamTextEffect struct {
// contains filtered or unexported fields
}
BeamTextEffect implements beams that travel across rows and columns, illuminating text
func NewBeamTextEffect ¶ added in v1.0.1
func NewBeamTextEffect(config BeamTextConfig) *BeamTextEffect
NewBeamTextEffect creates a new beam text effect with given configuration
func (*BeamTextEffect) Render ¶ added in v1.0.1
func (b *BeamTextEffect) Render() string
Render converts the beams effect to colored text output
func (*BeamTextEffect) Reset ¶ added in v1.0.1
func (b *BeamTextEffect) Reset()
Reset restarts the animation from the beginning
func (*BeamTextEffect) Resize ¶ added in v1.0.1
func (b *BeamTextEffect) Resize(width, height int)
Resize reinitializes the beam text effect with new dimensions
func (*BeamTextEffect) Update ¶ added in v1.0.1
func (b *BeamTextEffect) Update()
Update advances the beams animation by one frame
type BeamsConfig ¶ added in v1.0.1
type BeamsConfig struct {
Width int
Height int
BeamRowSymbols []rune
BeamColumnSymbols []rune
BeamDelay int
BeamRowSpeedRange [2]int
BeamColumnSpeedRange [2]int
BeamGradientStops []string
BeamGradientSteps int
BeamGradientFrames int
FinalGradientStops []string
FinalGradientSteps int
FinalGradientFrames int
FinalWipeSpeed int
}
BeamsConfig holds configuration for the beams background effect
type BeamsEffect ¶ added in v1.0.1
type BeamsEffect struct {
// Character data
Chars []BeamCharacter
// contains filtered or unexported fields
}
BeamsEffect implements beams as a full-screen background animation
func NewBeamsEffect ¶ added in v1.0.1
func NewBeamsEffect(config BeamsConfig) *BeamsEffect
NewBeamsEffect creates a new beams effect with given configuration
func (*BeamsEffect) Render ¶ added in v1.0.1
func (b *BeamsEffect) Render() string
Render converts the beams effect to colored text output
func (*BeamsEffect) Reset ¶ added in v1.0.1
func (b *BeamsEffect) Reset()
Reset restarts the animation from the beginning
func (*BeamsEffect) Resize ¶ added in v1.0.1
func (b *BeamsEffect) Resize(width, height int)
Resize reinitializes the beams effect with new dimensions
func (*BeamsEffect) Update ¶ added in v1.0.1
func (b *BeamsEffect) Update()
Update advances the beams animation by one frame
type BlackholeCharacter ¶ added in v1.0.1
type BlackholeCharacter struct {
// contains filtered or unexported fields
}
BlackholeCharacter represents a single character in the animation
type BlackholeConfig ¶ added in v1.0.1
type BlackholeConfig struct {
Width int
Height int
Text string
BlackholeColor string // Border color for singularity
StarColors []string // Colors for post-explosion stars
FinalGradientStops []string // Gradient for final text state
FinalGradientSteps int // Number of gradient steps
FinalGradientDir GradientDirection
StaticGradientStops []string // Gradient for static ASCII
StaticGradientDir GradientDirection
FormingFrames int // Frames for border formation
ConsumingFrames int // Frames for consumption
CollapsingFrames int // Frames for border collapse
ExplodingFrames int // Frames for explosion scatter
ReturningFrames int // Frames for return to text
StaticFrames int // Frames to display static text initially
}
BlackholeConfig holds the configuration for the Blackhole effect
type BlackholeEffect ¶ added in v1.0.1
type BlackholeEffect struct {
// contains filtered or unexported fields
}
BlackholeEffect represents the multi-phase blackhole animation
func NewBlackholeEffect ¶ added in v1.0.1
func NewBlackholeEffect(config BlackholeConfig) *BlackholeEffect
NewBlackholeEffect creates a new Blackhole effect
func (*BlackholeEffect) Render ¶ added in v1.0.1
func (e *BlackholeEffect) Render() string
Render returns the current frame as a colored string
func (*BlackholeEffect) Reset ¶ added in v1.0.1
func (e *BlackholeEffect) Reset()
Reset restarts the animation
func (*BlackholeEffect) Update ¶ added in v1.0.1
func (e *BlackholeEffect) Update()
Update advances the animation by one frame
type Boat ¶ added in v1.0.1
type Boat struct {
// contains filtered or unexported fields
}
Boat represents a boat on the surface
type BorderCharacter ¶ added in v1.0.1
type BorderCharacter struct {
// contains filtered or unexported fields
}
BorderCharacter represents a character on the blackhole border
type Bubble ¶ added in v1.0.1
type Bubble struct {
// contains filtered or unexported fields
}
Bubble represents a rising bubble
type Config ¶
type Config struct {
Width int // Terminal width in characters
Height int // Terminal height in characters
Theme string // Color theme name
}
Config holds common animation settings
type DecryptAnimationFrame ¶ added in v1.0.1
type DecryptAnimationFrame struct {
// contains filtered or unexported fields
}
DecryptAnimationFrame represents a single frame in a character's animation
type DecryptCharacter ¶ added in v1.0.1
type DecryptCharacter struct {
// contains filtered or unexported fields
}
DecryptCharacter represents a single character in the decryption effect
type DecryptConfig ¶ added in v1.0.1
type DecryptConfig struct {
Width int
Height int
Text string
Palette []string
TypingSpeed int
CiphertextColors []string
FinalGradientStops []string
FinalGradientSteps int
FinalGradientDirection string
}
DecryptConfig holds configuration for the decrypt effect
type DecryptEffect ¶ added in v1.0.1
type DecryptEffect struct {
// contains filtered or unexported fields
}
DecryptEffect implements a movie-style text decryption animation
func NewDecryptEffect ¶ added in v1.0.1
func NewDecryptEffect(config DecryptConfig) *DecryptEffect
NewDecryptEffect creates a new decrypt effect with given configuration
func (*DecryptEffect) Render ¶ added in v1.0.1
func (d *DecryptEffect) Render() string
Render converts the decrypt effect to colored text output
func (*DecryptEffect) Reset ¶ added in v1.0.1
func (d *DecryptEffect) Reset()
Reset restarts the animation from the beginning
func (*DecryptEffect) Update ¶ added in v1.0.1
func (d *DecryptEffect) Update()
Update advances the decrypt animation by one frame
type Diver ¶ added in v1.0.1
type Diver struct {
// contains filtered or unexported fields
}
Diver represents a scuba diver
type EffectMetadata ¶ added in v1.0.2
type EffectMetadata struct {
Name string // Effect name (e.g., "fire", "matrix")
RequiresText bool // Whether effect requires text input
Description string // Brief description
VersionAdded string // Version when effect was added
Category string // Effect category (e.g., "particle", "text", "abstract")
}
EffectMetadata describes an animation effect
func GetEffectMetadata ¶ added in v1.0.2
func GetEffectMetadata(name string) *EffectMetadata
GetEffectMetadata returns metadata for a specific effect
type FireEffect ¶
type FireEffect struct {
// contains filtered or unexported fields
}
FireEffect implements PSX DOOM-style fire algorithm with enhanced character gradient
func NewFireEffect ¶
func NewFireEffect(width, height int, palette []string) *FireEffect
NewFireEffect creates a new fire effect with given dimensions and theme palette
func (*FireEffect) Render ¶
func (f *FireEffect) Render() string
Render converts fire to colored block output with batched raw ANSI codes
func (*FireEffect) Resize ¶
func (f *FireEffect) Resize(width, height int)
Resize reinitializes the fire effect with new dimensions
func (*FireEffect) Update ¶
func (f *FireEffect) Update()
Update advances the fire simulation by one frame
func (*FireEffect) UpdatePalette ¶
func (f *FireEffect) UpdatePalette(palette []string)
UpdatePalette changes the fire color palette (for theme switching)
type FireTextEffect ¶ added in v1.0.1
type FireTextEffect struct {
// contains filtered or unexported fields
}
FireTextEffect implements fire animation with ASCII art displayed as negative space Fire burns around the text, creating text shape with empty areas
func NewFireTextEffect ¶ added in v1.0.1
func NewFireTextEffect(width, height int, palette []string, text string) *FireTextEffect
NewFireTextEffect creates a new fire-text effect with given dimensions, palette, and ASCII art
func (*FireTextEffect) Render ¶ added in v1.0.1
func (f *FireTextEffect) Render() string
Render converts fire to colored block output with batched raw ANSI codes Text areas are rendered as empty space (negative space effect)
func (*FireTextEffect) Resize ¶ added in v1.0.1
func (f *FireTextEffect) Resize(width, height int)
Resize reinitializes the fire effect with new dimensions
func (*FireTextEffect) Update ¶ added in v1.0.1
func (f *FireTextEffect) Update()
Update advances the fire simulation by one frame
func (*FireTextEffect) UpdatePalette ¶ added in v1.0.1
func (f *FireTextEffect) UpdatePalette(palette []string)
UpdatePalette changes the fire color palette (for theme switching)
type FireworksEffect ¶
type FireworksEffect struct {
// contains filtered or unexported fields
}
FireworksEffect implements fireworks animation
func NewFireworksEffect ¶
func NewFireworksEffect(width, height int, palette []string) *FireworksEffect
NewFireworksEffect creates a new fireworks effect
func (*FireworksEffect) Render ¶
func (fw *FireworksEffect) Render() string
Render converts the fireworks to colored text output
func (*FireworksEffect) Resize ¶
func (fw *FireworksEffect) Resize(width, height int)
Resize reinitializes the fireworks effect with new dimensions
func (*FireworksEffect) Update ¶
func (fw *FireworksEffect) Update()
Update advances the fireworks simulation
func (*FireworksEffect) UpdatePalette ¶
func (fw *FireworksEffect) UpdatePalette(palette []string)
UpdatePalette changes the fireworks color palette
type Fish ¶ added in v1.0.1
type Fish struct {
// contains filtered or unexported fields
}
Fish represents a swimming fish
type FrozenChar ¶ added in v1.0.1
type FrozenChar struct {
// contains filtered or unexported fields
}
FrozenChar represents a rain character that has frozen to form the art
type FrozenMatrixChar ¶ added in v1.0.1
type FrozenMatrixChar struct {
// contains filtered or unexported fields
}
FrozenMatrixChar represents a matrix character that has frozen to form the art
type GradientDirection ¶ added in v1.0.1
type GradientDirection int
GradientDirection specifies the direction of gradient application
const ( GradientHorizontal GradientDirection = iota // Left to right GradientVertical // Top to bottom GradientDiagonal // Top-left to bottom-right GradientRadial // Center outward )
type MatrixArtEffect ¶ added in v1.0.1
type MatrixArtEffect struct {
// contains filtered or unexported fields
}
MatrixArtEffect implements Matrix rain that crystallizes into ASCII art
func NewMatrixArtEffect ¶ added in v1.0.1
func NewMatrixArtEffect(width, height int, palette []string, text string) *MatrixArtEffect
NewMatrixArtEffect creates a new matrix-art effect
func (*MatrixArtEffect) Render ¶ added in v1.0.1
func (m *MatrixArtEffect) Render() string
Render converts the matrix and frozen art to colored output
func (*MatrixArtEffect) Reset ¶ added in v1.0.1
func (m *MatrixArtEffect) Reset()
Reset clears frozen characters to restart the formation
func (*MatrixArtEffect) Update ¶ added in v1.0.1
func (m *MatrixArtEffect) Update()
Update advances the simulation by one frame
type MatrixChar ¶
MatrixChar represents a single character in a streak
type MatrixEffect ¶
type MatrixEffect struct {
// contains filtered or unexported fields
}
MatrixEffect implements Matrix digital rain animation using particle-based streaks
func NewMatrixEffect ¶
func NewMatrixEffect(width, height int, palette []string) *MatrixEffect
NewMatrixEffect creates a new Matrix effect with given dimensions and theme palette
func (*MatrixEffect) Render ¶
func (m *MatrixEffect) Render() string
Render converts the Matrix streaks to colored text output
func (*MatrixEffect) Reset ¶ added in v1.0.1
func (m *MatrixEffect) Reset()
Reset restarts the animation from the beginning
func (*MatrixEffect) Resize ¶
func (m *MatrixEffect) Resize(width, height int)
Resize reinitializes the Matrix effect with new dimensions
func (*MatrixEffect) Update ¶
func (m *MatrixEffect) Update()
Update advances the Matrix simulation by one frame
func (*MatrixEffect) UpdatePalette ¶
func (m *MatrixEffect) UpdatePalette(palette []string)
UpdatePalette changes the Matrix color palette (for theme switching)
type MatrixStreak ¶
type MatrixStreak struct {
X int // X position (column)
Y int // Y position of head
Length int // Length of streak
Speed int // Movement speed (frames per pixel)
Counter int // Frame counter for movement
Active bool // Whether streak is active
}
MatrixStreak represents a single vertical streak falling down the screen
type Mermaid ¶ added in v1.0.1
type Mermaid struct {
// contains filtered or unexported fields
}
Mermaid represents a swimming mermaid
type Particle ¶
type Particle struct {
// contains filtered or unexported fields
}
Particle represents a single firework particle
type PourCharacter ¶ added in v1.0.1
type PourCharacter struct {
// contains filtered or unexported fields
}
PourCharacter represents a single character in the pour animation
type PourConfig ¶ added in v1.0.1
type PourConfig struct {
Width int
Height int
Text string
PourDirection string
PourSpeed int
MovementSpeed float64
EasingFunction string // "easeIn", "easeOut", "easeInOut" (default: "easeIn")
Gap int
StartingColor string
FinalGradientStops []string
FinalGradientSteps int
FinalGradientFrames int
FinalGradientDirection string
Auto bool // Auto-size canvas to fit text dimensions
Display bool // Display mode: complete once and hold (true) or loop (false)
HoldFrames int // Frames to hold completed state before looping (default 100)
}
PourConfig holds configuration for the pour effect
type PourEffect ¶ added in v1.0.1
type PourEffect struct {
// contains filtered or unexported fields
}
PourEffect implements a character pouring animation from different directions
func NewPourEffect ¶ added in v1.0.1
func NewPourEffect(config PourConfig) *PourEffect
NewPourEffect creates a new pour effect with given configuration
func (*PourEffect) Render ¶ added in v1.0.1
func (p *PourEffect) Render() string
Render converts the pour effect to colored text output
func (*PourEffect) Reset ¶ added in v1.0.1
func (p *PourEffect) Reset()
Reset restarts the animation from the beginning
func (*PourEffect) Resize ¶ added in v1.0.1
func (p *PourEffect) Resize(width, height int)
Resize updates the effect dimensions and reinitializes
func (*PourEffect) Update ¶ added in v1.0.1
func (p *PourEffect) Update()
Update advances the pour animation by one frame
type PrintConfig ¶ added in v1.0.1
type PrintConfig struct {
Width int
Height int
Text string
FramesPerChar int // Frames to wait before printing next character (replaces CharDelay)
PrintSpeed int // Characters to print per update cycle
PrintHeadSymbol string
TrailSymbols []string
GradientStops []string
Auto bool // Auto-size canvas to fit text dimensions
Display bool // Display mode: complete once and hold (true) or loop (false)
HoldFrames int // Frames to hold completed state before looping (default 100)
}
PrintConfig holds configuration for the print effect
type PrintEffect ¶ added in v1.0.1
type PrintEffect struct {
// contains filtered or unexported fields
}
PrintEffect creates a typewriter/printer effect for text
func NewPrintEffect ¶ added in v1.0.1
func NewPrintEffect(config PrintConfig) *PrintEffect
NewPrintEffect creates a new print effect with given configuration
func (*PrintEffect) IsComplete ¶ added in v1.0.1
func (p *PrintEffect) IsComplete() bool
IsComplete returns whether the animation is finished
func (*PrintEffect) Render ¶ added in v1.0.1
func (p *PrintEffect) Render() string
Render converts the print effect to text output Render returns the current state of the print effect with colors
func (*PrintEffect) Reset ¶ added in v1.0.1
func (p *PrintEffect) Reset()
Reset restarts the print effect animation
func (*PrintEffect) Resize ¶ added in v1.0.1
func (p *PrintEffect) Resize(width, height int)
Resize updates the effect dimensions and reinitializes
func (*PrintEffect) Update ¶ added in v1.0.1
func (p *PrintEffect) Update()
Update advances the print effect animation
type RainArtEffect ¶ added in v1.0.1
type RainArtEffect struct {
// contains filtered or unexported fields
}
RainArtEffect implements rain animation that gradually forms ASCII art
func NewRainArtEffect ¶ added in v1.0.1
func NewRainArtEffect(width, height int, palette []string, text string) *RainArtEffect
NewRainArtEffect creates a new rain-art effect
func (*RainArtEffect) Render ¶ added in v1.0.1
func (r *RainArtEffect) Render() string
Render converts the rain and frozen art to colored output
func (*RainArtEffect) Reset ¶ added in v1.0.1
func (r *RainArtEffect) Reset()
Reset clears frozen characters to restart the formation
func (*RainArtEffect) Update ¶ added in v1.0.1
func (r *RainArtEffect) Update()
Update advances the simulation by one frame
type RainDrop ¶ added in v1.0.1
type RainDrop struct {
X int // X position
Y int // Y position
Speed int // Falling speed
Char rune // Character to display
Color string // Color hex code
}
RainDrop represents a single falling character
type RainEffect ¶
type RainEffect struct {
// contains filtered or unexported fields
}
RainEffect implements ASCII character rain animation
func NewRainEffect ¶
func NewRainEffect(width, height int, palette []string) *RainEffect
NewRainEffect creates a new rain effect with given dimensions and theme palette
func (*RainEffect) Render ¶
func (r *RainEffect) Render() string
Render converts the rain drops to colored text output
func (*RainEffect) Reset ¶ added in v1.0.1
func (r *RainEffect) Reset()
Reset restarts the animation from the beginning
func (*RainEffect) Resize ¶
func (r *RainEffect) Resize(width, height int)
Resize reinitializes the rain effect with new dimensions
func (*RainEffect) Update ¶
func (r *RainEffect) Update()
Update advances the rain simulation by one frame
func (*RainEffect) UpdatePalette ¶
func (r *RainEffect) UpdatePalette(palette []string)
UpdatePalette changes the rain color palette (for theme switching)
type Ring ¶ added in v1.0.1
type Ring struct {
// contains filtered or unexported fields
}
Ring represents a circular ring of positions
type RingTextCharacter ¶ added in v1.0.1
type RingTextCharacter struct {
// contains filtered or unexported fields
}
RingTextCharacter represents a single character in the animation
type RingTextConfig ¶ added in v1.0.1
type RingTextConfig struct {
Width int
Height int
Text string
RingColors []string // Colors for each ring
RingGap float64 // Distance between rings as a percent of smallest dimension
SpinSpeedRange [2]float64 // Speed range for rotation (min, max radians per frame)
SpinDuration int // Frames to spin on rings
DisperseDuration int // Frames to stay in dispersed state
SpinDisperseCycles int // Number of spin/disperse cycles before returning
TransitionFrames int // Frames for transitions between states
StaticFrames int // Frames to display static text initially
FinalGradientStops []string // Gradient for final text state
FinalGradientSteps int // Number of gradient steps
StaticGradientStops []string // Gradient for static ASCII presentation
StaticGradientDir GradientDirection // Direction of static gradient
}
RingTextConfig holds the configuration for the RingText effect
type RingTextEffect ¶ added in v1.0.1
type RingTextEffect struct {
// contains filtered or unexported fields
}
RingTextEffect represents the multi-phase ring text animation
func NewRingTextEffect ¶ added in v1.0.1
func NewRingTextEffect(config RingTextConfig) *RingTextEffect
NewRingTextEffect creates a new RingText effect
func (*RingTextEffect) Render ¶ added in v1.0.1
func (e *RingTextEffect) Render() string
Render returns the current frame as a colored string
func (*RingTextEffect) Reset ¶ added in v1.0.1
func (e *RingTextEffect) Reset()
Reset restarts the animation
func (*RingTextEffect) Update ¶ added in v1.0.1
func (e *RingTextEffect) Update()
Update advances the animation by one frame
type RoastingTicker ¶
type RoastingTicker struct {
// contains filtered or unexported fields
}
RoastingTicker provides scrolling text with WM-specific roasts
func NewRoastingTicker ¶
func NewRoastingTicker(wmName string) *RoastingTicker
NewRoastingTicker creates a scrolling roast ticker
func (*RoastingTicker) GetScrollingText ¶
func (r *RoastingTicker) GetScrollingText(width int) string
GetScrollingText returns the scrolling text for given width Cycle through individual roast phrases
func (*RoastingTicker) UpdateWM ¶
func (r *RoastingTicker) UpdateWM(wmName string)
UpdateWM changes the roast text when WM selection changes
type Seaweed ¶ added in v1.0.1
type Seaweed struct {
// contains filtered or unexported fields
}
Seaweed represents swaying underwater plants
type ThemeMetadata ¶ added in v1.0.2
type ThemeMetadata struct {
Name string // Theme name (e.g., "nord", "dracula")
Aliases []string // Alternative names for the theme
Description string // Brief description
VersionAdded string // Version when theme was added
}
ThemeMetadata describes a color theme
func GetThemeMetadata ¶ added in v1.0.2
func GetThemeMetadata(name string) *ThemeMetadata
GetThemeMetadata returns metadata for a specific theme
type TickerAnimation ¶
type TickerAnimation struct {
// contains filtered or unexported fields
}
TickerAnimation provides animated loading/thinking effect
func NewTickerAnimation ¶
func NewTickerAnimation() *TickerAnimation
NewTickerAnimation creates a new ticker animation
func (*TickerAnimation) GetFrame ¶
func (t *TickerAnimation) GetFrame() string
GetFrame returns the current animation frame Returns a string like "⠋", "⠙", "⠹", etc. (braille spinner)
func (*TickerAnimation) GetTitle ¶
func (t *TickerAnimation) GetTitle(width int) string
GetTitle returns the animated title replacing "SESSIONS"
type TypewriterTicker ¶
type TypewriterTicker struct {
// contains filtered or unexported fields
}
TypewriterTicker types out text one character at a time with a block cursor This provides a "typewriter" effect for the roast messages
func NewTypewriterTicker ¶
func NewTypewriterTicker(wmName string) *TypewriterTicker
NewTypewriterTicker creates a new typewriter ticker
func (*TypewriterTicker) GetTypewriterText ¶
func (t *TypewriterTicker) GetTypewriterText(width int) string
GetTypewriterText returns the current typewriter text with block cursor
func (*TypewriterTicker) UpdateWM ¶
func (t *TypewriterTicker) UpdateWM(wmName string)
UpdateWM changes the roast text when WM selection changes