Skip to main content

KeyframeProperties

Struct KeyframeProperties 

Source
pub struct KeyframeProperties {
Show 73 fields pub opacity: Option<f32>, pub scale_x: Option<f32>, pub scale_y: Option<f32>, pub translate_x: Option<f32>, pub translate_y: Option<f32>, pub rotate: Option<f32>, pub rotate_x: Option<f32>, pub rotate_y: Option<f32>, pub perspective: Option<f32>, pub depth: Option<f32>, pub translate_z: Option<f32>, pub blend_3d: Option<f32>, pub clip_inset: Option<[f32; 4]>, pub background_color: Option<[f32; 4]>, pub gradient_start_color: Option<[f32; 4]>, pub gradient_end_color: Option<[f32; 4]>, pub gradient_angle: Option<f32>, pub border_color: Option<[f32; 4]>, pub text_color: Option<[f32; 4]>, pub corner_radius: Option<[f32; 4]>, pub corner_shape: Option<[f32; 4]>, pub border_width: Option<f32>, pub outline_width: Option<f32>, pub outline_color: Option<[f32; 4]>, pub outline_offset: Option<f32>, pub clip_circle_radius: Option<f32>, pub clip_ellipse_radii: Option<[f32; 2]>, pub overflow_fade: Option<[f32; 4]>, pub shadow_params: Option<[f32; 4]>, pub shadow_color: Option<[f32; 4]>, pub text_shadow_params: Option<[f32; 4]>, pub text_shadow_color: Option<[f32; 4]>, pub light_intensity: Option<f32>, pub ambient: Option<f32>, pub specular: Option<f32>, pub light_direction: Option<[f32; 3]>, pub filter_grayscale: Option<f32>, pub filter_invert: Option<f32>, pub filter_sepia: Option<f32>, pub filter_brightness: Option<f32>, pub filter_contrast: Option<f32>, pub filter_saturate: Option<f32>, pub filter_hue_rotate: Option<f32>, pub filter_blur: Option<f32>, pub backdrop_blur: Option<f32>, pub backdrop_saturation: Option<f32>, pub backdrop_brightness: Option<f32>, pub width: Option<f32>, pub height: Option<f32>, pub min_width: Option<f32>, pub max_width: Option<f32>, pub min_height: Option<f32>, pub max_height: Option<f32>, pub padding: Option<[f32; 4]>, pub margin: Option<[f32; 4]>, pub gap: Option<f32>, pub flex_grow: Option<f32>, pub flex_shrink: Option<f32>, pub inset_top: Option<f32>, pub inset_right: Option<f32>, pub inset_bottom: Option<f32>, pub inset_left: Option<f32>, pub font_size: Option<f32>, pub skew_x: Option<f32>, pub skew_y: Option<f32>, pub transform_origin: Option<[f32; 2]>, pub z_index: Option<f32>, pub mask_gradient: Option<[f32; 8]>, pub svg_fill: Option<[f32; 4]>, pub svg_stroke: Option<[f32; 4]>, pub svg_stroke_width: Option<f32>, pub svg_stroke_dashoffset: Option<f32>, pub svg_path_data: Option<String>,
}
Expand description

Properties that can be animated in a multi-property keyframe

Fields§

§opacity: Option<f32>

Opacity (0.0 to 1.0)

§scale_x: Option<f32>

Scale X factor

§scale_y: Option<f32>

Scale Y factor

§translate_x: Option<f32>

Translation X in pixels

§translate_y: Option<f32>

Translation Y in pixels

§rotate: Option<f32>

Rotation in degrees (Z-axis)

§rotate_x: Option<f32>

Rotation X in degrees (3D tilt)

§rotate_y: Option<f32>

Rotation Y in degrees (3D turn)

§perspective: Option<f32>

Perspective distance in pixels

§depth: Option<f32>

3D extrusion depth in pixels

§translate_z: Option<f32>

Z-axis translation in pixels (positive = toward viewer)

§blend_3d: Option<f32>

Blend radius for smooth boolean operations (in pixels)

§clip_inset: Option<[f32; 4]>

