Documentation
¶
Index ¶
- Variables
- func AnimatedButton(text string, onClick func(event js.Value), engine *AnimationEngine) vdom.Component
- func AnimatedCard(title, content string, engine *AnimationEngine) vdom.Component
- func AnimatedList(items []string, engine *AnimationEngine) vdom.Component
- func EaseInBack(t float64) float64
- func EaseInBounce(t float64) float64
- func EaseInCirc(t float64) float64
- func EaseInCubic(t float64) float64
- func EaseInElastic(t float64) float64
- func EaseInExpo(t float64) float64
- func EaseInOutBack(t float64) float64
- func EaseInOutBounce(t float64) float64
- func EaseInOutCirc(t float64) float64
- func EaseInOutCubic(t float64) float64
- func EaseInOutElastic(t float64) float64
- func EaseInOutExpo(t float64) float64
- func EaseInOutQuad(t float64) float64
- func EaseInOutQuart(t float64) float64
- func EaseInOutQuint(t float64) float64
- func EaseInOutSine(t float64) float64
- func EaseInQuad(t float64) float64
- func EaseInQuart(t float64) float64
- func EaseInQuint(t float64) float64
- func EaseInSine(t float64) float64
- func EaseOutBack(t float64) float64
- func EaseOutBounce(t float64) float64
- func EaseOutCirc(t float64) float64
- func EaseOutCubic(t float64) float64
- func EaseOutElastic(t float64) float64
- func EaseOutExpo(t float64) float64
- func EaseOutQuad(t float64) float64
- func EaseOutQuart(t float64) float64
- func EaseOutQuint(t float64) float64
- func EaseOutSine(t float64) float64
- func Linear(t float64) float64
- type AnimatedComponent
- type Animation
- type AnimationBuilder
- func (ab *AnimationBuilder) Animate(property string, from, to interface{}, unit string) *AnimationBuilder
- func (ab *AnimationBuilder) Build() *Animation
- func (ab *AnimationBuilder) FadeIn() *AnimationBuilder
- func (ab *AnimationBuilder) FadeOut() *AnimationBuilder
- func (ab *AnimationBuilder) FadeTo(opacity float64) *AnimationBuilder
- func (ab *AnimationBuilder) MoveTo(x, y float64) *AnimationBuilder
- func (ab *AnimationBuilder) OnCancel(callback func()) *AnimationBuilder
- func (ab *AnimationBuilder) OnComplete(callback func()) *AnimationBuilder
- func (ab *AnimationBuilder) OnStart(callback func()) *AnimationBuilder
- func (ab *AnimationBuilder) OnUpdate(callback func(progress float64)) *AnimationBuilder
- func (ab *AnimationBuilder) RotateTo(degrees float64) *AnimationBuilder
- func (ab *AnimationBuilder) ScaleTo(scale float64) *AnimationBuilder
- func (ab *AnimationBuilder) SetDelay(delay time.Duration) *AnimationBuilder
- func (ab *AnimationBuilder) SetDuration(duration time.Duration) *AnimationBuilder
- func (ab *AnimationBuilder) SetEasing(easing EasingFunc) *AnimationBuilder
- func (ab *AnimationBuilder) SetElement(element js.Value) *AnimationBuilder
- func (ab *AnimationBuilder) SetID(id string) *AnimationBuilder
- func (ab *AnimationBuilder) SlideDown(distance float64) *AnimationBuilder
- func (ab *AnimationBuilder) SlideLeft(distance float64) *AnimationBuilder
- func (ab *AnimationBuilder) SlideRight(distance float64) *AnimationBuilder
- func (ab *AnimationBuilder) SlideUp(distance float64) *AnimationBuilder
- type AnimationEngine
- func (e *AnimationEngine) AddAnimation(anim *Animation)
- func (e *AnimationEngine) GetActiveAnimations() []string
- func (e *AnimationEngine) OnNextFrame(callback func())
- func (e *AnimationEngine) PauseAnimation(id string)
- func (e *AnimationEngine) RemoveAnimation(id string)
- func (e *AnimationEngine) ResumeAnimation(id string)
- func (e *AnimationEngine) Start()
- func (e *AnimationEngine) Stop()
- type AnimationState
- type Color
- type EasingFunc
- type FadeIn
- type FloatingEffect
- type GlowPulseEffect
- type MagneticEffect
- type Particle
- type ParticleConfig
- type ParticleSystem
- func (ps *ParticleSystem) Clear()
- func (ps *ParticleSystem) CreateParticle(x, y float64, config ParticleConfig) *Particle
- func (ps *ParticleSystem) CreateParticleBurst(x, y float64, config ParticleConfig)
- func (ps *ParticleSystem) GetActiveParticleCount() int
- func (ps *ParticleSystem) SetupMouseClickHandler(config ParticleConfig)
- type ParticleTrailEffect
- type PropertyAnimation
- type RippleEffect
- type ScaleIn
- type SlideIn
- type Spring
- type Stagger
- type TextMorphEffect
- type Timeline
- func Bounce(engine *AnimationEngine, element js.Value, height float64, ...) *Timeline
- func NewTimeline(engine *AnimationEngine) *Timeline
- func Parallel(engine *AnimationEngine, animations ...*Animation) *Timeline
- func Sequence(engine *AnimationEngine, animations ...*Animation) *Timeline
- func Shake(engine *AnimationEngine, element js.Value, intensity float64, ...) *Timeline
- func StaggerTimeline(engine *AnimationEngine, staggerDelay time.Duration, animations ...*Animation) *Timeline
- func TypeWriter(engine *AnimationEngine, element js.Value, text string, ...) *Timeline
- func Wiggle(engine *AnimationEngine, element js.Value, angle float64, ...) *Timeline
- func (t *Timeline) AddAnimation(startTime time.Duration, anim *Animation) *Timeline
- func (t *Timeline) AddAnimationAfter(anim *Animation) *Timeline
- func (t *Timeline) AddAnimationWith(anim *Animation) *Timeline
- func (t *Timeline) GetDuration() time.Duration
- func (t *Timeline) GetPlayhead() time.Duration
- func (t *Timeline) GetProgress() float64
- func (t *Timeline) IsComplete() bool
- func (t *Timeline) IsPaused() bool
- func (t *Timeline) IsPlaying() bool
- func (t *Timeline) OnComplete(callback func()) *Timeline
- func (t *Timeline) OnUpdate(callback func(progress float64)) *Timeline
- func (t *Timeline) Pause()
- func (t *Timeline) Play()
- func (t *Timeline) Resume()
- func (t *Timeline) Seek(seekTime time.Duration)
- func (t *Timeline) SetLoop(loop bool) *Timeline
- func (t *Timeline) Stop()
- func (t *Timeline) Update()
- type TimelineAnimation
- type TimelineBuilder
- func (tb *TimelineBuilder) At(time time.Duration, anim *Animation) *TimelineBuilder
- func (tb *TimelineBuilder) Build() *Timeline
- func (tb *TimelineBuilder) Loop() *TimelineBuilder
- func (tb *TimelineBuilder) Then(anim *Animation) *TimelineBuilder
- func (tb *TimelineBuilder) With(anim *Animation) *TimelineBuilder
- type Vector2
Constants ¶
This section is empty.
Variables ¶
var ( // Most commonly used easing functions EaseIn = EaseInCubic EaseOut = EaseOutCubic EaseInOut = EaseInOutCubic // Smooth and natural feeling Smooth = EaseInOutSine // Quick and snappy Snappy = EaseOutBack // Bouncy and playful Bouncy = EaseOutBounce // Elastic and spring-like Elastic = EaseOutElastic )
Predefined common easing functions
Functions ¶
func AnimatedButton ¶
func AnimatedButton(text string, onClick func(event js.Value), engine *AnimationEngine) vdom.Component
AnimatedButton creates an animated button with hover effects
func AnimatedCard ¶
func AnimatedCard(title, content string, engine *AnimationEngine) vdom.Component
AnimatedCard creates an animated card component
func AnimatedList ¶
func AnimatedList(items []string, engine *AnimationEngine) vdom.Component
AnimatedList creates an animated list with staggered item animations
func EaseInOutBack ¶
func EaseInOutBounce ¶
func EaseInOutCirc ¶
func EaseInOutCubic ¶
func EaseInOutElastic ¶
func EaseInOutExpo ¶
func EaseInOutQuad ¶
func EaseInOutQuart ¶
func EaseInOutQuint ¶
func EaseInOutSine ¶
func EaseOutBack ¶
func EaseOutBounce ¶
func EaseOutCirc ¶
func EaseOutCubic ¶
func EaseOutElastic ¶
func EaseOutExpo ¶
func EaseOutQuad ¶
func EaseOutQuart ¶
func EaseOutQuint ¶
func EaseOutSine ¶
Types ¶
type AnimatedComponent ¶
type AnimatedComponent struct {
// contains filtered or unexported fields
}
AnimatedComponent wraps any component with animation capabilities
func NewAnimatedComponent ¶
func NewAnimatedComponent(child vdom.Component, engine *AnimationEngine) *AnimatedComponent
NewAnimatedComponent creates a new animated component wrapper
func (*AnimatedComponent) Render ¶
func (ac *AnimatedComponent) Render() *vdom.VNode
Render renders the wrapped component with animation classes
type Animation ¶
type Animation struct {
ID string
StartTime time.Time
Duration time.Duration
Delay time.Duration
Easing EasingFunc
Properties []PropertyAnimation
State AnimationState
Progress float64
OnStart func()
OnUpdate func(progress float64)
OnComplete func()
OnCancel func()
// contains filtered or unexported fields
}
Animation represents a single animation instance
type AnimationBuilder ¶
type AnimationBuilder struct {
// contains filtered or unexported fields
}
AnimationBuilder provides a fluent interface for creating animations
func NewAnimation ¶
func NewAnimation() *AnimationBuilder
NewAnimation creates a new animation builder
func (*AnimationBuilder) Animate ¶
func (ab *AnimationBuilder) Animate(property string, from, to interface{}, unit string) *AnimationBuilder
Animate adds a property animation
func (*AnimationBuilder) Build ¶
func (ab *AnimationBuilder) Build() *Animation
Build returns the constructed animation
func (*AnimationBuilder) FadeIn ¶
func (ab *AnimationBuilder) FadeIn() *AnimationBuilder
FadeIn animates opacity from 0 to 1
func (*AnimationBuilder) FadeOut ¶
func (ab *AnimationBuilder) FadeOut() *AnimationBuilder
FadeOut animates opacity from current to 0
func (*AnimationBuilder) FadeTo ¶
func (ab *AnimationBuilder) FadeTo(opacity float64) *AnimationBuilder
FadeTo animates opacity
func (*AnimationBuilder) MoveTo ¶
func (ab *AnimationBuilder) MoveTo(x, y float64) *AnimationBuilder
MoveTo animates position
func (*AnimationBuilder) OnCancel ¶
func (ab *AnimationBuilder) OnCancel(callback func()) *AnimationBuilder
OnCancel sets the onCancel callback
func (*AnimationBuilder) OnComplete ¶
func (ab *AnimationBuilder) OnComplete(callback func()) *AnimationBuilder
OnComplete sets the onComplete callback
func (*AnimationBuilder) OnStart ¶
func (ab *AnimationBuilder) OnStart(callback func()) *AnimationBuilder
OnStart sets the onStart callback
func (*AnimationBuilder) OnUpdate ¶
func (ab *AnimationBuilder) OnUpdate(callback func(progress float64)) *AnimationBuilder
OnUpdate sets the onUpdate callback
func (*AnimationBuilder) RotateTo ¶
func (ab *AnimationBuilder) RotateTo(degrees float64) *AnimationBuilder
RotateTo animates rotation
func (*AnimationBuilder) ScaleTo ¶
func (ab *AnimationBuilder) ScaleTo(scale float64) *AnimationBuilder
ScaleTo animates scale
func (*AnimationBuilder) SetDelay ¶
func (ab *AnimationBuilder) SetDelay(delay time.Duration) *AnimationBuilder
SetDelay sets the animation delay
func (*AnimationBuilder) SetDuration ¶
func (ab *AnimationBuilder) SetDuration(duration time.Duration) *AnimationBuilder
SetDuration sets the animation duration
func (*AnimationBuilder) SetEasing ¶
func (ab *AnimationBuilder) SetEasing(easing EasingFunc) *AnimationBuilder
SetEasing sets the easing function
func (*AnimationBuilder) SetElement ¶
func (ab *AnimationBuilder) SetElement(element js.Value) *AnimationBuilder
SetElement sets the target DOM element
func (*AnimationBuilder) SetID ¶
func (ab *AnimationBuilder) SetID(id string) *AnimationBuilder
SetID sets the animation ID
func (*AnimationBuilder) SlideDown ¶
func (ab *AnimationBuilder) SlideDown(distance float64) *AnimationBuilder
SlideDown slides element down
func (*AnimationBuilder) SlideLeft ¶
func (ab *AnimationBuilder) SlideLeft(distance float64) *AnimationBuilder
SlideLeft slides element to the left
func (*AnimationBuilder) SlideRight ¶
func (ab *AnimationBuilder) SlideRight(distance float64) *AnimationBuilder
SlideRight slides element to the right
func (*AnimationBuilder) SlideUp ¶
func (ab *AnimationBuilder) SlideUp(distance float64) *AnimationBuilder
SlideUp slides element up
type AnimationEngine ¶
type AnimationEngine struct {
// contains filtered or unexported fields
}
AnimationEngine manages all active animations
func NewAnimationEngine ¶
func NewAnimationEngine(r *renderer.Renderer) *AnimationEngine
NewAnimationEngine creates a new animation engine
func (*AnimationEngine) AddAnimation ¶
func (e *AnimationEngine) AddAnimation(anim *Animation)
AddAnimation adds a new animation to the engine
func (*AnimationEngine) GetActiveAnimations ¶
func (e *AnimationEngine) GetActiveAnimations() []string
GetActiveAnimations returns a copy of active animation IDs
func (*AnimationEngine) OnNextFrame ¶
func (e *AnimationEngine) OnNextFrame(callback func())
OnNextFrame schedules a callback for the next animation frame
func (*AnimationEngine) PauseAnimation ¶
func (e *AnimationEngine) PauseAnimation(id string)
PauseAnimation pauses an animation by ID
func (*AnimationEngine) RemoveAnimation ¶
func (e *AnimationEngine) RemoveAnimation(id string)
RemoveAnimation removes an animation by ID
func (*AnimationEngine) ResumeAnimation ¶
func (e *AnimationEngine) ResumeAnimation(id string)
ResumeAnimation resumes a paused animation by ID
type AnimationState ¶
type AnimationState int
AnimationState represents the current state of an animation
const ( AnimationPending AnimationState = iota AnimationRunning AnimationPaused AnimationComplete AnimationCancelled )
type Color ¶
type Color struct {
R, G, B, A float64
}
Color utilities for color interpolation
func ParseColor ¶
ParseColor parses a color string (hex, rgb, rgba)
type EasingFunc ¶
EasingFunc defines the signature for easing functions
func CreateBezier ¶
func CreateBezier(x1, y1, x2, y2 float64) EasingFunc
Custom easing function builders
func CreateSpring ¶
func CreateSpring(tension, friction float64) EasingFunc
Spring easing with custom parameters
type FadeIn ¶
type FadeIn struct {
*AnimatedComponent
// contains filtered or unexported fields
}
FadeIn creates a fade-in animation component
func NewFadeIn ¶
func NewFadeIn(child vdom.Component, engine *AnimationEngine) *FadeIn
NewFadeIn creates a fade-in animated component
func (*FadeIn) SetDuration ¶
SetDuration sets the animation duration
func (*FadeIn) SetEasing ¶
func (f *FadeIn) SetEasing(easing EasingFunc) *FadeIn
SetEasing sets the easing function
type FloatingEffect ¶
type FloatingEffect struct {
// contains filtered or unexported fields
}
FloatingEffect creates floating animations
func NewFloatingEffect ¶
func NewFloatingEffect(engine *AnimationEngine) *FloatingEffect
NewFloatingEffect creates a new floating effect
func (*FloatingEffect) StartFloating ¶
StartFloating starts a continuous floating animation
type GlowPulseEffect ¶
type GlowPulseEffect struct {
// contains filtered or unexported fields
}
GlowPulseEffect creates a pulsing glow effect
func NewGlowPulseEffect ¶
func NewGlowPulseEffect(engine *AnimationEngine) *GlowPulseEffect
NewGlowPulseEffect creates a new glow pulse effect
func (*GlowPulseEffect) StartGlowPulse ¶
func (gpe *GlowPulseEffect) StartGlowPulse(element js.Value, color Color, intensity float64, duration time.Duration)
StartGlowPulse starts a pulsing glow animation
type MagneticEffect ¶
type MagneticEffect struct {
// contains filtered or unexported fields
}
MagneticEffect creates a magnetic attraction effect
func NewMagneticEffect ¶
func NewMagneticEffect(engine *AnimationEngine) *MagneticEffect
NewMagneticEffect creates a new magnetic effect
func (*MagneticEffect) AttractElements ¶
func (me *MagneticEffect) AttractElements(elements []js.Value, centerX, centerY float64, strength float64, duration time.Duration)
AttractElements attracts elements to a central point
type Particle ¶
type Particle struct {
ID string
Element js.Value
Position Vector2
Velocity Vector2
Size float64
Color Color
Life float64 // 0.0 to 1.0
MaxLife float64 // in seconds
Gravity float64
Fade bool
Scale bool
}
Particle represents a single particle in the system
type ParticleConfig ¶
type ParticleConfig struct {
Count int
MinSize float64
MaxSize float64
MinSpeed float64
MaxSpeed float64
LifeTime float64
Gravity float64
Colors []Color
Fade bool
Scale bool
}
ParticleConfig defines the configuration for particle creation
func DefaultParticleConfig ¶
func DefaultParticleConfig() ParticleConfig
DefaultParticleConfig returns a default particle configuration
func FireworkConfig ¶
func FireworkConfig() ParticleConfig
FireworkConfig creates a firework-like particle burst
func SparkleConfig ¶
func SparkleConfig() ParticleConfig
SparkleConfig creates a gentle sparkle effect
type ParticleSystem ¶
type ParticleSystem struct {
// contains filtered or unexported fields
}
ParticleSystem manages a collection of particles
func NewParticleSystem ¶
func NewParticleSystem(engine *AnimationEngine) *ParticleSystem
NewParticleSystem creates a new particle system
func (*ParticleSystem) Clear ¶
func (ps *ParticleSystem) Clear()
Clear removes all particles from the system
func (*ParticleSystem) CreateParticle ¶
func (ps *ParticleSystem) CreateParticle(x, y float64, config ParticleConfig) *Particle
CreateParticle creates a new particle at the specified position
func (*ParticleSystem) CreateParticleBurst ¶
func (ps *ParticleSystem) CreateParticleBurst(x, y float64, config ParticleConfig)
CreateParticleBurst creates a burst of particles at the specified position
func (*ParticleSystem) GetActiveParticleCount ¶
func (ps *ParticleSystem) GetActiveParticleCount() int
GetActiveParticleCount returns the number of active particles
func (*ParticleSystem) SetupMouseClickHandler ¶
func (ps *ParticleSystem) SetupMouseClickHandler(config ParticleConfig)
SetupMouseClickHandler sets up a global mouse click handler for particle bursts
type ParticleTrailEffect ¶
type ParticleTrailEffect struct {
// contains filtered or unexported fields
}
ParticleTrailEffect creates particle trails following mouse movement
func NewParticleTrailEffect ¶
func NewParticleTrailEffect(engine *AnimationEngine, particleSystem *ParticleSystem) *ParticleTrailEffect
NewParticleTrailEffect creates a new particle trail effect
func (*ParticleTrailEffect) StartTrail ¶
func (pte *ParticleTrailEffect) StartTrail(config ParticleConfig)
StartTrail starts the particle trail effect
func (*ParticleTrailEffect) StopTrail ¶
func (pte *ParticleTrailEffect) StopTrail()
StopTrail stops the particle trail effect
type PropertyAnimation ¶
type PropertyAnimation struct {
Property string
From interface{}
To interface{}
Current interface{}
Unit string // e.g., "px", "%", "deg"
Interpolate func(from, to interface{}, progress float64) interface{}
}
PropertyAnimation represents an animated property
type RippleEffect ¶
type RippleEffect struct {
// contains filtered or unexported fields
}
RippleEffect creates a ripple animation
func NewRippleEffect ¶
func NewRippleEffect(engine *AnimationEngine) *RippleEffect
NewRippleEffect creates a new ripple effect
func (*RippleEffect) CreateRipple ¶
func (re *RippleEffect) CreateRipple(x, y float64, color Color, maxRadius float64, duration time.Duration)
CreateRipple creates a ripple effect at the specified position
type ScaleIn ¶
type ScaleIn struct {
*AnimatedComponent
// contains filtered or unexported fields
}
ScaleIn creates a scale-in animation component
func NewScaleIn ¶
func NewScaleIn(child vdom.Component, engine *AnimationEngine) *ScaleIn
NewScaleIn creates a scale-in animated component
func (*ScaleIn) SetDuration ¶
SetDuration sets the animation duration
func (*ScaleIn) SetEasing ¶
func (sc *ScaleIn) SetEasing(easing EasingFunc) *ScaleIn
SetEasing sets the easing function
type SlideIn ¶
type SlideIn struct {
*AnimatedComponent
// contains filtered or unexported fields
}
SlideIn creates a slide-in animation component
func NewSlideIn ¶
func NewSlideIn(child vdom.Component, engine *AnimationEngine) *SlideIn
NewSlideIn creates a slide-in animated component
func (*SlideIn) SetDirection ¶
SetDirection sets the slide direction
func (*SlideIn) SetDistance ¶
SetDistance sets the slide distance
func (*SlideIn) SetDuration ¶
SetDuration sets the animation duration
func (*SlideIn) SetEasing ¶
func (s *SlideIn) SetEasing(easing EasingFunc) *SlideIn
SetEasing sets the easing function
type Spring ¶
type Spring struct {
Position float64
Velocity float64
Target float64
Stiffness float64
Damping float64
Mass float64
RestDistance float64
}
Spring physics for natural animations
type Stagger ¶
type Stagger struct {
// contains filtered or unexported fields
}
Stagger creates staggered animations for multiple components
func NewStagger ¶
func NewStagger(engine *AnimationEngine) *Stagger
NewStagger creates a new stagger animation
func (*Stagger) SetAnimation ¶
func (s *Stagger) SetAnimation(animation func(vdom.Component, *AnimationEngine) vdom.Component) *Stagger
SetAnimation sets the animation function to apply to each child
type TextMorphEffect ¶
type TextMorphEffect struct {
// contains filtered or unexported fields
}
TextMorphEffect creates a text morphing animation
func NewTextMorphEffect ¶
func NewTextMorphEffect(engine *AnimationEngine) *TextMorphEffect
NewTextMorphEffect creates a new text morph effect
func (*TextMorphEffect) MorphTextToShape ¶
func (tme *TextMorphEffect) MorphTextToShape(textElement js.Value, targetShape string, config ParticleConfig)
MorphTextToShape morphs text characters into a shape with particles
type Timeline ¶
type Timeline struct {
// contains filtered or unexported fields
}
Timeline manages complex animation sequences
func Bounce ¶
func Bounce(engine *AnimationEngine, element js.Value, height float64, duration time.Duration) *Timeline
Bounce creates a bouncing animation
func NewTimeline ¶
func NewTimeline(engine *AnimationEngine) *Timeline
NewTimeline creates a new animation timeline
func Parallel ¶
func Parallel(engine *AnimationEngine, animations ...*Animation) *Timeline
Parallel creates a timeline with all animations running simultaneously
func Sequence ¶
func Sequence(engine *AnimationEngine, animations ...*Animation) *Timeline
Sequence creates a timeline with animations running one after another
func Shake ¶
func Shake(engine *AnimationEngine, element js.Value, intensity float64, duration time.Duration) *Timeline
Shake creates a shake animation
func StaggerTimeline ¶
func StaggerTimeline(engine *AnimationEngine, staggerDelay time.Duration, animations ...*Animation) *Timeline
StaggerTimeline creates a timeline with animations starting at staggered intervals
func TypeWriter ¶
func TypeWriter(engine *AnimationEngine, element js.Value, text string, charDelay time.Duration) *Timeline
TypeWriter creates a typewriter text animation
func Wiggle ¶
func Wiggle(engine *AnimationEngine, element js.Value, angle float64, duration time.Duration) *Timeline
Wiggle creates a wiggling rotation animation
func (*Timeline) AddAnimation ¶
AddAnimation adds an animation to the timeline at a specific time
func (*Timeline) AddAnimationAfter ¶
AddAnimationAfter adds an animation after the previous one completes
func (*Timeline) AddAnimationWith ¶
AddAnimationWith adds an animation to run simultaneously with the last added animation
func (*Timeline) GetDuration ¶
GetDuration returns the total timeline duration
func (*Timeline) GetPlayhead ¶
GetPlayhead returns the current playhead position
func (*Timeline) GetProgress ¶
GetProgress returns the current timeline progress (0.0 to 1.0)
func (*Timeline) IsComplete ¶
IsComplete returns true if the timeline has completed
func (*Timeline) OnComplete ¶
OnComplete sets a callback for when the timeline completes
type TimelineAnimation ¶
TimelineAnimation represents an animation within a timeline
type TimelineBuilder ¶
type TimelineBuilder struct {
// contains filtered or unexported fields
}
TimelineBuilder provides a fluent interface for building complex timelines
func NewTimelineBuilder ¶
func NewTimelineBuilder(engine *AnimationEngine) *TimelineBuilder
NewTimelineBuilder creates a new timeline builder
func (*TimelineBuilder) At ¶
func (tb *TimelineBuilder) At(time time.Duration, anim *Animation) *TimelineBuilder
At adds an animation at a specific time
func (*TimelineBuilder) Build ¶
func (tb *TimelineBuilder) Build() *Timeline
Build returns the constructed timeline
func (*TimelineBuilder) Loop ¶
func (tb *TimelineBuilder) Loop() *TimelineBuilder
Loop enables looping
func (*TimelineBuilder) Then ¶
func (tb *TimelineBuilder) Then(anim *Animation) *TimelineBuilder
Then adds an animation after the previous one
func (*TimelineBuilder) With ¶
func (tb *TimelineBuilder) With(anim *Animation) *TimelineBuilder
With adds an animation alongside the previous one