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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
//! Port of material_ui's `generated/motion_defaults_m3e.g.dart`: a Dart `part` of `motion.dart`, so its items are public through `motion.rs`.
//!
//! Generated from the Material token database upstream; port changes to the Dart generator's output by hand.
use waft_physics::SpringDescription;
/// The set of springs in the Material specification.
///
/// Material 3 Expressive motion uses springs, grouped into two motion schemes.
/// The standard scheme eases into place with minimal bounce, and suits more
/// utilitarian products. The expressive scheme overshoots and bounces into
/// place, and suits hero moments and key interactions.
///
/// Each scheme has springs for two types of motion, in three speeds: default,
/// fast, and slow.
///
/// * Spatial springs animate movement, such as position, size, rotation, and
/// corner radius.
/// * Effects springs animate properties that shouldn't overshoot, such as
/// color and opacity.
///
/// Most motion should use the default speed. Smaller elements can use the fast
/// speed, and larger elements can use the slow speed.
///
/// Material spring tokens define a stiffness and a damping ratio, but no
/// mass. The Material token named `damping` is the damping ratio (ΞΆ), not
/// `SpringDescription.damping`. Each constant is the same as
/// `SpringDescription.withDampingRatio` with a mass of 1.0 and the token's
/// stiffness and damping ratio, so its damping is
/// `ratio * 2.0 * sqrt(stiffness)`. For example, `STANDARD_DEFAULT_SPATIAL` has
/// a damping of `0.9 * 2.0 * sqrt(700.0)`, about 47.62.
///
/// Use them with a `SpringSimulation`, for example through
/// `AnimationController.animateWith`.
///
/// See also:
///
/// * `Durations` and `Easing`, which are the Material tokens for curve-based
/// animations.
/// * [M3 guidelines: Motion physics system](https://m3.material.io/styles/motion/overview/how-it-works)
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub enum Springs {}
impl Springs {
/// The standard default spatial spring in the Material specification.
///
/// It has a stiffness of 700.0 and a damping ratio of 0.9.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const STANDARD_DEFAULT_SPATIAL: SpringDescription =
SpringDescription::new(1.0, 700.0, 47.62352359916263);
/// The standard fast spatial spring in the Material specification.
///
/// It has a stiffness of 1400.0 and a damping ratio of 0.9.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const STANDARD_FAST_SPATIAL: SpringDescription =
SpringDescription::new(1.0, 1400.0, 67.34983296193096);
/// The standard slow spatial spring in the Material specification.
///
/// It has a stiffness of 300.0 and a damping ratio of 0.9.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const STANDARD_SLOW_SPATIAL: SpringDescription =
SpringDescription::new(1.0, 300.0, 31.176914536239796);
/// The standard default effects spring in the Material specification.
///
/// It has a stiffness of 1600.0 and a damping ratio of 1.0.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const STANDARD_DEFAULT_EFFECTS: SpringDescription =
SpringDescription::new(1.0, 1600.0, 80.0);
/// The standard fast effects spring in the Material specification.
///
/// It has a stiffness of 3800.0 and a damping ratio of 1.0.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const STANDARD_FAST_EFFECTS: SpringDescription =
SpringDescription::new(1.0, 3800.0, 123.28828005937953);
/// The standard slow effects spring in the Material specification.
///
/// It has a stiffness of 800.0 and a damping ratio of 1.0.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const STANDARD_SLOW_EFFECTS: SpringDescription =
SpringDescription::new(1.0, 800.0, 56.568542494923804);
/// The expressive default spatial spring in the Material specification.
///
/// It has a stiffness of 380.0 and a damping ratio of 0.8.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const EXPRESSIVE_DEFAULT_SPATIAL: SpringDescription =
SpringDescription::new(1.0, 380.0, 31.189741903388683);
/// The expressive fast spatial spring in the Material specification.
///
/// It has a stiffness of 800.0 and a damping ratio of 0.6.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const EXPRESSIVE_FAST_SPATIAL: SpringDescription =
SpringDescription::new(1.0, 800.0, 33.94112549695428);
/// The expressive slow spatial spring in the Material specification.
///
/// It has a stiffness of 200.0 and a damping ratio of 0.8.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const EXPRESSIVE_SLOW_SPATIAL: SpringDescription =
SpringDescription::new(1.0, 200.0, 22.627416997969522);
/// The expressive default effects spring in the Material specification.
///
/// It has a stiffness of 1600.0 and a damping ratio of 1.0.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const EXPRESSIVE_DEFAULT_EFFECTS: SpringDescription =
SpringDescription::new(1.0, 1600.0, 80.0);
/// The expressive fast effects spring in the Material specification.
///
/// It has a stiffness of 3800.0 and a damping ratio of 1.0.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const EXPRESSIVE_FAST_EFFECTS: SpringDescription =
SpringDescription::new(1.0, 3800.0, 123.28828005937953);
/// The expressive slow effects spring in the Material specification.
///
/// It has a stiffness of 800.0 and a damping ratio of 1.0.
///
/// See also:
///
/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs)
pub const EXPRESSIVE_SLOW_EFFECTS: SpringDescription =
SpringDescription::new(1.0, 800.0, 56.568542494923804);
}