{"id":15723664,"url":"https://github.com/joylei/anim-rs","last_synced_at":"2025-04-15T01:16:21.700Z","repository":{"id":57488913,"uuid":"378105407","full_name":"Joylei/anim-rs","owner":"Joylei","description":":hourglass: A framework independent animation library for rust, works nicely with Iced and the others","archived":false,"fork":false,"pushed_at":"2022-01-01T09:28:48.000Z","size":826,"stargazers_count":56,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T01:16:02.591Z","etag":null,"topics":["animation","iced","rust","visualization"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Joylei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-18T09:50:40.000Z","updated_at":"2025-03-22T15:23:30.000Z","dependencies_parsed_at":"2022-08-29T15:10:41.609Z","dependency_job_id":null,"html_url":"https://github.com/Joylei/anim-rs","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joylei%2Fanim-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joylei%2Fanim-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joylei%2Fanim-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joylei%2Fanim-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Joylei","download_url":"https://codeload.github.com/Joylei/anim-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986316,"owners_count":21194025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","iced","rust","visualization"],"created_at":"2024-10-03T22:12:43.962Z","updated_at":"2025-04-15T01:16:21.683Z","avatar_url":"https://github.com/Joylei.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[EN](./README.md) | [中文](./README_zh.md)\r\n\r\n# anim\r\n[![Test and Build](https://github.com/joylei/anim-rs/workflows/Test%20and%20Build/badge.svg?branch=master)](https://github.com/joylei/anim-rs/actions?query=workflow%3A%22Test+and+Build%22)\r\n[![Documentation](https://docs.rs/anim/badge.svg)](https://docs.rs/anim)\r\n[![Crates.io](https://img.shields.io/crates/v/anim.svg)](https://crates.io/crates/anim)\r\n[![License](https://img.shields.io/crates/l/anim.svg)](https://github.com/joylei/anim-rs/blob/master/LICENSE)\r\n\r\nA framework independent animation library for rust, works nicely with [Iced](https://github.com/hecrj/iced)  and the others.\r\n\r\n## Showcase\r\n\r\n\u003ccenter\u003e\r\n\r\n![Color\u0026Opacity Animation Example](./images/color-example.gif)\r\n\r\n![Size Animation Example](./images/size-example.gif)\r\n\r\n![Raindrop Splash Animation](./images/animated-splash.gif)\r\n\r\n\u003c/center\u003e\r\n\r\n## How to install?\r\n\r\nInclude `anim` in your `Cargo.toml` dependencies:\r\n\r\n```toml\r\n[dependencies]\r\nanim = \"0.1\"\r\n```\r\n\r\nNote: `anim` turns on `iced-backend` feature by default. You need to disable default features if you do not work with `iced`.\r\n\r\n```toml\r\n[dependencies]\r\nanim = { version=\"0.1\", default-features = false }\r\n```\r\n\r\n## How to use?\r\n\r\nThere are 3 important concepts in `anim`:\r\n- `Animatable`\r\nTypes derived from `Animatable` means that its values can be calculated based on timing progress, with which you can create `Animation` objects.\r\n\r\n- `Animation`\r\nThe `Animation` generates values based on its timing progress. You can construct a big `Animation`  from small ones.\r\n\r\n- `Timeline`\r\nWith `Timeline` you can control your animations' lifetime.\r\n\r\n---\r\n\r\nFor simple scenarios, you just need `Options`.\r\n\r\n```rust\r\nuse anim::{Options, Timeline, Animation, easing};\r\n```\r\n\r\nThen, build and start your animation:\r\n\r\n```rust\r\nuse std::time::Duration;\r\nuse anim::{Options, Timeline, Animation, easing};\r\n\r\nlet mut timeline = Options::new(20,100).easing(easing::bounce_ease())\r\n    .duration(Duration::from_millis(300))\r\n    .begin_animation();\r\n\r\nloop {\r\n    let status = timeline.update();\r\n    if status.is_completed() {\r\n       break;\r\n    }\r\n    println!(\"animated value: {}\", timeline.value());\r\n}\r\n```\r\n\r\nFor complex scenarios, please look at [examples](./examples/) to gain some ideas.\r\n\r\n\r\n## How to run the examples?\r\n\r\n### Example #1: `color-example`\r\n\r\nThis example shows you color animations:\r\n\r\n```sh\r\ncargo run --release --example color-example\r\n```\r\n\r\n### Example #2: `size-example`\r\n\r\nThis example shows you size animations:\r\n\r\n```sh\r\ncargo run --release --example size-example\r\n```\r\n\r\n### Example #3: `animated-splash`\r\n\r\nThis example shows you rain dop splash animations:\r\n\r\n```sh\r\ncargo run --release --example animated-splash\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoylei%2Fanim-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoylei%2Fanim-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoylei%2Fanim-rs/lists"}