blinc_animation
Part of the Blinc UI Framework
This crate is a component of Blinc, a GPU-accelerated UI framework for Rust. For full documentation and guides, visit the Blinc documentation.
Animation system for Blinc UI - spring physics, keyframes, and timeline orchestration.
Overview
blinc_animation provides a powerful animation system with spring physics, keyframe animations, and timeline orchestration. All animations are interruptible and preserve velocity when interrupted.
Features
- Spring Physics: RK4-integrated springs with configurable stiffness, damping, and mass
- Keyframe Animations: Timed sequences with easing functions
- Timelines: Orchestrate multiple animations with offsets
- Interruptible: Animations inherit velocity when interrupted
- Presets: Common entry/exit animation patterns
Spring Animations
use ;
// Create a spring
let spring = new;
// Animate to target
spring.animate_to;
// Update each frame
let value = spring.update;
Spring Presets
gentle // Slow, gentle movement
default // Balanced default
bouncy // Playful bounce
stiff // Quick, snappy
Keyframe Animations
use ;
let animation = new
.keyframe
.keyframe
.keyframe
.duration;
// Update each frame
let value = animation.update;
Easing Functions
Linear
EaseIn
EaseOut
EaseInOut
CubicBezier
Timelines
use ;
let timeline = new
.add
.add
.add;
// Play/pause/seek
timeline.play;
timeline.pause;
timeline.seek;
Animation Scheduler
use AnimationScheduler;
// Global scheduler manages all active animations
let scheduler = global;
// Schedule an animation
scheduler.schedule;
// Update all animations
scheduler.update;
Multi-Property Animation
use AnimatedValue;
Presets
use presets;
// Entry animations
fade_in
slide_in_left
slide_in_right
scale_in
bounce_in
// Exit animations
fade_out
slide_out_left
slide_out_right
scale_out
License
MIT OR Apache-2.0