pub struct SlideOptions { /* private fields */ }Expand description
Tunable parameters for SpaTransition::Slide: how long the animation
runs, which way it slides, and its CSS easing curve.
Construct with SlideOptions::default and adjust only what you need
via the builder methods — the defaults reproduce mini-static’s original,
non-configurable slide (300ms, SlideDirection::Forward, ease).
§Example
use mini_static::{SlideDirection, SlideOptions};
let options = SlideOptions::default()
.duration_ms(500)
.direction(SlideDirection::Reverse)
.easing("ease-in-out");Implementations§
Source§impl SlideOptions
impl SlideOptions
Sourcepub fn duration_ms(self, duration_ms: u32) -> Self
pub fn duration_ms(self, duration_ms: u32) -> Self
Set the animation’s animation-duration, in milliseconds.
Sourcepub fn direction(self, direction: SlideDirection) -> Self
pub fn direction(self, direction: SlideDirection) -> Self
Set which side the outgoing page exits toward.
Sourcepub fn easing(self, easing: impl Into<String>) -> Self
pub fn easing(self, easing: impl Into<String>) -> Self
Set the animation’s animation-timing-function, e.g. "ease-in-out"
or "cubic-bezier(0.4, 0, 0.2, 1)".
Embedded into a <style> tag verbatim except for < and >, which
are stripped — the only two characters that could otherwise break
out of the surrounding <style> element (see
[spa_transition_style_tag]’s use of [strip_style_breakout_chars]).
An invalid CSS value here simply fails to animate; it can’t corrupt
the page.
Trait Implementations§
Source§impl Clone for SlideOptions
impl Clone for SlideOptions
Source§fn clone(&self) -> SlideOptions
fn clone(&self) -> SlideOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more