1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//! eazy-keyframes — Keyframe-based animation system.
//!
//! Provides keyframe tracks for defining complex animations with
//! values at specific time points and per-segment easing.
//!
//! # Examples
//!
//! ## Using the builder API
//!
//! ```rust
//! use eazy_keyframes::{KeyframeTrack, Keyframe};
//! use eazy_core::Easing;
//!
//! let track = KeyframeTrack::new()
//! .keyframe(0.0, [0.0_f32, 0.0, 0.0])
//! .keyframe_eased(0.5, [100.0, 50.0, 0.0], Easing::OutElastic)
//! .keyframe(1.0, [0.0, 100.0, 0.0]);
//!
//! // Sample at 75% through the animation
//! let position = track.sample(0.75);
//! ```
//!
//! ## Using the keyframes! macro
//!
//! ```rust
//! use eazy_keyframes::{keyframes, Easing};
//!
//! let track = keyframes![
//! (0.0, 0.0_f32), // (time, value) - linear
//! (0.5, 100.0, Easing::OutBounce), // (time, value, easing)
//! (1.0, 50.0)
//! ];
//!
//! let value = track.sample(0.75);
//! ```
// Re-export main types.
pub use Keyframe;
pub use keyframe;
pub use keyframe_eased;
pub use KeyframeTrack;
// Re-export dependencies for convenience.
pub use Easing;
pub use Tweenable;
/// Create a [`KeyframeTrack`] from a list of keyframe tuples.
///
/// Supports two tuple formats:
/// - `(time, value)` — keyframe with linear easing
/// - `(time, value, easing)` — keyframe with custom easing
///
/// # Examples
///
/// ```rust
/// use eazy_keyframes::{keyframes, Easing};
///
/// // Simple f32 animation
/// let track = keyframes![
/// (0.0, 0.0_f32),
/// (0.5, 100.0, Easing::OutBounce),
/// (1.0, 50.0)
/// ];
///
/// // Array animation (e.g., position)
/// let track = keyframes![
/// (0.0, [0.0_f32, 0.0]),
/// (0.5, [100.0, 50.0], Easing::OutElastic),
/// (1.0, [0.0, 100.0])
/// ];
/// ```