Clip-path inset [top%, right%, bottom%, left%]

§background_color: Option<[f32; 4]>

Background color RGBA (solid brush)

§gradient_start_color: Option<[f32; 4]>

Gradient start color RGBA (first stop)

§gradient_end_color: Option<[f32; 4]>

Gradient end color RGBA (last stop)

§gradient_angle: Option<f32>

Gradient angle in degrees (linear gradients)

§border_color: Option<[f32; 4]>

Border color RGBA

§text_color: Option<[f32; 4]>

Text foreground color RGBA

§corner_radius: Option<[f32; 4]>

Corner radius [top_left, top_right, bottom_right, bottom_left]

§corner_shape: Option<[f32; 4]>

Corner shape (superellipse n parameter) [top_left, top_right, bottom_right, bottom_left]

§border_width: Option<f32>

Border width in pixels

§outline_width: Option<f32>

Outline width in pixels

§outline_color: Option<[f32; 4]>

Outline color RGBA

§outline_offset: Option<f32>

Outline offset in pixels

§clip_circle_radius: Option<f32>

Clip-path circle radius (percent)

§clip_ellipse_radii: Option<[f32; 2]>

Clip-path ellipse radii [rx, ry] (percent)

§overflow_fade: Option<[f32; 4]>

Overflow fade distances [top, right, bottom, left]

§shadow_params: Option<[f32; 4]>

Shadow [offset_x, offset_y, blur, spread]

§shadow_color: Option<[f32; 4]>

Shadow color RGBA

§text_shadow_params: Option<[f32; 4]>

Text shadow [offset_x, offset_y, blur, spread]

§text_shadow_color: Option<[f32; 4]>

Text shadow color RGBA

§light_intensity: Option<f32>

Light intensity (0.0-1.0+)

§ambient: Option<f32>

Ambient light level (0.0-1.0)

§specular: Option<f32>

Specular power (higher = sharper highlights)

§light_direction: Option<[f32; 3]>

Light direction [x, y, z]

§filter_grayscale: Option<f32>

filter: grayscale(0..1)

§filter_invert: Option<f32>

filter: invert(0..1)

§filter_sepia: Option<f32>

filter: sepia(0..1)

§filter_brightness: Option<f32>

filter: brightness(multiplier, 1.0 = normal)

§filter_contrast: Option<f32>

filter: contrast(multiplier, 1.0 = normal)

§filter_saturate: Option<f32>

filter: saturate(multiplier, 1.0 = normal)

§filter_hue_rotate: Option<f32>

filter: hue-rotate(degrees)

§filter_blur: Option<f32>

filter: blur(px)

§backdrop_blur: Option<f32>

backdrop-filter: blur(px)

§backdrop_saturation: Option<f32>

backdrop-filter saturation multiplier (1.0 = normal)

§backdrop_brightness: Option<f32>

backdrop-filter brightness multiplier (1.0 = normal)

§width: Option<f32>

Width in pixels

§height: Option<f32>

Height in pixels

§min_width: Option<f32>

Min-width in pixels

§max_width: Option<f32>

Max-width in pixels

§min_height: Option<f32>

Min-height in pixels

§max_height: Option<f32>

Max-height in pixels

§padding: Option<[f32; 4]>

Padding [top, right, bottom, left] in pixels

§margin: Option<[f32; 4]>

Margin [top, right, bottom, left] in pixels

§gap: Option<f32>

Gap between flex items in pixels

§flex_grow: Option<f32>

Flex grow factor

§flex_shrink: Option<f32>

Flex shrink factor

§inset_top: Option<f32>

top inset in pixels

§inset_right: Option<f32>

right inset in pixels

§inset_bottom: Option<f32>

bottom inset in pixels

§inset_left: Option<f32>

left inset in pixels

§font_size: Option<f32>

Font size in pixels

§skew_x: Option<f32>

Skew X in degrees

§skew_y: Option<f32>

Skew Y in degrees

§transform_origin: Option<[f32; 2]>

Transform origin [x%, y%] (default 50%, 50% = center)

§z_index: Option<f32>

