animato_driver/lib.rs
1//! # animato-driver
2//!
3//! Runtime management for Animato animations.
4//!
5//! - [`AnimationDriver`] — owns and ticks many animations; auto-removes completed ones.
6//! - [`Clock`] — trait abstracting time sources.
7//! - [`WallClock`] — real wall-clock time via `std::time::Instant`.
8//! - [`ManualClock`] — caller-driven time.
9//! - [`MockClock`] — fixed-step clock for tests.
10//! - [`scroll::ScrollDriver`] — animations driven by scroll position (v0.8.0).
11//! - [`scroll::ScrollClock`] — scroll-backed [`Clock`] implementation (v0.8.0).
12//!
13//! ## Quick Start
14//!
15//! ```rust
16//! use animato_driver::{AnimationDriver, MockClock, Clock};
17//! use animato_tween::Tween;
18//! use animato_core::{Easing, Update};
19//!
20//! let mut driver = AnimationDriver::new();
21//! let id = driver.add(
22//! Tween::new(0.0_f32, 100.0)
23//! .duration(1.0)
24//! .easing(Easing::EaseOutCubic)
25//! .build()
26//! );
27//!
28//! let mut clock = MockClock::new(1.0 / 60.0);
29//! for _ in 0..61 {
30//! driver.tick(clock.delta());
31//! }
32//! assert!(!driver.is_active(id));
33//! ```
34
35#![deny(missing_docs)]
36#![deny(missing_debug_implementations)]
37
38pub mod clock;
39pub mod driver;
40pub mod scroll;
41
42pub use clock::{Clock, ManualClock, MockClock, WallClock};
43pub use driver::{AnimationDriver, AnimationId};
44pub use scroll::{ScrollClock, ScrollDriver};