# llimphi-motion Simple animation over Llimphi's Elm loop. Llimphi is pure Elm: `update(msg) -> model`. To animate a value over time (an alpha rising from 0 to 1, a position sliding) the app keeps a `Tween` in its model and asks the `Handle` to dispatch a `Msg::Tick` periodically (every ~16 ms) until the animation ends. Each `update` reads `tween.value()` and the `view` paints it. This crate is deliberately tiny: - `Lerp` — generic linear interpolation (impls for `f32`, `(f32, f32)` and `Color`). - `Tween` — timed interpolation with easing between two values. - `animate` — a helper that starts a self-sufficient tick loop over a `Handle`. The canonical durations and easings live in `llimphi_theme::motion`. ## Typical pattern ```ignore use llimphi_motion::{Tween, animate}; use llimphi_theme::motion; enum Msg { ToastShow, Tick, ToastHidden } struct Model { toast_alpha: Tween } // update: Msg::ToastShow => { model.toast_alpha = Tween::new(0.0, 1.0, motion::NORMAL, motion::ease_out_cubic); animate(handle, motion::NORMAL, || Msg::Tick); model } Msg::Tick => { // The internal loop ends by itself once the tween is done; // the `view` already reads the current alpha. model } // view: toast_view().alpha(model.toast_alpha.value()) ``` --- Part of **llimphi** — see [llimphi](../README.md).