figma_api/models/easing_type.rs
1/*
2 * Figma API
3 *
4 * This is the OpenAPI specification for the [Figma REST API](https://www.figma.com/developers/api). Note: we are releasing the OpenAPI specification as a beta given the large surface area and complexity of the REST API. If you notice any inaccuracies with the specification, please [file an issue](https://github.com/figma/rest-api-spec/issues).
5 *
6 * The version of the OpenAPI document: 0.31.0
7 * Contact: support@figma.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// EasingType : This type is a string enum with the following possible values: - `EASE_IN`: Ease in with an animation curve similar to CSS ease-in. - `EASE_OUT`: Ease out with an animation curve similar to CSS ease-out. - `EASE_IN_AND_OUT`: Ease in and then out with an animation curve similar to CSS ease-in-out. - `LINEAR`: No easing, similar to CSS linear. - `EASE_IN_BACK`: Ease in with an animation curve that moves past the initial keyframe's value and then accelerates as it reaches the end. - `EASE_OUT_BACK`: Ease out with an animation curve that starts fast, then slows and goes past the ending keyframe's value. - `EASE_IN_AND_OUT_BACK`: Ease in and then out with an animation curve that overshoots the initial keyframe's value, then accelerates quickly before it slows and overshoots the ending keyframes value. - `CUSTOM_CUBIC_BEZIER`: User-defined cubic bezier curve. - `GENTLE`: Gentle animation similar to react-spring. - `QUICK`: Quick spring animation, great for toasts and notifications. - `BOUNCY`: Bouncy spring, for delightful animations like a heart bounce. - `SLOW`: Slow spring, useful as a steady, natural way to scale up fullscreen content. - `CUSTOM_SPRING`: User-defined spring animation.
15/// This type is a string enum with the following possible values: - `EASE_IN`: Ease in with an animation curve similar to CSS ease-in. - `EASE_OUT`: Ease out with an animation curve similar to CSS ease-out. - `EASE_IN_AND_OUT`: Ease in and then out with an animation curve similar to CSS ease-in-out. - `LINEAR`: No easing, similar to CSS linear. - `EASE_IN_BACK`: Ease in with an animation curve that moves past the initial keyframe's value and then accelerates as it reaches the end. - `EASE_OUT_BACK`: Ease out with an animation curve that starts fast, then slows and goes past the ending keyframe's value. - `EASE_IN_AND_OUT_BACK`: Ease in and then out with an animation curve that overshoots the initial keyframe's value, then accelerates quickly before it slows and overshoots the ending keyframes value. - `CUSTOM_CUBIC_BEZIER`: User-defined cubic bezier curve. - `GENTLE`: Gentle animation similar to react-spring. - `QUICK`: Quick spring animation, great for toasts and notifications. - `BOUNCY`: Bouncy spring, for delightful animations like a heart bounce. - `SLOW`: Slow spring, useful as a steady, natural way to scale up fullscreen content. - `CUSTOM_SPRING`: User-defined spring animation.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum EasingType {
18 #[serde(rename = "EASE_IN")]
19 EaseIn,
20 #[serde(rename = "EASE_OUT")]
21 EaseOut,
22 #[serde(rename = "EASE_IN_AND_OUT")]
23 EaseInAndOut,
24 #[serde(rename = "LINEAR")]
25 Linear,
26 #[serde(rename = "EASE_IN_BACK")]
27 EaseInBack,
28 #[serde(rename = "EASE_OUT_BACK")]
29 EaseOutBack,
30 #[serde(rename = "EASE_IN_AND_OUT_BACK")]
31 EaseInAndOutBack,
32 #[serde(rename = "CUSTOM_CUBIC_BEZIER")]
33 CustomCubicBezier,
34 #[serde(rename = "GENTLE")]
35 Gentle,
36 #[serde(rename = "QUICK")]
37 Quick,
38 #[serde(rename = "BOUNCY")]
39 Bouncy,
40 #[serde(rename = "SLOW")]
41 Slow,
42 #[serde(rename = "CUSTOM_SPRING")]
43 CustomSpring,
44
45}
46
47impl std::fmt::Display for EasingType {
48 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
49 match self {
50 Self::EaseIn => write!(f, "EASE_IN"),
51 Self::EaseOut => write!(f, "EASE_OUT"),
52 Self::EaseInAndOut => write!(f, "EASE_IN_AND_OUT"),
53 Self::Linear => write!(f, "LINEAR"),
54 Self::EaseInBack => write!(f, "EASE_IN_BACK"),
55 Self::EaseOutBack => write!(f, "EASE_OUT_BACK"),
56 Self::EaseInAndOutBack => write!(f, "EASE_IN_AND_OUT_BACK"),
57 Self::CustomCubicBezier => write!(f, "CUSTOM_CUBIC_BEZIER"),
58 Self::Gentle => write!(f, "GENTLE"),
59 Self::Quick => write!(f, "QUICK"),
60 Self::Bouncy => write!(f, "BOUNCY"),
61 Self::Slow => write!(f, "SLOW"),
62 Self::CustomSpring => write!(f, "CUSTOM_SPRING"),
63 }
64 }
65}
66
67impl Default for EasingType {
68 fn default() -> EasingType {
69 Self::EaseIn
70 }
71}
72