[**@fungi.computer/caps**](../README.md) --- [@fungi.computer/caps](../README.md) / lib/motion-spring # lib/motion-spring ## Type Aliases ### MotionTiming ```ts type MotionTiming = Readonly<{ ease: EasingParam; duration: number; }>; ``` Anime.js timing for one tween or segment. --- ### AuthoredSpring ```ts type AuthoredSpring = Readonly<{ bounce: number; duration: number; }>; ``` A component's own spring, as authored for today's default feel. ## Variables ### immediateTiming ```ts const immediateTiming: MotionTiming; ``` Timing for a change that must land at once. ## Functions ### themedSpring() ```ts function themedSpring(motion, authored): MotionTiming; ``` Anime.js timing for an authored spring, in the theme's feel: bounce and settle time scale with `--stipe-motion-bounce` and `--stipe-motion-spring-duration`, and a stepped theme moves in `--stipe-motion-steps` discrete steps instead. Today's themes reproduce the authored spring exactly. #### Parameters | Parameter | Type | | ---------- | ----------------------------------- | | `motion` | [`Motion`](motion.md#motion) | | `authored` | [`AuthoredSpring`](#authoredspring) | #### Returns [`MotionTiming`](#motiontiming) --- ### themedEase() ```ts function themedEase(motion, authored): MotionTiming; ``` Anime.js timing for an authored eased segment: the duration scales with the theme's tempo, and a stepped theme replaces the curve with steps. #### Parameters | Parameter | Type | | ---------- | ------------------------------- | | `motion` | [`Motion`](motion.md#motion) | | `authored` | [`MotionTiming`](#motiontiming) | #### Returns [`MotionTiming`](#motiontiming)