A framework independent animation library for rust, works nicely with Iced and the others

Overview

anim

Test and Build Documentation Crates.io License

A framework independent animation library for rust, works nicely with Iced and the others.

Showcase

Color&Opacity Animation Example

Size Animation Example

Raindrop Splash Animation

How to install?

Include anim in your Cargo.toml dependencies:

[dependencies]
anim = "0.1"

Note: anim turns on iced-backend feature by default. You need to disable default features if you do not work with iced.

[dependencies]
anim = { version="0.1", default-features = false }

How to use?

There are 3 important concepts in anim:

  • Animatable Types derived from Animatable means that its values can be calculated based on timing progress, with which you can create Animation objects.

  • Animation The Animation generates values based on its timing progress. You can construct a big Animation from small ones.

  • Timeline With Timeline you can control your animations' lifetime.


For simple scenarios, you just need Options.

use anim::{Options, Timeline, Animation, easing};

Then, build and start your animation:

use std::time::Duration;
use anim::{Options, Timeline, Animation, easing};

let mut timeline = Options::new(20,100).easing(easing::bounce_ease())
    .duration(Duration::from_millis(300))
    .begin_animation();

loop {
    let status = timeline.update();
    if status.is_completed() {
       break;
    }
    println!("animated value: {}", timeline.value());
}

For complex scenarios, please look at examples to gain some ideas.

How to run the examples?

Example #1: color-example

This example shows you color animations:

cargo run --release --example color-example

Example #2: size-example

This example shows you size animations:

cargo run --release --example size-example

Example #3: animated-splash

This example shows you rain dop splash animations:

cargo run --release --example animated-splash

License

MIT

You might also like...
A simple, modular, and fast framework for writing MEV bots in Rust.
A simple, modular, and fast framework for writing MEV bots in Rust.

What is Artemis? Artemis is a framework for writing MEV bots in Rust. It's designed to be simple, modular, and fast. At its core, Artemis is architect

The simplest build-time framework for writing web apps with html templates and typescript

Encoped A build-time fast af tool to write static apps with html and TypeScript Features Template-based ESLint, Prettier and Rollup integration No ext

Hirola is an opinionated web framework for that is focused on simplicity and predictability.

Hirola Hirola is an opinionated web framework for that is focused on simplicity and predictability. Goals Keep it simple. Most Rust web frameworks hav

Starter template for use with the Leptos web framework and Axum.

Leptos Axum Starter Template This is a template for use with the Leptos web framework and the cargo-leptos tool using Axum. Creating your template rep

A Rust web framework

cargonauts - a Rust web framework Documentation cargonauts is a Rust web framework intended for building maintainable, well-factored web apps. This pr

📮 An elegant Telegram bots framework for Rust
📮 An elegant Telegram bots framework for Rust

teloxide A full-featured framework that empowers you to easily build Telegram bots using the async/.await syntax in Rust. It handles all the difficult

A web framework for Rust.

Rocket Rocket is an async web framework for Rust with a focus on usability, security, extensibility, and speed. #[macro_use] extern crate rocket; #[g

Rust / Wasm framework for building client web apps
Rust / Wasm framework for building client web apps

Yew Rust / Wasm client web app framework Documentation (stable) | Documentation (latest) | Examples | Changelog | Roadmap | 简体中文文档 | 繁體中文文檔 | ドキュメント A

Perseus is a blazingly fast frontend web development framework built in Rust with support for major rendering strategies

Perseus is a blazingly fast frontend web development framework built in Rust with support for major rendering strategies, reactivity without a virtual DOM, and extreme customizability

Comments
  • Errors without default

    Errors without default "derive" feature

    I'm playing with the library not using iced (seeing if it works nicely for an imgui-rs based UI), and came into this minor problem:

    The example in the README doesn't build as

    [dependencies]
    anim = { version="0.1", default-features = false }
    

    ..will error because the derive feature is currently required (I get lots of errors of things not being defined due).

    Workaround is easy enough - just need to define the derive feature then it builds nicely:

    anim = { version="0.1", default-features = false, features = ["derive"] }
    
    bug 
    opened by dbr 1
Owner
joylei
Rust, C#, Python
joylei
A (flash) message framework for actix-web. A port to Rust of Django's message framework.

actix-web-flash-messages Flash messages for actix-web Web applications sometimes need to show a one-time notification to the user - e.g. an error mess

Luca Palmieri 31 Dec 29, 2022
axum-serde is a library that provides multiple serde-based extractors and responders for the Axum web framework.

axum-serde ?? Overview axum-serde is a library that provides multiple serde-based extractors / responses for the Axum web framework. It also offers a

GengTeng 3 Dec 12, 2023
Ergonomic and modular web framework built with Tokio, Tower, and Hyper

axum axum is a web application framework that focuses on ergonomics and modularity. More information about this crate can be found in the crate docume

Tokio 7.9k Dec 31, 2022
Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix 16.2k Jan 2, 2023
A rust web framework with safety and speed in mind.

darpi A web api framework with speed and safety in mind. One of the big goals is to catch all errors at compile time, if possible. The framework uses

null 32 Apr 11, 2022
Thruster - An fast and intuitive rust web framework

A fast, middleware based, web framework written in Rust

null 913 Dec 27, 2022
A full-featured and easy-to-use web framework with the Rust programming language.

Poem Framework A program is like a poem, you cannot write a poem without writing it. --- Dijkstra A full-featured and easy-to-use web framework with t

Poem Web 2.2k Jan 6, 2023
Seed is a Rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

Seed is a Rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

null 3.6k Jan 6, 2023
Implementation of the RealWorld backend API spec in Actix, Rust's powerful actor system and most fun web framework.

Actix codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API. ❗ (2021/05/13) This cod

Allen 475 Jan 2, 2023
Demo of Rust and axum web framework

Demo of Rust and axum web framework Demonstration of: Rust: programming language that focuses on reliability and stability. axum: web framework that f

Joel Parker Henderson 115 Dec 29, 2022