pub enum ImageTransition {
None,
Crossfade(Transition),
Wipe(Transition, f32),
Circle(Transition),
Pixelate(Transition),
}Expand description
How an Image shows a new source: at once, or coming
in over the old picture over a Transition, which gives its time,
curve and delay. Both pictures are drawn at the image’s size, fit and
filters.
use crabshell_ui::{Easing, ImageTransition, Transition};
const WALLPAPER: ImageTransition =
ImageTransition::wipe(Transition::new(800).easing(Easing::InOutCubic), 90.0);Variants§
None
The new picture replaces the old at once. The default.
Crossfade(Transition)
The new picture fades in as the old one fades out.
Wipe(Transition, f32)
An edge sweeps across the box in the direction of the angle, in degrees as CSS’s gradient angle: 0 toward the top, 90 toward the right. The new picture is behind it. An angle that isn’t finite counts as 90.
Circle(Transition)
A circle grows from the middle until it covers the box, the new picture inside it.
Pixelate(Transition)
The old picture breaks into growing blocks and the new one sharpens out of them.
Implementations§
Source§impl ImageTransition
impl ImageTransition
Sourcepub const fn none() -> ImageTransition
pub const fn none() -> ImageTransition
No transition: a new source shows at once.
Sourcepub const fn crossfade(transition: Transition) -> ImageTransition
pub const fn crossfade(transition: Transition) -> ImageTransition
A crossfade over transition.
Sourcepub const fn wipe(transition: Transition, angle: f32) -> ImageTransition
pub const fn wipe(transition: Transition, angle: f32) -> ImageTransition
A wipe toward angle degrees over transition.
Sourcepub const fn circle(transition: Transition) -> ImageTransition
pub const fn circle(transition: Transition) -> ImageTransition
A circle reveal over transition.
Sourcepub const fn pixelate(transition: Transition) -> ImageTransition
pub const fn pixelate(transition: Transition) -> ImageTransition
A pixelation over transition.
Sourcepub const fn transition(self) -> Option<Transition>
pub const fn transition(self) -> Option<Transition>
Its time and curve, None for none.