Skip to main content

Crate use_motion_preference

Crate use_motion_preference 

Source
Expand description

Primitive reduced-motion preference helpers.

These helpers keep policy decisions explicit and deterministic.

§Examples

use use_motion_preference::{
    AnimationPolicy, MotionPreference, adjust_duration_ms, animation_policy,
    should_disable_animation, should_reduce_motion,
};

assert_eq!(
    animation_policy(MotionPreference::Reduce, false),
    AnimationPolicy::Disable
);
assert_eq!(
    animation_policy(MotionPreference::Reduce, true),
    AnimationPolicy::Reduce
);
assert!(should_reduce_motion(MotionPreference::Reduce));
assert!(should_disable_animation(MotionPreference::Reduce, false));
assert_eq!(adjust_duration_ms(400, MotionPreference::Reduce), 200);

Enums§

AnimationPolicy
MotionPreference

Functions§

adjust_duration_ms
animation_policy
should_disable_animation
should_reduce_motion