Skip to main content

animato_timeline/
lib.rs

1//! # animato-timeline
2//!
3//! Timeline composition for Animato animations.
4//!
5//! This crate provides [`Timeline`] for concurrent composition, [`Sequence`] for
6//! chained animation steps, and [`stagger()`] for offsetting many animations by a
7//! fixed delay.
8//!
9//! ## Quick Start
10//!
11//! ```rust
12//! use animato_core::{Easing, Update};
13//! use animato_timeline::{At, Timeline};
14//! use animato_tween::Tween;
15//!
16//! let fade = Tween::new(0.0_f32, 1.0)
17//!     .duration(1.0)
18//!     .easing(Easing::EaseOutCubic)
19//!     .build();
20//!
21//! let slide = Tween::new(0.0_f32, 100.0).duration(0.5).build();
22//!
23//! let mut timeline = Timeline::new()
24//!     .add("fade", fade, At::Start)
25//!     .add("slide", slide, At::Offset(0.25));
26//!
27//! timeline.play();
28//! timeline.update(0.5);
29//! assert!(timeline.progress() > 0.0);
30//! ```
31//!
32//! ## Feature Flags
33//!
34//! | Feature | Effect |
35//! |---------|--------|
36//! | `std`   | Enables std-dependent features in core and tween, plus callbacks |
37//! | `serde` | Derives `Serialize`/`Deserialize` on supported public enums |
38//! | `tokio` | Enables [`Timeline::wait()`] completion futures |
39
40#![cfg_attr(not(feature = "std"), no_std)]
41#![deny(missing_docs)]
42#![deny(missing_debug_implementations)]
43
44extern crate alloc;
45
46pub mod group;
47pub mod sequence;
48pub mod stagger;
49pub mod timeline;
50
51pub use group::AnimationGroup;
52pub use sequence::Sequence;
53pub use stagger::stagger;
54pub use timeline::{At, Timeline, TimelineState};