Crates.io | nice_and_easy |
lib.rs | nice_and_easy |
version | 2.0.8 |
source | src |
created_at | 2024-09-04 21:45:40.958221 |
updated_at | 2024-09-05 10:47:43.526206 |
description | A minimalistic Rust library for smooth and effortless easing functions |
homepage | https://github.com/petergilmour1987/nice_and_easy |
repository | https://github.com/petergilmour1987/nice_and_easy |
max_upload_size | |
id | 1363859 |
size | 27,862 |
nice_and_easy is a Rust library designed to make smooth transitions a breeze.
Whether you’re working with f32 or f64 types, this library offers a wide range of easing functions that help you create fluid animations and transitions in your applications.
From linear to more complex easing functions, nice_and_easy has you covered, allowing you to focus on crafting delightful user experiences without the hassle.
Features:
With nice_and_easy, achieving smooth, natural motion has never been easier!
For visualizing these functions, you can use the website https://easings.net
use nice_and_easy::*;
fn main() {
// Can be used with f32...
let progress: f32 = 0.5;
let starting_value: f32 = 0.0;
let target: f32 = 2.0;
let duration: f32 = 1.0;
let value: f32 = sine_in_out(progress, starting_value, target, duration);
assert_eq!(value, 1.0);
// ...or f64
let progress: f64 = 0.5;
let starting_value: f64 = 0.0;
let target: f64 = 2.0;
let duration: f64 = 1.0;
let value: f64 = quad_in_out(progress, starting_value, target, duration);
assert_eq!(value, 1.0);
}