Module

Hylograph.Transition.Easing

Package
purescript-hylograph-transitions
Repository
afcondon/purescript-hylograph-transitions

Easing Types

An enumeration of all supported easing functions with runtime selection. This module complements Hylograph.Transition.Tick by providing a data type that can be stored, serialized, and used for UI selection.

Usage:

import Hylograph.Transition.Easing (EasingType(..), toFunction)
import Hylograph.Transition.Tick (lerp, withEasing)

-- Store easing preference
type Config = { easing :: EasingType, duration :: Int }

-- Apply at runtime
animate config progress =
  withEasing (toFunction config.easing) (lerp 0.0 100.0) progress

#toFunction Source

toFunction :: EasingType -> Easing

Convert EasingType to the actual easing function

#allEasingTypes Source

allEasingTypes :: Array EasingType

All easing types in order (for populating dropdowns, etc.)

#easingLabel Source

easingLabel :: EasingType -> String

Human-readable label for each easing type

#easingCategory Source

easingCategory :: EasingType -> String

Category for grouping in UI