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
#EasingType Source
data EasingTypeEnumeration of all easing types Organized by category for UI presentation
Constructors
LinearQuadInQuadOutQuadInOutCubicInCubicOutCubicInOutSinInSinOutSinInOutExpInExpOutExpInOutCircleInCircleOutCircleInOutBackInBackOutBackInOutElasticInElasticOutElasticInOutBounceInBounceOutBounceInOut
Instances
#toFunction Source
toFunction :: EasingType -> EasingConvert EasingType to the actual easing function
#allEasingTypes Source
allEasingTypes :: Array EasingTypeAll easing types in order (for populating dropdowns, etc.)
#easingLabel Source
easingLabel :: EasingType -> StringHuman-readable label for each easing type
#easingCategory Source
easingCategory :: EasingType -> StringCategory for grouping in UI