Skip to main content

Module motion

Module motion 

Source
Expand description

MotionScheme::neutral: the design-language-free motion scheme — six spring presets plus a duration/easing token vocabulary, replacing a plain duration+easing-only model.

This crate constructs no other MotionScheme — a design system builds its own from its own plugin crate (frust-material’s tokens module carries the M3 Expressive six-spring mapping, source cited there; frust-cupertino’s carries the community-documented iOS spring baseline). Unlike crate::shape/crate::elevation/crate::typography, MotionScheme::neutral’s springs are not a reused M3 table — every spring here is critically damped (no bounce), a deliberately unbranded feel distinct from either design system’s springier presets (see that constructor’s own doc comment).

MotionSpring is plain data defined here rather than reusing frust-core’s animation-core spring type: frust-theme already depends on frust-core (see docs/ARCHITECTURE.md), so impl From<MotionSpring> for SpringDesc below lives right here rather than in a separate facade conversion.

Structs§

CosmeticLoopRate
The CosmeticLoop tick-rate cap (Hz) — an app-tunable pacing token consumed by the frame gate’s pacing: a purely cosmetic, indefinitely-looping animation (a shimmer/pulse with no user-visible endpoint) is capped to this rate rather than repainting every display frame. Uncapped (0/None) is not an allowed value — a cosmetic loop always paces to some ceiling, so this type clamps any constructed value up to CosmeticLoopRate::FLOOR_HZ (10Hz), a sane floor below which a “cosmetic” loop reads as visibly stuttering rather than paced.
EasingSet
The three-easing vocabulary Glyph’s bezier-authored motion patterns are built from: spatial (position/size changes — may overshoot), effects (opacity/color changes — never overshoots), and exit (elements leaving the screen — accelerates out). See MotionScheme::neutral for this crate’s own curve values, and frust-material/frust-cupertino’s own tokens modules for their per-baseline curve values and sources.
MotionDurations
Named duration tokens, in milliseconds.
MotionScheme
Six motion spring presets, plus the Glyph duration/easing token vocabulary mapped onto each baseline.
MotionSpring
A physics spring’s damping ratio and stiffness (mass is implicitly 1.0 for every preset; see module docs).