Struct simple_gallery::TransitionConfig
source · [−]pub struct TransitionConfig {
pub imgs: Vec<String>,
pub title: String,
pub n_imgs: f32,
pub duration_per_image: f32,
pub transition_time: f32,
pub animation_delay: f32,
pub duration_total: f32,
}Expand description
Store all
Fields
imgs: Vec<String>title: Stringn_imgs: f32duration_per_image: f32transition_time: f32animation_delay: f32duration_total: f32Implementations
sourceimpl TransitionConfig
impl TransitionConfig
sourcepub fn new(imgs: Vec<String>, title: String) -> TransitionConfig
pub fn new(imgs: Vec<String>, title: String) -> TransitionConfig
From a list of images, generator all the animation values for CSS.
sourcepub fn keyframes(&self) -> Vec<(i32, i32)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn keyframes(&self) -> Vec<(i32, i32)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Return a vec of tuples, for declaring the keyframes of the CSS transition animation. Tuples are e.g. (0, 1) where 0 is 0% of progress through the animation, and 1 is “opacity: 1”.
sourcepub fn generate_html(&self) -> String
pub fn generate_html(&self) -> String
Emit full in-line HTML for application. The img-src attributes are the only external resources loaded.
Trait Implementations
sourceimpl Serialize for TransitionConfig
impl Serialize for TransitionConfig
Auto Trait Implementations
impl RefUnwindSafe for TransitionConfig
impl Send for TransitionConfig
impl Sync for TransitionConfig
impl Unpin for TransitionConfig
impl UnwindSafe for TransitionConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more