pub struct AnimatedStyle {Show 15 fields
pub opacity: Option<f32>,
pub transform: Option<String>,
pub scale: Option<f32>,
pub translate_x: Option<f32>,
pub translate_y: Option<f32>,
pub rotate: Option<f32>,
pub skew_x: Option<f32>,
pub skew_y: Option<f32>,
pub blur: Option<f32>,
pub background_color: Option<[f32; 4]>,
pub border_radius: Option<f32>,
pub width: Option<f32>,
pub height: Option<f32>,
pub clip_path: Option<String>,
pub custom: Vec<(String, String)>,
}Expand description
CSS property bag used by Animato Dioxus helpers.
Fields§
§opacity: Option<f32>CSS opacity.
transform: Option<String>Raw CSS transform string appended after generated transform parts.
scale: Option<f32>Uniform CSS scale.
translate_x: Option<f32>Translation on the x axis in CSS pixels.
translate_y: Option<f32>Translation on the y axis in CSS pixels.
rotate: Option<f32>Rotation in degrees.
skew_x: Option<f32>Skew on the x axis in degrees.
skew_y: Option<f32>Skew on the y axis in degrees.
blur: Option<f32>CSS blur radius in pixels.
background_color: Option<[f32; 4]>RGBA background color with components in [0.0, 1.0].
border_radius: Option<f32>CSS border radius in pixels.
width: Option<f32>CSS width in pixels.
height: Option<f32>CSS height in pixels.
clip_path: Option<String>Raw CSS clip-path value.
custom: Vec<(String, String)>Additional raw CSS property/value pairs.
Implementations§
Source§impl AnimatedStyle
impl AnimatedStyle
Sourcepub fn background_color(self, rgba: [f32; 4]) -> Self
pub fn background_color(self, rgba: [f32; 4]) -> Self
Set background color from RGBA components in [0.0, 1.0].
Sourcepub fn border_radius(self, px: f32) -> Self
pub fn border_radius(self, px: f32) -> Self
Set border radius in CSS pixels.
Sourcepub fn custom(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn custom(self, name: impl Into<String>, value: impl Into<String>) -> Self
Add a custom raw CSS property.
Sourcepub fn interpolate(&self, other: &Self, t: f32) -> Self
pub fn interpolate(&self, other: &Self, t: f32) -> Self
Interpolate two style bags.
Sourcepub fn transform_string(&self) -> String
pub fn transform_string(&self) -> String
Return only the generated CSS transform string.
Trait Implementations§
Source§impl Clone for AnimatedStyle
impl Clone for AnimatedStyle
Source§fn clone(&self) -> AnimatedStyle
fn clone(&self) -> AnimatedStyle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnimatedStyle
impl Debug for AnimatedStyle
Source§impl Default for AnimatedStyle
impl Default for AnimatedStyle
Source§fn default() -> AnimatedStyle
fn default() -> AnimatedStyle
Returns the “default value” for a type. Read more
Source§impl PartialEq for AnimatedStyle
impl PartialEq for AnimatedStyle
Source§fn eq(&self, other: &AnimatedStyle) -> bool
fn eq(&self, other: &AnimatedStyle) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AnimatedStyle
Auto Trait Implementations§
impl Freeze for AnimatedStyle
impl RefUnwindSafe for AnimatedStyle
impl Send for AnimatedStyle
impl Sync for AnimatedStyle
impl Unpin for AnimatedStyle
impl UnsafeUnpin for AnimatedStyle
impl UnwindSafe for AnimatedStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.