z-index (f32 for smooth interpolation, rounded on apply)

§mask_gradient: Option<[f32; 8]>

Combined mask gradient: [mask_type, start_alpha, end_alpha, 0, p0, p1, p2, p3] where p0..p3 = linear(x1,y1,x2,y2) or radial(cx,cy,r,0) in OBB space

§svg_fill: Option<[f32; 4]>

SVG fill color RGBA

§svg_stroke: Option<[f32; 4]>

SVG stroke color RGBA

§svg_stroke_width: Option<f32>

SVG stroke width in pixels

§svg_stroke_dashoffset: Option<f32>

SVG stroke-dashoffset in pixels (for line-drawing animations)

§svg_path_data: Option<String>

SVG path d attribute data (for path morphing animations)

Implementations§

Source§

impl KeyframeProperties

Source

pub fn opacity(value: f32) -> KeyframeProperties

Create properties with only opacity set

Source

pub fn scale(value: f32) -> KeyframeProperties

Create properties with uniform scale

Source

pub fn translate(x: f32, y: f32) -> KeyframeProperties

Create properties with translation

Source

pub fn rotation(degrees: f32) -> KeyframeProperties

Create properties with rotation

Source

pub fn with_opacity(self, value: f32) -> KeyframeProperties

Builder: set opacity

Source

pub fn with_scale(self, value: f32) -> KeyframeProperties

Builder: set uniform scale

Source

pub fn with_scale_xy(self, x: f32, y: f32) -> KeyframeProperties

Builder: set scale x and y separately

Source

pub fn with_translate(self, x: f32, y: f32) -> KeyframeProperties

Builder: set translation

Source

pub fn with_rotate(self, degrees: f32) -> KeyframeProperties

Builder: set rotation

Source

pub fn with_rotate_x(self, degrees: f32) -> KeyframeProperties

Builder: set X rotation (3D tilt)

Source

pub fn with_rotate_y(self, degrees: f32) -> KeyframeProperties

Builder: set Y rotation (3D turn)

Source

pub fn with_perspective(self, px: f32) -> KeyframeProperties

Builder: set perspective distance

Source

pub fn with_depth(self, px: f32) -> KeyframeProperties

Builder: set 3D depth

Source

pub fn with_translate_z(self, px: f32) -> KeyframeProperties

Builder: set translate-z

Source

pub fn with_blend_3d(self, px: f32) -> KeyframeProperties

Builder: set 3D blend radius

Source

pub fn lerp(&self, other: &KeyframeProperties, t: f32) -> KeyframeProperties

Interpolate between two property sets

Source

pub fn resolved_opacity(&self) -> f32

Get the resolved opacity (defaults to 1.0 if not set)

Source

pub fn resolved_scale(&self) -> (f32, f32)

Get the resolved scale (defaults to 1.0 if not set)

Source

pub fn resolved_translate(&self) -> (f32, f32)

Get the resolved translation (defaults to 0.0 if not set)

Source

pub fn resolved_rotate(&self) -> f32

Get the resolved rotation (defaults to 0.0 if not set)

Source

pub fn resolved_rotate_x(&self) -> f32

Get the resolved X rotation in degrees (defaults to 0.0)

Source

pub fn resolved_rotate_y(&self) -> f32

Get the resolved Y rotation in degrees (defaults to 0.0)

Source

pub fn resolved_perspective(&self) -> f32

Get the resolved perspective distance (defaults to 0.0 = no perspective)

Source

pub fn resolved_depth(&self) -> f32

Get the resolved 3D depth (defaults to 0.0 = flat)

Trait Implementations§

Source§

impl Clone for KeyframeProperties

Source§

fn clone(&self) -> KeyframeProperties

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KeyframeProperties

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for KeyframeProperties

Source§

fn default() -> KeyframeProperties

Returns the “default value” for a type. Read more
Source§

impl PartialEq for KeyframeProperties

Source§

fn eq(&self, other: &KeyframeProperties) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for KeyframeProperties

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> NodeState for T
where T: Send + 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Get self as Any for downcasting
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Get self as mutable Any for downcasting
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,