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
//! A library for easily creating animations in Iced. Animations are designed around spring physics
//! to make animations feel natural and interactive.
//!
//! # Overview
//!
//! The primary widgets are `Animation` and `AnimationBuilder`, which are widgets that help you
//! animates a value when it changes. The `Animation` widget allows you to store the animated value
//! in your app state, while the `AnimationBuilder` widget maintains the animated value so your app
//! state is always up-to-date with the latest value. Refer to those widget modules for documentation
//! and the `examples` directory for examples on how to use them.
//!
//! ## Animated widgets
//!
//! A subset of the standard `iced` widgets are exported under a `widgets` feature
//! flag. You can use these as drop-in replacements for the existing widgets:
//!
//! ```rust
//! # #[derive(Clone)] enum Message { DoSomething }
//! # type Element<'a, Message> = iced_core::Element<'a, Message, iced_core::Theme, iced_widget::Renderer>;
//! use iced_anim::widget::button;
//!
//! fn fancy_button<'a>() -> Element<'a, Message> {
//! button("Animated button")
//! .on_press(Message::DoSomething)
//! .into()
//! }
//! ```
//!
//! ## Animating types
//!
//! You can animate anything that implements [`Animate`]. A handful of common types already
//! implement [`Animate`] like [`f32`], `Color` and `Theme`, with more to come
//! in the future. You can also derive [`Animate`] on your own types to animate them as well
//! by enabling the `derive` feature flag and adding `#[derive(Animate)]` to your type:
//!
//! ```rust
//! # use iced_core::Color;
//! use iced_anim::Animate;
//!
//! // Note that animate also requires `Clone` and `PartialEq` impls.
//! #[derive(Animate, Clone, PartialEq)]
//! struct MyType {
//! size: f32,
//! color: Color,
//! }
//! ```
//!
//! ## Controlling the spring motion
//!
//! The spring motion of an [`AnimationBuilder`] can be customized. There are some presets like
//! [`spring::Motion::smooth`] and [`spring::Motion::bouncy`], but you can also create your own.
//!
//! ## Supported Iced versions
//!
//! This crate supports Iced 0.14 and newer.
pub use Animate;
pub use ;
pub use AnimatedState;
pub use Animation;
pub use *;
pub use Event;
pub use ;
pub use ;
pub use Animate;