Skip to content
API reference

lib/motion-spring

Import
import * as api from "@fungi.computer/caps/lib/motion-spring";
Kind Export Description
type alias MotionTiming Anime.js timing for one tween or segment.
type alias AuthoredSpring A component’s own spring, as authored for today’s default feel.
constant immediateTiming Timing for a change that must land at once.
function themedSpring() 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.
function themedEase() 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.

MotionTimingtype alias

Section titled “MotionTiming”
Signature
type MotionTiming = Readonly<{
ease: EasingParam;
duration: number;
}>;

Anime.js timing for one tween or segment.


AuthoredSpringtype alias

Section titled “AuthoredSpring”
Signature
type AuthoredSpring = Readonly<{
bounce: number;
duration: number;
}>;

A component’s own spring, as authored for today’s default feel.

immediateTimingconstant

Section titled “immediateTiming”
Signature
const immediateTiming: MotionTiming;

Timing for a change that must land at once.

themedSpring()function

Section titled “themedSpring()”
Signature
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.

Parameter Type
motion Motion
authored AuthoredSpring

MotionTiming


themedEase()function

Section titled “themedEase()”
Signature
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.

Parameter Type
motion Motion
authored MotionTiming

MotionTiming